diff options
Diffstat (limited to 'sound/hda')
| -rw-r--r-- | sound/hda/Kconfig | 2 | ||||
| -rw-r--r-- | sound/hda/Makefile | 3 | ||||
| -rw-r--r-- | sound/hda/hda_bus_type.c | 42 |
3 files changed, 47 insertions, 0 deletions
diff --git a/sound/hda/Kconfig b/sound/hda/Kconfig new file mode 100644 index 000000000000..4f428ccf64ad --- /dev/null +++ b/sound/hda/Kconfig | |||
| @@ -0,0 +1,2 @@ | |||
| 1 | config SND_HDA_CORE | ||
| 2 | tristate | ||
diff --git a/sound/hda/Makefile b/sound/hda/Makefile new file mode 100644 index 000000000000..59c8d1feb5aa --- /dev/null +++ b/sound/hda/Makefile | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | snd-hda-core-objs := hda_bus_type.o | ||
| 2 | |||
| 3 | obj-$(CONFIG_SND_HDA_CORE) += snd-hda-core.o | ||
diff --git a/sound/hda/hda_bus_type.c b/sound/hda/hda_bus_type.c new file mode 100644 index 000000000000..519914a12e8a --- /dev/null +++ b/sound/hda/hda_bus_type.c | |||
| @@ -0,0 +1,42 @@ | |||
| 1 | /* | ||
| 2 | * HD-audio bus | ||
| 3 | */ | ||
| 4 | #include <linux/init.h> | ||
| 5 | #include <linux/device.h> | ||
| 6 | #include <linux/module.h> | ||
| 7 | #include <linux/export.h> | ||
| 8 | #include <sound/hdaudio.h> | ||
| 9 | |||
| 10 | MODULE_DESCRIPTION("HD-audio bus"); | ||
| 11 | MODULE_LICENSE("GPL"); | ||
| 12 | |||
| 13 | static int hda_bus_match(struct device *dev, struct device_driver *drv) | ||
| 14 | { | ||
| 15 | struct hdac_device *hdev = dev_to_hdac_dev(dev); | ||
| 16 | struct hdac_driver *hdrv = drv_to_hdac_driver(drv); | ||
| 17 | |||
| 18 | if (hdev->type != hdrv->type) | ||
| 19 | return 0; | ||
| 20 | if (hdrv->match) | ||
| 21 | return hdrv->match(hdev, hdrv); | ||
| 22 | return 1; | ||
| 23 | } | ||
| 24 | |||
| 25 | struct bus_type snd_hda_bus_type = { | ||
| 26 | .name = "hdaudio", | ||
| 27 | .match = hda_bus_match, | ||
| 28 | }; | ||
| 29 | EXPORT_SYMBOL_GPL(snd_hda_bus_type); | ||
| 30 | |||
| 31 | static int __init hda_bus_init(void) | ||
| 32 | { | ||
| 33 | return bus_register(&snd_hda_bus_type); | ||
| 34 | } | ||
| 35 | |||
| 36 | static void __exit hda_bus_exit(void) | ||
| 37 | { | ||
| 38 | bus_unregister(&snd_hda_bus_type); | ||
| 39 | } | ||
| 40 | |||
| 41 | subsys_initcall(hda_bus_init); | ||
| 42 | module_exit(hda_bus_exit); | ||
