linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Problem with spi_device->max_speed_hz = 0 on atmel_spi driver.
@ 2008-12-09 11:46 Stanislaw Gruszka
  0 siblings, 0 replies; only message in thread
From: Stanislaw Gruszka @ 2008-12-09 11:46 UTC (permalink / raw)
  To: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f; +Cc: Haavard Skinnemoen

Hi.

For some reason I have to slowdown clock to touchscreen device.

In atmel_spi_setup() there is comment that max_speed_hz == 0 
means as slow as possible and divider is set to maximum value.
But in atmel_spi_transfer() function is check against not zero 
max_speed_hz with EINVAL returned. 

Probably driver should setup divider for each transfer based 
on transfer->speed_hz value, but I think that would be not
necessary overhead as all used devices have constant clock. 

Below patch works fine for me.

Signed-off-by: Stanislaw Gruszka <stf_xl-5tc4TXWwyLM@public.gmane.org>
diff --git a/drivers/spi/atmel_spi.c b/drivers/spi/atmel_spi.c
index 8abae4a..eec8f11 100644
--- a/drivers/spi/atmel_spi.c
+++ b/drivers/spi/atmel_spi.c
@@ -626,8 +626,7 @@ static int atmel_spi_transfer(struct spi_device *spi, struct spi_message *msg)
 	dev_dbg(controller, "new message %p submitted for %s\n",
 			msg, spi->dev.bus_id);
 
-	if (unlikely(list_empty(&msg->transfers)
-			|| !spi->max_speed_hz))
+	if (unlikely(list_empty(&msg->transfers)))
 		return -EINVAL;
 
 	if (as->stopping)


------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2008-12-09 11:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-09 11:46 Problem with spi_device->max_speed_hz = 0 on atmel_spi driver Stanislaw Gruszka

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 NNTP newsgroup(s).