From: Wolfram Sang Date: Sat, 10 Sep 2011 10:29:43 +0000 (+0200) Subject: ARM: mx28: check for gated clocks when setting saif divider X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=a62407256bbcba8e3f62695a87534050ceec0e6f;p=linux-beck.git ARM: mx28: check for gated clocks when setting saif divider Like with all other clocks, the divider for the SAIF devices should not be altered when the clock is gated. Bail out when this is the case like the other clocks do. Signed-off-by: Wolfram Sang Cc: Sascha Hauer Cc: Dong Aisheng-B29396 Signed-off-by: Shawn Guo --- diff --git a/arch/arm/mach-mxs/clock-mx28.c b/arch/arm/mach-mxs/clock-mx28.c index f71d01282dcd..54d82a4b4cf0 100644 --- a/arch/arm/mach-mxs/clock-mx28.c +++ b/arch/arm/mach-mxs/clock-mx28.c @@ -477,6 +477,10 @@ static int name##_set_rate(struct clk *clk, unsigned long rate) \ reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_##rs); \ reg &= ~BM_CLKCTRL_##rs##_DIV; \ reg |= div << BP_CLKCTRL_##rs##_DIV; \ + if (reg & (1 << clk->enable_shift)) { \ + pr_err("%s: clock is gated\n", __func__); \ + return -EINVAL; \ + } \ __raw_writel(reg, CLKCTRL_BASE_ADDR + HW_CLKCTRL_##rs); \ \ for (i = 10000; i; i--) \