summaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/hda_codec.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2009-04-21 13:37:29 +0200
committerTakashi Iwai <tiwai@suse.de>2009-04-21 13:38:30 +0200
commita3b48c88f2d5a34c0e25aec0a3dab8069e5a9a72 (patch)
tree0c530c465d128be84bd18c846587695596b2c320 /sound/pci/hda/hda_codec.c
parentb97bedcdedb4ae95b2128a4770dfc160e113b174 (diff)
downloadblackbird-op-linux-a3b48c88f2d5a34c0e25aec0a3dab8069e5a9a72.tar.gz
blackbird-op-linux-a3b48c88f2d5a34c0e25aec0a3dab8069e5a9a72.zip
ALSA: hda - minor optimization in hda_set_power_state()
Check the target power-state before checking EAPD exception to reduce unneeded verb executions. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/hda_codec.c')
-rw-r--r--sound/pci/hda/hda_codec.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index b649033a4c81..b91f6ed5cc58 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -2348,7 +2348,8 @@ static void hda_set_power_state(struct hda_codec *codec, hda_nid_t fg,
if (wcaps & AC_WCAP_POWER) {
unsigned int wid_type = (wcaps & AC_WCAP_TYPE) >>
AC_WCAP_TYPE_SHIFT;
- if (wid_type == AC_WID_PIN) {
+ if (power_state == AC_PWRST_D3 &&
+ wid_type == AC_WID_PIN) {
unsigned int pincap;
/*
* don't power down the widget if it controls
@@ -2360,7 +2361,7 @@ static void hda_set_power_state(struct hda_codec *codec, hda_nid_t fg,
nid, 0,
AC_VERB_GET_EAPD_BTLENABLE, 0);
eapd &= 0x02;
- if (power_state == AC_PWRST_D3 && eapd)
+ if (eapd)
continue;
}
}
OpenPOWER on IntegriCloud