diff options
author | Jeeja KP <jeeja.kp@intel.com> | 2015-08-21 21:36:18 +0530 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2015-08-21 19:28:18 +0200 |
commit | c5b0c09b8fa3e02d9cbfd9445fb4114becdd3390 (patch) | |
tree | 6f161a9aba40c0c2fdb0ed0a9dd5205899252535 /sound/hda | |
parent | a7e3dd85cab1c6990cafd0bedb0b8809f15149b0 (diff) | |
download | linux-rpi3-c5b0c09b8fa3e02d9cbfd9445fb4114becdd3390.tar.gz linux-rpi3-c5b0c09b8fa3e02d9cbfd9445fb4114becdd3390.tar.bz2 linux-rpi3-c5b0c09b8fa3e02d9cbfd9445fb4114becdd3390.zip |
ALSA: hdac: Add snd_hdac_ext_bus_link_power_down_all()
New HDA controllers like Skylake sport multiple HDA links, so we need a
helper to turn off all the links in one go while suspending the device so
add snd_hdac_ext_bus_link_power_down_all() API
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 'sound/hda')
-rw-r--r-- | sound/hda/ext/hdac_ext_controller.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/sound/hda/ext/hdac_ext_controller.c b/sound/hda/ext/hdac_ext_controller.c index d3bb112754f2..63215b17247c 100644 --- a/sound/hda/ext/hdac_ext_controller.c +++ b/sound/hda/ext/hdac_ext_controller.c @@ -280,3 +280,23 @@ int snd_hdac_ext_bus_link_power_down(struct hdac_ext_link *link) return check_hdac_link_power_active(link, false); } EXPORT_SYMBOL_GPL(snd_hdac_ext_bus_link_power_down); + +/** + * snd_hdac_ext_bus_link_power_down_all -power down all hda link + * @ebus: HD-audio extended bus + */ +int snd_hdac_ext_bus_link_power_down_all(struct hdac_ext_bus *ebus) +{ + struct hdac_ext_link *hlink = NULL; + int ret; + + list_for_each_entry(hlink, &ebus->hlink_list, list) { + snd_hdac_updatel(hlink->ml_addr, AZX_REG_ML_LCTL, AZX_MLCTL_SPA, 0); + ret = check_hdac_link_power_active(hlink, false); + if (ret < 0) + return ret; + } + + return 0; +} +EXPORT_SYMBOL_GPL(snd_hdac_ext_bus_link_power_down_all); |