diff options
author | Wang Xingchao <xingchao.wang@intel.com> | 2012-06-06 10:02:48 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2012-06-07 05:39:52 -0400 |
commit | 0c7f46ad927cbd29965d4971730de713b478d270 (patch) | |
tree | d2ea14a982e3330641d9f59e3837fffd3045d25e /sound/pci | |
parent | 167d2d55bfb4628169a57e3adbb1e5b097dca0f5 (diff) |
ALSA: hda - check supported power states
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>
Diffstat (limited to 'sound/pci')
-rw-r--r-- | sound/pci/hda/hda_codec.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index 41ca803a1fff..b89c8ecc819a 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c | |||
@@ -3505,6 +3505,22 @@ void snd_hda_codec_set_power_to_all(struct hda_codec *codec, hda_nid_t fg, | |||
3505 | EXPORT_SYMBOL_HDA(snd_hda_codec_set_power_to_all); | 3505 | EXPORT_SYMBOL_HDA(snd_hda_codec_set_power_to_all); |
3506 | 3506 | ||
3507 | /* | 3507 | /* |
3508 | * supported power states check | ||
3509 | */ | ||
3510 | static bool snd_hda_codec_get_supported_ps(struct hda_codec *codec, hda_nid_t fg, | ||
3511 | unsigned int power_state) | ||
3512 | { | ||
3513 | int sup = snd_hda_param_read(codec, fg, AC_PAR_POWER_STATE); | ||
3514 | |||
3515 | if (sup < 0) | ||
3516 | return false; | ||
3517 | if (sup & power_state) | ||
3518 | return true; | ||
3519 | else | ||
3520 | return false; | ||
3521 | } | ||
3522 | |||
3523 | /* | ||
3508 | * set power state of the codec | 3524 | * set power state of the codec |
3509 | */ | 3525 | */ |
3510 | static void hda_set_power_state(struct hda_codec *codec, hda_nid_t fg, | 3526 | static void hda_set_power_state(struct hda_codec *codec, hda_nid_t fg, |