Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 260798
b: refs/heads/master
c: 7df1ce1
h: refs/heads/master
v: v3
  • Loading branch information
Vitaliy Kulikov authored and Takashi Iwai committed Jul 26, 2011
1 parent a3bb00c commit 624606d
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 19 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d02667e6206fb3be0990c38af8447a4ed2b74c11
refs/heads/master: 7df1ce1a8197a4afec78584f56e74ab84dcab97c
53 changes: 35 additions & 18 deletions trunk/sound/pci/hda/patch_sigmatel.c
Original file line number Diff line number Diff line change
Expand Up @@ -4961,29 +4961,19 @@ static int stac92xx_resume(struct hda_codec *codec)
stac_issue_unsol_event(codec,
spec->autocfg.line_out_pins[0]);
}
/* sync mute LED */
if (spec->gpio_led)
hda_call_check_power_status(codec, 0x01);
return 0;
}

#ifdef CONFIG_SND_HDA_POWER_SAVE
/*
* using power check for controlling mute led of HP notebooks
* check for mute state only on Speakers (nid = 0x10)
*
* For this feature CONFIG_SND_HDA_POWER_SAVE is needed, otherwise
* the LED is NOT working properly !
*
* Changed name to reflect that it now works for any designated
* model, not just HP HDX.
* For this feature CONFIG_SND_HDA_POWER_SAVE is needed
* as mute LED state is updated in check_power_status hook
*/

#ifdef CONFIG_SND_HDA_POWER_SAVE
static int stac92xx_hp_check_power_status(struct hda_codec *codec,
hda_nid_t nid)
static int stac92xx_update_led_status(struct hda_codec *codec)
{
struct sigmatel_spec *spec = codec->spec;
int i, muted = 1;
int i, num_ext_dacs, muted = 1;
hda_nid_t nid;

for (i = 0; i < spec->multiout.num_dacs; i++) {
nid = spec->multiout.dac_nids[i];
Expand All @@ -4993,6 +4983,22 @@ static int stac92xx_hp_check_power_status(struct hda_codec *codec,
break;
}
}
if (muted && spec->multiout.hp_nid)
if (!(snd_hda_codec_amp_read(codec,
spec->multiout.hp_nid, 0, HDA_OUTPUT, 0) &
HDA_AMP_MUTE)) {
muted = 0; /* HP is not muted */
}
num_ext_dacs = ARRAY_SIZE(spec->multiout.extra_out_nid);
for (i = 0; muted && i < num_ext_dacs; i++) {
nid = spec->multiout.extra_out_nid[i];
if (nid == 0)
break;
if (!(snd_hda_codec_amp_read(codec, nid, 0, HDA_OUTPUT, 0) &
HDA_AMP_MUTE)) {
muted = 0; /* extra output is not muted */
}
}
if (muted)
spec->gpio_data &= ~spec->gpio_led; /* orange */
else
Expand All @@ -5006,6 +5012,17 @@ static int stac92xx_hp_check_power_status(struct hda_codec *codec,
stac_gpio_set(codec, spec->gpio_mask, spec->gpio_dir, spec->gpio_data);
return 0;
}

/*
* use power check for controlling mute led of HP notebooks
*/
static int stac92xx_check_power_status(struct hda_codec *codec,
hda_nid_t nid)
{
stac92xx_update_led_status(codec);

return 0;
}
#endif

static int stac92xx_suspend(struct hda_codec *codec, pm_message_t state)
Expand Down Expand Up @@ -5543,7 +5560,7 @@ static int patch_stac92hd83xxx(struct hda_codec *codec)
spec->gpio_data |= spec->gpio_led;
/* register check_power_status callback. */
codec->patch_ops.check_power_status =
stac92xx_hp_check_power_status;
stac92xx_check_power_status;
}
#endif

Expand Down Expand Up @@ -5871,7 +5888,7 @@ static int patch_stac92hd71bxx(struct hda_codec *codec)
spec->gpio_data |= spec->gpio_led;
/* register check_power_status callback. */
codec->patch_ops.check_power_status =
stac92xx_hp_check_power_status;
stac92xx_check_power_status;
}
#endif

Expand Down

0 comments on commit 624606d

Please sign in to comment.