Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 170317
b: refs/heads/master
c: 167eae5
h: refs/heads/master
i:
  170315: e3b4ceb
v: v3
  • Loading branch information
Takashi Iwai committed Nov 6, 2009
1 parent 7293cba commit 553b409
Show file tree
Hide file tree
Showing 2 changed files with 25 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: 9ad6a46b6497ae64e7fec307deb0de88e6a8ca06
refs/heads/master: 167eae5a17b3cd44a324dbb972c338e489413f54
42 changes: 24 additions & 18 deletions trunk/sound/pci/hda/patch_sigmatel.c
Original file line number Diff line number Diff line change
Expand Up @@ -4327,13 +4327,36 @@ static void stac92xx_free_kctls(struct hda_codec *codec)
snd_array_free(&spec->kctls);
}

static void stac92xx_shutup(struct hda_codec *codec)
{
struct sigmatel_spec *spec = codec->spec;
int i;
hda_nid_t nid;

/* reset each pin before powering down DAC/ADC to avoid click noise */
nid = codec->start_nid;
for (i = 0; i < codec->num_nodes; i++, nid++) {
unsigned int wcaps = get_wcaps(codec, nid);
unsigned int wid_type = get_wcaps_type(wcaps);
if (wid_type == AC_WID_PIN)
snd_hda_codec_read(codec, nid, 0,
AC_VERB_SET_PIN_WIDGET_CONTROL, 0);
}

if (spec->eapd_mask)
stac_gpio_set(codec, spec->gpio_mask,
spec->gpio_dir, spec->gpio_data &
~spec->eapd_mask);
}

static void stac92xx_free(struct hda_codec *codec)
{
struct sigmatel_spec *spec = codec->spec;

if (! spec)
return;

stac92xx_shutup(codec);
stac92xx_free_jacks(codec);
snd_array_free(&spec->events);

Expand Down Expand Up @@ -4793,24 +4816,7 @@ static int stac92xx_hp_check_power_status(struct hda_codec *codec,

static int stac92xx_suspend(struct hda_codec *codec, pm_message_t state)
{
struct sigmatel_spec *spec = codec->spec;
int i;
hda_nid_t nid;

/* reset each pin before powering down DAC/ADC to avoid click noise */
nid = codec->start_nid;
for (i = 0; i < codec->num_nodes; i++, nid++) {
unsigned int wcaps = get_wcaps(codec, nid);
unsigned int wid_type = get_wcaps_type(wcaps);
if (wid_type == AC_WID_PIN)
snd_hda_codec_read(codec, nid, 0,
AC_VERB_SET_PIN_WIDGET_CONTROL, 0);
}

if (spec->eapd_mask)
stac_gpio_set(codec, spec->gpio_mask,
spec->gpio_dir, spec->gpio_data &
~spec->eapd_mask);
stac92xx_shutup(codec);
return 0;
}
#endif
Expand Down

0 comments on commit 553b409

Please sign in to comment.