aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_cirrus.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2015-02-17 09:25:37 -0500
committerTakashi Iwai <tiwai@suse.de>2015-02-23 03:16:06 -0500
commitd8a766a16ed90c4b3bd7afa6e1417f8d715db507 (patch)
tree2810742bf71c851726f27e99f9984fe334f97b8d /sound/pci/hda/patch_cirrus.c
parent327ef4f02582d01f7eedb291794106823b44a0cf (diff)
ALSA: hda - Bind codecs via standard bus
Now we create the standard HD-audio bus (/sys/bus/hdaudio), and bind the codec driver with the codec device over there. This is the first step of the whole transition so that the changes to each codec driver are kept as minimal as possible. Each codec driver needs to register hda_codec_driver struct containing the currently existing preset via the new helper macro module_hda_codec_driver(). The old hda_codec_preset_list is replaced with this infrastructure. The generic parsers (for HDMI and other) are also included in the preset with the special IDs to bind uniquely. In HD-audio core side, the device binding code is split to hda_bind.c. It provides the snd_hda_bus_type implementation to match the codec driver with the given codec vendor ID. It also manages the module auto-loading by itself like before: when the matching isn't found, it tries to probe the corresponding codec modules, and finally falls back to the generic drivers. (The special ID mentioned above is set at this stage.) The only visible change to outside is that the hdaudio sysfs entry now appears in /sys/bus/devices, not as a sound class device. More works to move the suspend/resume and remove ops will be (hopefully) done in later patches. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/patch_cirrus.c')
-rw-r--r--sound/pci/hda/patch_cirrus.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/sound/pci/hda/patch_cirrus.c b/sound/pci/hda/patch_cirrus.c
index 1589c9bcce3e..1af133933bc0 100644
--- a/sound/pci/hda/patch_cirrus.c
+++ b/sound/pci/hda/patch_cirrus.c
@@ -1219,20 +1219,8 @@ MODULE_ALIAS("snd-hda-codec-id:10134213");
1219MODULE_LICENSE("GPL"); 1219MODULE_LICENSE("GPL");
1220MODULE_DESCRIPTION("Cirrus Logic HD-audio codec"); 1220MODULE_DESCRIPTION("Cirrus Logic HD-audio codec");
1221 1221
1222static struct hda_codec_preset_list cirrus_list = { 1222static struct hda_codec_driver cirrus_driver = {
1223 .preset = snd_hda_preset_cirrus, 1223 .preset = snd_hda_preset_cirrus,
1224 .owner = THIS_MODULE,
1225}; 1224};
1226 1225
1227static int __init patch_cirrus_init(void) 1226module_hda_codec_driver(cirrus_driver);
1228{
1229 return snd_hda_add_codec_preset(&cirrus_list);
1230}
1231
1232static void __exit patch_cirrus_exit(void)
1233{
1234 snd_hda_delete_codec_preset(&cirrus_list);
1235}
1236
1237module_init(patch_cirrus_init)
1238module_exit(patch_cirrus_exit)