]> git.baikalelectronics.ru Git - kernel.git/commit
spi: rspi: Round up division to avoid slave overclocking
authorGeert Uytterhoeven <geert+renesas@glider.be>
Thu, 22 May 2014 18:07:35 +0000 (20:07 +0200)
committerMark Brown <broonie@linaro.org>
Mon, 26 May 2014 13:30:37 +0000 (14:30 +0100)
commitbf38caf185b6fffa23401f74916d05bbc14ca9d6
tree03a8a90b71a75dfc60b468fc541d59731b92470a
parent03a169e57a9a3fd69c1713c317a06f163ad63b5c
spi: rspi: Round up division to avoid slave overclocking

The calculation of the bit rate divider used a standard C division, which
rounds down the quotient. This may lead to a higher bitrate than requested.
Round up to avoid this.

E.g. on Koelsch, the SPI flash (configured for 30 MHz) was driven at 48.75
MHz. After this patch it's driven at a safe 24.375 MHz.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Mark Brown <broonie@linaro.org>
drivers/spi/spi-rspi.c