public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
From: grinberg@compulab•co.il (Igor Grinberg)
To: linux-arm-kernel@lists•infradead.org
Subject: [PATCH 1/3] ALSA: pxa27x: fix ac97 cold reset
Date: Tue, 08 Jan 2013 10:17:59 +0200	[thread overview]
Message-ID: <50EBD637.8020602@compulab.co.il> (raw)
In-Reply-To: <1357595714-13698-2-git-send-email-mikedunn@newsguy.com>

On 01/07/13 23:55, Mike Dunn wrote:
> Cold reset on the pxa27x currently fails and
> 
>      pxa2xx_ac97_try_cold_reset: cold reset timeout (GSR=0x44)
> 
> appears in the kernel log.  Through trial-and-error (the pxa270 developer's
> manual is mostly incoherent on the topic of ac97 reset), I got cold reset to
> complete by setting the WARM_RST bit in the GCR register (and later noticed that
> pxa3xx does this for cold reset as well).  Also, a timeout loop is needed to
> wait for the reset to complete.
> 
> Tested on a palm treo 680 machine.
> 
> Signed-off-by: Mike Dunn <mikedunn@newsguy•com>

Acked-by: Igor Grinberg <grinberg@compulab•co.il>

> ---
>  sound/arm/pxa2xx-ac97-lib.c |    8 ++++++--
>  1 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/sound/arm/pxa2xx-ac97-lib.c b/sound/arm/pxa2xx-ac97-lib.c
> index 6fc0ae9..1ecd0a66 100644
> --- a/sound/arm/pxa2xx-ac97-lib.c
> +++ b/sound/arm/pxa2xx-ac97-lib.c
> @@ -148,6 +148,8 @@ static inline void pxa_ac97_warm_pxa27x(void)
>  
>  static inline void pxa_ac97_cold_pxa27x(void)
>  {
> +	unsigned int timeout;
> +
>  	GCR &=  GCR_COLD_RST;  /* clear everything but nCRST */
>  	GCR &= ~GCR_COLD_RST;  /* then assert nCRST */
>  
> @@ -157,8 +159,10 @@ static inline void pxa_ac97_cold_pxa27x(void)
>  	clk_enable(ac97conf_clk);
>  	udelay(5);
>  	clk_disable(ac97conf_clk);
> -	GCR = GCR_COLD_RST;
> -	udelay(50);
> +	GCR = GCR_COLD_RST | GCR_WARM_RST;
> +	timeout = 100;     /* wait for the codec-ready bit to be set */
> +	while (!((GSR | gsr_bits) & (GSR_PCR | GSR_SCR)) && timeout--)
> +		mdelay(1);
>  }
>  #endif
>  

-- 
Regards,
Igor.

  reply	other threads:[~2013-01-08  8:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-07 21:55 [PATCH 0/3] ALSA: pxa27x: ac97 reset fixes Mike Dunn
2013-01-07 21:55 ` [PATCH 1/3] ALSA: pxa27x: fix ac97 cold reset Mike Dunn
2013-01-08  8:17   ` Igor Grinberg [this message]
2013-01-07 21:55 ` [PATCH 2/3] ALSA: pxa27x: fix ac97 warm reset Mike Dunn
2013-01-08  8:36   ` Igor Grinberg
2013-01-07 21:55 ` [PATCH 3/3] ALSA: pxa27x: rename pxa27x_assert_ac97reset() Mike Dunn
2013-01-08  8:36   ` Igor Grinberg
2013-01-08  8:44 ` [PATCH 0/3] ALSA: pxa27x: ac97 reset fixes Igor Grinberg
2013-01-08 11:30 ` Mark Brown
2013-01-08 19:16 ` Robert Jarzmik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50EBD637.8020602@compulab.co.il \
    --to=grinberg@compulab$(echo .)co.il \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox