]> git.baikalelectronics.ru Git - kernel.git/commit
spi/rockchip: Avoid accidentally turning off the clock
authorDoug Anderson <dianders@chromium.org>
Thu, 28 Aug 2014 23:43:48 +0000 (16:43 -0700)
committerMark Brown <broonie@kernel.org>
Fri, 29 Aug 2014 11:07:38 +0000 (12:07 +0100)
commit1c7e7afb01b240313b364e0efc8ebff9500b3d1f
tree97b66a4e7603fcf679b1b2a54a7b63de61b3f793
parent781638fed9e537e1f24ab9e2dc528ca7bb8e79d1
spi/rockchip: Avoid accidentally turning off the clock

If our client is requesting a clock that is above the maximum clock
then the following division will result in 0:
  rs->max_freq / rs->speed

We'll then program 0 into the SPI_BAUDR register.  The Rockchip TRM
says: "If the value is 0, the serial output clock (sclk_out) is
disabled."

It's much better to end up with the fastest possible clock rather than
a clock that is off, so enforce a minimum value.

Signed-off-by: Doug Anderson <dianders@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-rockchip.c