sound/hda/codecs/realtek/alc662.c

Source file repositories/reference/linux-study-clean/sound/hda/codecs/realtek/alc662.c

File Facts

System
Linux kernel
Corpus path
sound/hda/codecs/realtek/alc662.c
Extension
.c
Size
38545 bytes
Lines
1134
Domain
Driver Families
Bucket
sound/hda
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

switch (codec->core.vendor_id) {
		case 0x10ec0662:
			err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
			break;
		case 0x10ec0272:
		case 0x10ec0663:
		case 0x10ec0665:
		case 0x10ec0668:
			err = set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT);
			break;
		case 0x10ec0273:
			err = set_beep_amp(spec, 0x0b, 0x03, HDA_INPUT);
			break;
		}
		if (err < 0)
			goto error;
	}

	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);

	return 0;

 error:
	snd_hda_gen_remove(codec);
	return err;
}

static const struct hda_codec_ops alc662_codec_ops = {
	.probe = alc662_probe,
	.remove = snd_hda_gen_remove,
	.build_controls = alc_build_controls,
	.build_pcms = snd_hda_gen_build_pcms,
	.init = alc_init,
	.unsol_event = snd_hda_jack_unsol_event,
	.resume = alc_resume,
	.suspend = alc_suspend,
	.check_power_status = snd_hda_gen_check_power_status,
	.stream_pm = snd_hda_gen_stream_pm,
};

/*
 * driver entries
 */
static const struct hda_device_id snd_hda_id_alc662[] = {
	HDA_CODEC_ID(0x10ec0272, "ALC272"),
	HDA_CODEC_ID_REV(0x10ec0662, 0x100101, "ALC662 rev1"),
	HDA_CODEC_ID_REV(0x10ec0662, 0x100300, "ALC662 rev3"),
	HDA_CODEC_ID(0x10ec0663, "ALC663"),
	HDA_CODEC_ID(0x10ec0665, "ALC665"),
	HDA_CODEC_ID(0x10ec0667, "ALC667"),
	HDA_CODEC_ID(0x10ec0668, "ALC668"),
	HDA_CODEC_ID(0x10ec0670, "ALC670"),
	HDA_CODEC_ID(0x10ec0671, "ALC671"),
	HDA_CODEC_ID(0x10ec0867, "ALC891"),
	HDA_CODEC_ID(0x10ec0892, "ALC892"),
	HDA_CODEC_ID(0x10ec0897, "ALC897"),
	{} /* terminator */
};
MODULE_DEVICE_TABLE(hdaudio, snd_hda_id_alc662);

MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Realtek ALC662 and compatible HD-audio codec");
MODULE_IMPORT_NS("SND_HDA_CODEC_REALTEK");

static struct hda_codec_driver alc662_driver = {
	.id = snd_hda_id_alc662,
	.ops = &alc662_codec_ops,
};

module_hda_codec_driver(alc662_driver);

Annotation

Implementation Notes