Problem with spi_device->max_speed_hz = 0 on atmel_spi driver.
Subsystems (2)
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.
drivers/spi/atmel_spi.c +1 -2
@@ -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/