aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/hda_bind.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/hda/hda_bind.c')
-rw-r--r--sound/pci/hda/hda_bind.c47
1 files changed, 14 insertions, 33 deletions
diff --git a/sound/pci/hda/hda_bind.c b/sound/pci/hda/hda_bind.c
index 1f40ce3c1696..e3bd2807b644 100644
--- a/sound/pci/hda/hda_bind.c
+++ b/sound/pci/hda/hda_bind.c
@@ -47,11 +47,11 @@ static struct hda_vendor_id hda_vendor_ids[] = {
47/* 47/*
48 * find a matching codec preset 48 * find a matching codec preset
49 */ 49 */
50static int hda_bus_match(struct device *dev, struct device_driver *drv) 50static int hda_codec_match(struct hdac_device *dev, struct hdac_driver *drv)
51{ 51{
52 struct hda_codec *codec = container_of(dev, struct hda_codec, dev); 52 struct hda_codec *codec = container_of(dev, struct hda_codec, core);
53 struct hda_codec_driver *driver = 53 struct hda_codec_driver *driver =
54 container_of(drv, struct hda_codec_driver, driver); 54 container_of(drv, struct hda_codec_driver, core);
55 const struct hda_codec_preset *preset; 55 const struct hda_codec_preset *preset;
56 /* check probe_id instead of vendor_id if set */ 56 /* check probe_id instead of vendor_id if set */
57 u32 id = codec->probe_id ? codec->probe_id : codec->vendor_id; 57 u32 id = codec->probe_id ? codec->probe_id : codec->vendor_id;
@@ -154,20 +154,22 @@ static void hda_codec_driver_shutdown(struct device *dev)
154int __hda_codec_driver_register(struct hda_codec_driver *drv, const char *name, 154int __hda_codec_driver_register(struct hda_codec_driver *drv, const char *name,
155 struct module *owner) 155 struct module *owner)
156{ 156{
157 drv->driver.name = name; 157 drv->core.driver.name = name;
158 drv->driver.owner = owner; 158 drv->core.driver.owner = owner;
159 drv->driver.bus = &snd_hda_bus_type; 159 drv->core.driver.bus = &snd_hda_bus_type;
160 drv->driver.probe = hda_codec_driver_probe; 160 drv->core.driver.probe = hda_codec_driver_probe;
161 drv->driver.remove = hda_codec_driver_remove; 161 drv->core.driver.remove = hda_codec_driver_remove;
162 drv->driver.shutdown = hda_codec_driver_shutdown; 162 drv->core.driver.shutdown = hda_codec_driver_shutdown;
163 drv->driver.pm = &hda_codec_driver_pm; 163 drv->core.driver.pm = &hda_codec_driver_pm;
164 return driver_register(&drv->driver); 164 drv->core.type = HDA_DEV_LEGACY;
165 drv->core.match = hda_codec_match;
166 return driver_register(&drv->core.driver);
165} 167}
166EXPORT_SYMBOL_GPL(__hda_codec_driver_register); 168EXPORT_SYMBOL_GPL(__hda_codec_driver_register);
167 169
168void hda_codec_driver_unregister(struct hda_codec_driver *drv) 170void hda_codec_driver_unregister(struct hda_codec_driver *drv)
169{ 171{
170 driver_unregister(&drv->driver); 172 driver_unregister(&drv->core.driver);
171} 173}
172EXPORT_SYMBOL_GPL(hda_codec_driver_unregister); 174EXPORT_SYMBOL_GPL(hda_codec_driver_unregister);
173 175
@@ -319,24 +321,3 @@ int snd_hda_codec_configure(struct hda_codec *codec)
319 return err; 321 return err;
320} 322}
321EXPORT_SYMBOL_GPL(snd_hda_codec_configure); 323EXPORT_SYMBOL_GPL(snd_hda_codec_configure);
322
323/*
324 * bus registration
325 */
326struct bus_type snd_hda_bus_type = {
327 .name = "hdaudio",
328 .match = hda_bus_match,
329};
330
331static int __init hda_codec_init(void)
332{
333 return bus_register(&snd_hda_bus_type);
334}
335
336static void __exit hda_codec_exit(void)
337{
338 bus_unregister(&snd_hda_bus_type);
339}
340
341module_init(hda_codec_init);
342module_exit(hda_codec_exit);