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>
Этот коммит содержится в:
Mengdong Lin
2015-04-29 17:43:20 +08:00
коммит произвёл Takashi Iwai
родитель d4b7b13e19
Коммит a5e7e07c26
3 изменённых файлов: 23 добавлений и 0 удалений

Просмотреть файл

@@ -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;