Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 182755
b: refs/heads/master
c: c21bd02
h: refs/heads/master
i:
  182753: 890fa44
  182751: 9a30f90
v: v3
  • Loading branch information
Takashi Iwai committed Feb 8, 2010
1 parent c7b62d6 commit d208a0d
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 31 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: 07f804495cb08c8fdf16eee8f7d90edce4a3c9c5
refs/heads/master: c21bd0254371c207636e84c9e033d13a6fe48d43
57 changes: 27 additions & 30 deletions trunk/sound/pci/hda/patch_sigmatel.c
Original file line number Diff line number Diff line change
Expand Up @@ -4363,6 +4363,12 @@ static int stac92xx_init(struct hda_codec *codec)
if (enable_pin_detect(codec, nid, STAC_PWR_EVENT))
stac_issue_unsol_event(codec, nid);
}

#ifdef CONFIG_SND_HDA_POWER_SAVE
/* sync mute LED */
if (spec->gpio_led && codec->patch_ops.check_power_status)
codec->patch_ops.check_power_status(codec, 0x01);
#endif
if (spec->dac_list)
stac92xx_power_down(codec);
return 0;
Expand Down Expand Up @@ -4909,6 +4915,11 @@ static int stac92xx_resume(struct hda_codec *codec)
stac_issue_unsol_event(codec,
spec->autocfg.line_out_pins[0]);
}
#ifdef CONFIG_SND_HDA_POWER_SAVE
/* sync mute LED */
if (spec->gpio_led && codec->patch_ops.check_power_status)
codec->patch_ops.check_power_status(codec, 0x01);
#endif
return 0;
}

Expand All @@ -4928,43 +4939,29 @@ static int stac92xx_hp_check_power_status(struct hda_codec *codec,
hda_nid_t nid)
{
struct sigmatel_spec *spec = codec->spec;
int i, muted = 1;

if (nid == 0x10) {
if (snd_hda_codec_amp_read(codec, nid, 0, HDA_OUTPUT, 0) &
HDA_AMP_MUTE)
spec->gpio_data &= ~spec->gpio_led; /* orange */
else
spec->gpio_data |= spec->gpio_led; /* white */

if (!spec->gpio_led_polarity) {
/* LED state is inverted on these systems */
spec->gpio_data ^= spec->gpio_led;
for (i = 0; i < spec->multiout.num_dacs; i++) {
nid = spec->multiout.dac_nids[i];
if (!(snd_hda_codec_amp_read(codec, nid, 0, HDA_OUTPUT, 0) &
HDA_AMP_MUTE)) {
muted = 0; /* something heard */
break;
}

stac_gpio_set(codec, spec->gpio_mask,
spec->gpio_dir,
spec->gpio_data);
}
if (muted)
spec->gpio_data &= ~spec->gpio_led; /* orange */
else
spec->gpio_data |= spec->gpio_led; /* white */

return 0;
}

static int idt92hd83xxx_hp_check_power_status(struct hda_codec *codec,
hda_nid_t nid)
{
struct sigmatel_spec *spec = codec->spec;
if (!spec->gpio_led_polarity) {
/* LED state is inverted on these systems */
spec->gpio_data ^= spec->gpio_led;
}

if (nid != 0x13)
return 0;
if (snd_hda_codec_amp_read(codec, nid, 0, HDA_OUTPUT, 0) & HDA_AMP_MUTE)
spec->gpio_data |= spec->gpio_led; /* mute LED on */
else
spec->gpio_data &= ~spec->gpio_led; /* mute LED off */
stac_gpio_set(codec, spec->gpio_mask, spec->gpio_dir, spec->gpio_data);

return 0;
}

#endif

static int stac92xx_suspend(struct hda_codec *codec, pm_message_t state)
Expand Down Expand Up @@ -5361,7 +5358,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 =
idt92hd83xxx_hp_check_power_status;
stac92xx_hp_check_power_status;
}
#endif

Expand Down

0 comments on commit d208a0d

Please sign in to comment.