Skip to content

Commit

Permalink
ALSA: hda - check supported power states
Browse files Browse the repository at this point in the history
Add function to check whether power states supported by specific
codec node.

Signed-off-by: Wang Xingchao <xingchao.wang@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Wang Xingchao authored and Takashi Iwai committed Jun 7, 2012
1 parent 167d2d5 commit 0c7f46a
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions sound/pci/hda/hda_codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -3504,6 +3504,22 @@ void snd_hda_codec_set_power_to_all(struct hda_codec *codec, hda_nid_t fg,
}
EXPORT_SYMBOL_HDA(snd_hda_codec_set_power_to_all);

/*
* supported power states check
*/
static bool snd_hda_codec_get_supported_ps(struct hda_codec *codec, hda_nid_t fg,
unsigned int power_state)
{
int sup = snd_hda_param_read(codec, fg, AC_PAR_POWER_STATE);

if (sup < 0)
return false;
if (sup & power_state)
return true;
else
return false;
}

/*
* set power state of the codec
*/
Expand Down

0 comments on commit 0c7f46a

Please sign in to comment.