Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

spi: davinci: change the lower limit of pre-scale divider to 1

SPI hardware spec for Keystone specify a lower value of 0 for pre-scale
divider which determine what max value of spi clock (spi-max-frequency)
the device can support. This translates to a clock divider of 2. So fix
the lower limit value used for the boundary check in
davinci_spi_get_prescale() function to 1 so that a maximum of spi device
clock rate / 2 is possible to be set for spi-max-frequency.

Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
Acked-by: Sekhar Nori <nsekhar@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Murali Karicheri and committed by
Mark Brown
e0b047bd b787f68c

+1 -1
+1 -1
drivers/spi/spi-davinci.c
··· 265 265 266 266 ret = DIV_ROUND_UP(clk_get_rate(dspi->clk), max_speed_hz); 267 267 268 - if (ret < 3 || ret > 256) 268 + if (ret < 1 || ret > 256) 269 269 return -EINVAL; 270 270 271 271 return ret - 1;