Request pull

Tim Gardner tim.gardner at canonical.com
Thu Aug 6 09:09:04 UTC 2009


Daniel T Chen wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA512
> 
> The following changes since commit 
> 3f0467892d9c32f7466e280fc506272feda970e7:
>    Takashi Iwai (1):
>          ALSA: hda - Reduce click noise at power-saving
> 
> are available in the git repository at:
> 
>    git://kernel.ubuntu.com/dtchen/ubuntu-karmic.git powerdown
> 
> These changes address LP: #380892, #381693, #399750, specifically the
> Sigmatel/IDT HDA codecs. Work is underway for Realtek, Analog Devices,
> and Conexant HDA codecs.
> 
> Karmic testers with Sigmatel/IDT HDA codecs have confirmed the fix.
> 
> (Caveat: the patch below has whitespace munging.)
> 
> 
> 
> - From 3f0467892d9c32f7466e280fc506272feda970e7 Mon Sep 17 00:00:00 2001
> From: Takashi Iwai <tiwai at suse.de>
> Date: Wed, 22 Jul 2009 12:39:24 +0200
> Subject: [PATCH] ALSA: hda - Reduce click noise at power-saving
> 
> Add some tricks to reduce the click noise at powering down to D3
> in the power saving mode on STAC/IDT codecs.
> The key seems to be to reset PINs before the power-down, and some
> delay before entering D3.  The needed delay is significantly long,
> but I don't know why.
> 
> Signed-off-by: Takashi Iwai <tiwai at suse.de>
> Signed-off-by: Daniel T Chen <seven.steps at gmail.com>
> - ---
>   sound/pci/hda/hda_codec.c      |    9 +++++++--
>   sound/pci/hda/patch_sigmatel.c |   14 ++++++++++++++
>   2 files changed, 21 insertions(+), 2 deletions(-)
> 
> diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
> index 88480c0..4d72e50 100644
> - --- a/sound/pci/hda/hda_codec.c
> +++ b/sound/pci/hda/hda_codec.c
> @@ -2356,9 +2356,14 @@ static void hda_set_power_state(struct hda_codec 
> *codec, hda_nid_t fg,
>          hda_nid_t nid;
>          int i;
> 
> - -       snd_hda_codec_write(codec, fg, 0, AC_VERB_SET_POWER_STATE,
> +       /* this delay seems necessary to avoid click noise at power-down 
> */
> +       if (power_state == AC_PWRST_D3)
> +               msleep(100);
> +       snd_hda_codec_read(codec, fg, 0, AC_VERB_SET_POWER_STATE,
>                              power_state);
> - -       msleep(10); /* partial workaround for "azx_get_response timeout" 
> */
> +       /* partial workaround for "azx_get_response timeout" */
> +       if (power_state == AC_PWRST_D0)
> +               msleep(10);
> 
>          nid = codec->start_nid;
>          for (i = 0; i < codec->num_nodes; i++, nid++) {
> diff --git a/sound/pci/hda/patch_sigmatel.c 
> b/sound/pci/hda/patch_sigmatel.c
> index 5383d8c..871c960 100644
> - --- a/sound/pci/hda/patch_sigmatel.c
> +++ b/sound/pci/hda/patch_sigmatel.c
> @@ -4748,6 +4748,20 @@ 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 = (wcaps & AC_WCAP_TYPE) >>
> +                       AC_WCAP_TYPE_SHIFT;
> +               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 &
> - --
> 1.6.3.3
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
> 
> iD8DBQFKefWee9GwFciKvaMRCvdyAJoDs4opSSxYnWUodAreTO2+BhYEEQCff7tk
> +zkhZl/3NVBal/HX9UedYpc=
> =K4RZ
> -----END PGP SIGNATURE-----
> 

applied with some additional administrivia in the commit message.

I made the assumption that Takashi is holding this patch for the .32 
merge window.

rtg
-- 
Tim Gardner tim.gardner at canonical.com




More information about the kernel-team mailing list