diff options
author | Vinod Koul <vinod.koul@intel.com> | 2015-06-03 02:54:31 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2015-06-03 05:58:49 -0400 |
commit | ec71efc9aaa53b8944b119f8bedd0559c8ed5453 (patch) | |
tree | 8fa129032db0ae14c7717b8d26879a6b1c90563a /include/sound | |
parent | 03b135cebc47d75ea2dc346770374ab741966955 (diff) |
ALSA: hda - add HDA default codec match function
HDA codec drivers can be matched using vendor id and revision id typically.
So provide a match function which does this and is loaded when driver hasn't
provided one (default behaviour)
Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'include/sound')
-rw-r--r-- | include/sound/hdaudio.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/sound/hdaudio.h b/include/sound/hdaudio.h index 64fff4db81bb..4caf1fde8a4f 100644 --- a/include/sound/hdaudio.h +++ b/include/sound/hdaudio.h | |||
@@ -28,6 +28,16 @@ struct hdac_widget_tree; | |||
28 | extern struct bus_type snd_hda_bus_type; | 28 | extern struct bus_type snd_hda_bus_type; |
29 | 29 | ||
30 | /* | 30 | /* |
31 | * HDA device table | ||
32 | */ | ||
33 | struct hda_device_id { | ||
34 | __u32 vendor_id; | ||
35 | __u32 rev_id; | ||
36 | const char *name; | ||
37 | unsigned long driver_data; | ||
38 | }; | ||
39 | |||
40 | /* | ||
31 | * generic arrays | 41 | * generic arrays |
32 | */ | 42 | */ |
33 | struct snd_array { | 43 | struct snd_array { |
@@ -171,12 +181,16 @@ static inline void snd_hdac_power_down_pm(struct hdac_device *codec) {} | |||
171 | struct hdac_driver { | 181 | struct hdac_driver { |
172 | struct device_driver driver; | 182 | struct device_driver driver; |
173 | int type; | 183 | int type; |
184 | const struct hda_device_id *id_table; | ||
174 | int (*match)(struct hdac_device *dev, struct hdac_driver *drv); | 185 | int (*match)(struct hdac_device *dev, struct hdac_driver *drv); |
175 | void (*unsol_event)(struct hdac_device *dev, unsigned int event); | 186 | void (*unsol_event)(struct hdac_device *dev, unsigned int event); |
176 | }; | 187 | }; |
177 | 188 | ||
178 | #define drv_to_hdac_driver(_drv) container_of(_drv, struct hdac_driver, driver) | 189 | #define drv_to_hdac_driver(_drv) container_of(_drv, struct hdac_driver, driver) |
179 | 190 | ||
191 | const struct hda_device_id * | ||
192 | hdac_get_device_id(struct hdac_device *hdev, struct hdac_driver *drv); | ||
193 | |||
180 | /* | 194 | /* |
181 | * Bus verb operators | 195 | * Bus verb operators |
182 | */ | 196 | */ |