public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
From: marek.vasut@gmail•com (Marek Vasut)
To: linux-arm-kernel@lists•infradead.org
Subject: [PATCH] ARM: mx28: Clear CLKGATE bit prior to changing DIV field
Date: Tue, 17 Jan 2012 18:49:07 +0100	[thread overview]
Message-ID: <201201171849.07655.marek.vasut@gmail.com> (raw)
In-Reply-To: <1326820526-26498-1-git-send-email-fabio.estevam@freescale.com>

> MX28 Reference Manual states the following about the CLKGATE bit of
> register HW_CLKCTRL_SAIF0:
> 
> "The DIV field can change ONLY when this clock gate bit field is low."
> 
> So clear this bit prior to writing to the DIV field as required.
> 
> This also fixes the following error during mxs-sgtl5000 probe.
> 
> [    0.660000] saif0_clk_set_rate: divider writing timeout
> [    0.670000] mxs-sgtl5000: probe of mxs-sgtl5000.0 failed with error -110
> [    0.670000] ALSA device list:
> [    0.680000]   No soundcards found.
> 
> Audio is functional after this change.
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale•com>
> ---
>  arch/arm/mach-mxs/clock-mx28.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/mach-mxs/clock-mx28.c
> b/arch/arm/mach-mxs/clock-mx28.c index 5d68e41..f85c09d 100644
> --- a/arch/arm/mach-mxs/clock-mx28.c
> +++ b/arch/arm/mach-mxs/clock-mx28.c
> @@ -475,6 +475,8 @@ static int name##_set_rate(struct clk *clk, unsigned
> long rate)		\ return -EINVAL;						
\
>  									\
>  	reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_##rs);		\
> +									\
> +	reg &= ~BM_CLKCTRL_##rs##_CLKGATE;				\
>  	reg &= ~BM_CLKCTRL_##rs##_DIV;					\
>  	reg |= div << BP_CLKCTRL_##rs##_DIV;				\
>  	__raw_writel(reg, CLKCTRL_BASE_ADDR + HW_CLKCTRL_##rs);		\

Can you really do this in one swipe ? Or do you need to actually do one register 
write to ungate and another to do the configuration?

M

  reply	other threads:[~2012-01-17 17:49 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-17 17:15 [PATCH] ARM: mx28: Clear CLKGATE bit prior to changing DIV field Fabio Estevam
2012-01-17 17:49 ` Marek Vasut [this message]
2012-01-17 18:00   ` Fabio Estevam
2012-01-17 17:58 ` [PATCH v2] " Fabio Estevam
2012-01-17 19:03   ` Marek Vasut
2012-01-18  7:14   ` Shawn Guo
2012-01-18  7:44 ` [PATCH] " Lothar Waßmann
2012-01-19  2:18   ` Fabio Estevam
2012-01-19  3:17     ` Shawn Guo
2012-01-19  3:57       ` Fabio Estevam
2012-01-19  4:20         ` Shawn Guo
2012-01-19  4:44           ` Fabio Estevam
2012-01-19  5:14             ` Dong Aisheng-B29396
2012-01-19 14:04               ` Fabio Estevam
2012-01-19  4:55         ` Dong Aisheng-B29396
2012-01-19 14:53       ` Russell King - ARM Linux
2012-01-20  3:56         ` Shawn Guo

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=201201171849.07655.marek.vasut@gmail.com \
    --to=marek.vasut@gmail$(echo .)com \
    --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