summaryrefslogtreecommitdiffstats
path: root/sound/hda
diff options
context:
space:
mode:
authorMengdong Lin <mengdong.lin@intel.com>2015-04-29 17:43:20 +0800
committerTakashi Iwai <tiwai@suse.de>2015-04-29 12:27:52 +0200
commita5e7e07c264bb76d0b7c782766989c491833de05 (patch)
tree35cd2d573347f42a479f65079d17cb9562fd3f4d /sound/hda
parentd4b7b13e19258a848da920502e27526f36c5a59d (diff)
downloadlinux-a5e7e07c264bb76d0b7c782766989c491833de05.tar.gz
linux-a5e7e07c264bb76d0b7c782766989c491833de05.tar.bz2
linux-a5e7e07c264bb76d0b7c782766989c491833de05.zip
ALSA: hda - allow a codec to control the link power
A flag "link_power_control" is added to indicate whether a codec needs to control the link power. And a new bus ops link_power() is defined for the codec to request to enable/disable the link power. Signed-off-by: Mengdong Lin <mengdong.lin@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/hda')
-rw-r--r--sound/hda/hdac_device.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/sound/hda/hdac_device.c b/sound/hda/hdac_device.c
index 55c7d086b9dd..cdee7103f649 100644
--- a/sound/hda/hdac_device.c
+++ b/sound/hda/hdac_device.c
@@ -552,6 +552,21 @@ void snd_hdac_power_down_pm(struct hdac_device *codec)
EXPORT_SYMBOL_GPL(snd_hdac_power_down_pm);
#endif
+/*
+ * Enable/disable the link power for a codec.
+ */
+int snd_hdac_link_power(struct hdac_device *codec, bool enable)
+{
+ if (!codec->link_power_control)
+ return 0;
+
+ if (codec->bus->ops->link_power)
+ return codec->bus->ops->link_power(codec->bus, enable);
+ else
+ return -EINVAL;
+}
+EXPORT_SYMBOL_GPL(snd_hdac_link_power);
+
/* codec vendor labels */
struct hda_vendor_id {
unsigned int id;