]> git.baikalelectronics.ru Git - kernel.git/commit
clk: lpc32xx: add a quirk for PWM and MS clock dividers
authorVladimir Zapolskiy <vz@mleia.com>
Fri, 7 Oct 2016 01:16:55 +0000 (04:16 +0300)
committerStephen Boyd <sboyd@codeaurora.org>
Wed, 2 Nov 2016 00:29:39 +0000 (17:29 -0700)
commit08fcaa723c6fc5f6a576000dae868680fff5ad05
tree9b5d46f343ebc2fbc874071b7bb34916144f3663
parent6088e1156050161cb34b302a0e61ba9f14e50a12
clk: lpc32xx: add a quirk for PWM and MS clock dividers

In common clock framework CLK_DIVIDER_ONE_BASED or'ed with
CLK_DIVIDER_ALLOW_ZERO flags indicates that
1) a divider clock may be set to zero value,
2) divider's zero value is interpreted as a non-divided clock.

On the LPC32xx platform clock dividers of PWM and memory card clocks
comply with the first condition, but zero value means a gated clock,
thus it may happen that the divider value is not updated when
the clock is enabled and the clock remains gated.

The change adds one-shot quirks, which check for zero value of divider
on initialization and set it to a non-zero value, therefore in runtime
a gate clock will work as expected.

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Reviewed-by: Sylvain Lemieux <slemieux.tyco@gmail.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
drivers/clk/nxp/clk-lpc32xx.c