LKML Archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] spi: davinci: change the lower limit of pre-scale divider to 1
@ 2015-06-10  7:23 Murali Karicheri
  2015-06-10 17:28 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Murali Karicheri @ 2015-06-10  7:23 UTC (permalink / raw
  To: broonie, linux-spi, linux-kernel; +Cc: Murali Karicheri

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>
---
 - Re-send with updates to commit log and PATCH prefix
 - Applies to v4.1
 drivers/spi/spi-davinci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/spi-davinci.c b/drivers/spi/spi-davinci.c
index 5e99106..987afeb 100644
--- a/drivers/spi/spi-davinci.c
+++ b/drivers/spi/spi-davinci.c
@@ -265,7 +265,7 @@ static inline int davinci_spi_get_prescale(struct davinci_spi *dspi,
 
 	ret = DIV_ROUND_UP(clk_get_rate(dspi->clk), max_speed_hz);
 
-	if (ret < 3 || ret > 256)
+	if (ret < 1 || ret > 256)
 		return -EINVAL;
 
 	return ret - 1;
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v1] spi: davinci: change the lower limit of pre-scale divider to 1
  2015-06-10  7:23 [PATCH v1] spi: davinci: change the lower limit of pre-scale divider to 1 Murali Karicheri
@ 2015-06-10 17:28 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2015-06-10 17:28 UTC (permalink / raw
  To: Murali Karicheri; +Cc: linux-spi, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 498 bytes --]

On Wed, Jun 10, 2015 at 03:23:42AM -0400, Murali Karicheri wrote:
> 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.

Applied, thanks.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-06-10 17:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-10  7:23 [PATCH v1] spi: davinci: change the lower limit of pre-scale divider to 1 Murali Karicheri
2015-06-10 17:28 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).