All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM: mx28: Clear CLKGATE bit prior to changing DIV field
@ 2012-01-17 17:15 Fabio Estevam
  2012-01-17 17:49 ` Marek Vasut
                   ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: Fabio Estevam @ 2012-01-17 17:15 UTC (permalink / raw)
  To: linux-arm-kernel

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);		\
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2012-01-20  3:56 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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.