From: marek.vasut@gmail•com (Marek Vasut)
To: linux-arm-kernel@lists•infradead.org
Subject: [PATCH v2] ARM: mx28: Clear CLKGATE bit prior to changing DIV field
Date: Tue, 17 Jan 2012 20:03:01 +0100 [thread overview]
Message-ID: <201201172003.01808.marek.vasut@gmail.com> (raw)
In-Reply-To: <1326823131-27447-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>
> ---
> Changes since v1:
> - Clear CLKGATE and DIV fields at the same time
>
> arch/arm/mach-mxs/clock-mx28.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/arch/arm/mach-mxs/clock-mx28.c
> b/arch/arm/mach-mxs/clock-mx28.c index 5d68e41..0bcfd97 100644
> --- a/arch/arm/mach-mxs/clock-mx28.c
> +++ b/arch/arm/mach-mxs/clock-mx28.c
> @@ -475,7 +475,7 @@ 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##_DIV; \
> + reg &= ~(BM_CLKCTRL_##rs##_CLKGATE | BM_CLKCTRL_##rs##_DIV); \
> reg |= div << BP_CLKCTRL_##rs##_DIV; \
> __raw_writel(reg, CLKCTRL_BASE_ADDR + HW_CLKCTRL_##rs); \
> \
Acked-by: Marek Vasut <marek.vasut@gmail•com>
next prev parent reply other threads:[~2012-01-17 19:03 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
2012-01-17 18:00 ` Fabio Estevam
2012-01-17 17:58 ` [PATCH v2] " Fabio Estevam
2012-01-17 19:03 ` Marek Vasut [this message]
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=201201172003.01808.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