From d068ebc25e6e1360510ad8023fe7bca3dacd204e Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Mon, 2 Mar 2015 23:22:59 +0100 Subject: ALSA: hda - Move some codes up to hdac_bus struct A few basic codes for communicating over HD-audio bus are moved to struct hdac_bus now. It has only command and get_response ops in addition to the unsolicited event handling. Note that the codec-side tracing support is disabled temporarily during this transition due to the code shuffling. It will be re-enabled later once when all pieces are settled down. Signed-off-by: Takashi Iwai --- sound/pci/hda/hda_bind.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'sound/pci/hda/hda_bind.c') diff --git a/sound/pci/hda/hda_bind.c b/sound/pci/hda/hda_bind.c index e3bd2807b644..0b9ea70c546b 100644 --- a/sound/pci/hda/hda_bind.c +++ b/sound/pci/hda/hda_bind.c @@ -74,6 +74,15 @@ static int hda_codec_match(struct hdac_device *dev, struct hdac_driver *drv) return 0; } +/* process an unsolicited event */ +static void hda_codec_unsol_event(struct hdac_device *dev, unsigned int ev) +{ + struct hda_codec *codec = container_of(dev, struct hda_codec, core); + + if (codec->patch_ops.unsol_event) + codec->patch_ops.unsol_event(codec, ev); +} + /* reset the codec name from the preset */ static int codec_refresh_name(struct hda_codec *codec, const char *name) { @@ -163,6 +172,7 @@ int __hda_codec_driver_register(struct hda_codec_driver *drv, const char *name, drv->core.driver.pm = &hda_codec_driver_pm; drv->core.type = HDA_DEV_LEGACY; drv->core.match = hda_codec_match; + drv->core.unsol_event = hda_codec_unsol_event; return driver_register(&drv->core.driver); } EXPORT_SYMBOL_GPL(__hda_codec_driver_register); -- cgit v1.2.3