aboutsummaryrefslogtreecommitdiffstats
path: root/include/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2015-02-17 15:46:37 -0500
committerTakashi Iwai <tiwai@suse.de>2015-03-23 08:15:51 -0400
commite3d280fc6d42017b2379503fbda83655a05294fe (patch)
treecc89c4b22054d620163f0d6bdad901f43957dbf5 /include/sound
parent3372dbdd8ca11f51be8c6a30b2bc79eb04c4a902 (diff)
ALSA: hda - Make snd_hda_bus_type public
Define the common hd-audio driver and device types to bind over snd_hda_bus_type publicly. This allows to implement other type of device and driver code over hd-audio bus. Now both struct hda_codec and struct hda_codec_driver inherit these new struct hdac_device and struct hdac_driver, respectively. The bus registration is done in subsys_initcall() to assure it before any other driver registrations. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'include/sound')
-rw-r--r--include/sound/hdaudio.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/include/sound/hdaudio.h b/include/sound/hdaudio.h
new file mode 100644
index 000000000000..2381509bee9f
--- /dev/null
+++ b/include/sound/hdaudio.h
@@ -0,0 +1,42 @@
1/*
2 * HD-audio core stuff
3 */
4
5#ifndef __SOUND_HDAUDIO_H
6#define __SOUND_HDAUDIO_H
7
8#include <linux/device.h>
9
10/*
11 * exported bus type
12 */
13extern struct bus_type snd_hda_bus_type;
14
15/*
16 * HD-audio codec base device
17 */
18struct hdac_device {
19 struct device dev;
20 int type;
21};
22
23/* device/driver type used for matching */
24enum {
25 HDA_DEV_CORE,
26 HDA_DEV_LEGACY,
27};
28
29#define dev_to_hdac_dev(_dev) container_of(_dev, struct hdac_device, dev)
30
31/*
32 * HD-audio codec base driver
33 */
34struct hdac_driver {
35 struct device_driver driver;
36 int type;
37 int (*match)(struct hdac_device *dev, struct hdac_driver *drv);
38};
39
40#define drv_to_hdac_driver(_drv) container_of(_drv, struct hdac_driver, driver)
41
42#endif /* __SOUND_HDAUDIO_H */