* [PATCH] hda: EAPD mute on suspend
@ 2008-11-19 1:54 Matthew Ranostay
2008-11-19 6:41 ` Takashi Iwai
0 siblings, 1 reply; 2+ messages in thread
From: Matthew Ranostay @ 2008-11-19 1:54 UTC (permalink / raw)
To: alsa-devel; +Cc: Takashi Iwai
Moved support for EAPD mute on suspend from stac92hd71xx_suspend
to the generic stac92xx_suspend function.
Signed-off-by: Matthew Ranostay <mranostay@embeddedalley.com>
---
diff --git a/pci/hda/patch_sigmatel.c b/pci/hda/patch_sigmatel.c
index e0298df..900d99f 100644
--- a/pci/hda/patch_sigmatel.c
+++ b/pci/hda/patch_sigmatel.c
@@ -4077,7 +4077,17 @@ static int stac92xx_resume(struct hda_codec *codec)
codec->patch_ops.unsol_event(codec, STAC_HP_EVENT << 26);
return 0;
}
-#endif
+
+static int stac92xx_suspend(struct hda_codec *codec, pm_message_t state)
+{
+ struct sigmatel_spec *spec = codec->spec;
+ if (spec->eapd_mask)
+ stac_gpio_set(codec, spec->gpio_mask,
+ spec->gpio_dir, spec->gpio_data &
+ ~spec->eapd_mask);
+ return 0;
+}
+#endif
static struct hda_codec_ops stac92xx_patch_ops = {
.build_controls = stac92xx_build_controls,
@@ -4087,6 +4097,7 @@ static struct hda_codec_ops stac92xx_patch_ops = {
.unsol_event = stac92xx_unsol_event,
#ifdef SND_HDA_NEEDS_RESUME
.resume = stac92xx_resume,
+ .suspend = stac92xx_suspend,
#endif
};
@@ -4498,14 +4509,8 @@ static int stac92hd71xx_resume(struct hda_codec *codec)
static int stac92hd71xx_suspend(struct hda_codec *codec, pm_message_t state)
{
- struct sigmatel_spec *spec = codec->spec;
-
- stac92hd71xx_set_power_state(codec, AC_PWRST_D3);
- if (spec->eapd_mask)
- stac_gpio_set(codec, spec->gpio_mask,
- spec->gpio_dir, spec->gpio_data &
- ~spec->eapd_mask);
- return 0;
+ stac92hd71xx_set_power_state(codec, AC_PWRST_D3);
+ return stac92xx_suspend(codec, state);
};
#endif
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] hda: EAPD mute on suspend
2008-11-19 1:54 [PATCH] hda: EAPD mute on suspend Matthew Ranostay
@ 2008-11-19 6:41 ` Takashi Iwai
0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2008-11-19 6:41 UTC (permalink / raw)
To: Matthew Ranostay; +Cc: alsa-devel
At Tue, 18 Nov 2008 20:54:17 -0500,
Matthew Ranostay wrote:
>
> Moved support for EAPD mute on suspend from stac92hd71xx_suspend
> to the generic stac92xx_suspend function.
>
> Signed-off-by: Matthew Ranostay <mranostay@embeddedalley.com>
Thanks, applied now with a minor modification (re-ordered suspend and
resume callbacks).
One concern is that the order of stac92hd71xx_set_power_state() in
suspend. D3 is set before GPIO EAPD down.
I guess it works, but maybe better to put power D3 after EAPD down?
Or maybe I'm too nervous about it.
thanks,
Takashi
>
> diff --git a/pci/hda/patch_sigmatel.c b/pci/hda/patch_sigmatel.c
> index e0298df..900d99f 100644
> --- a/pci/hda/patch_sigmatel.c
> +++ b/pci/hda/patch_sigmatel.c
> @@ -4077,7 +4077,17 @@ static int stac92xx_resume(struct hda_codec *codec)
> codec->patch_ops.unsol_event(codec, STAC_HP_EVENT << 26);
> return 0;
> }
> -#endif
> +
> +static int stac92xx_suspend(struct hda_codec *codec, pm_message_t state)
> +{
> + struct sigmatel_spec *spec = codec->spec;
> + if (spec->eapd_mask)
> + stac_gpio_set(codec, spec->gpio_mask,
> + spec->gpio_dir, spec->gpio_data &
> + ~spec->eapd_mask);
> + return 0;
> +}
> +#endif
>
> static struct hda_codec_ops stac92xx_patch_ops = {
> .build_controls = stac92xx_build_controls,
> @@ -4087,6 +4097,7 @@ static struct hda_codec_ops stac92xx_patch_ops = {
> .unsol_event = stac92xx_unsol_event,
> #ifdef SND_HDA_NEEDS_RESUME
> .resume = stac92xx_resume,
> + .suspend = stac92xx_suspend,
> #endif
> };
>
> @@ -4498,14 +4509,8 @@ static int stac92hd71xx_resume(struct hda_codec *codec)
>
> static int stac92hd71xx_suspend(struct hda_codec *codec, pm_message_t state)
> {
> - struct sigmatel_spec *spec = codec->spec;
> -
> - stac92hd71xx_set_power_state(codec, AC_PWRST_D3);
> - if (spec->eapd_mask)
> - stac_gpio_set(codec, spec->gpio_mask,
> - spec->gpio_dir, spec->gpio_data &
> - ~spec->eapd_mask);
> - return 0;
> + stac92hd71xx_set_power_state(codec, AC_PWRST_D3);
> + return stac92xx_suspend(codec, state);
> };
>
> #endif
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-11-19 6:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-19 1:54 [PATCH] hda: EAPD mute on suspend Matthew Ranostay
2008-11-19 6:41 ` Takashi Iwai
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.