Skip to contentSkip to conversation

Input: ads7846: select correct SPI mode

PATCH In review Imre Deak 1 participant 1 message May 16, 2006 Input drivers

lore
Share & tools
lore

Imre Deak

author
#0 lore raw

PATCH 3/3 Input: ads7846: select correct SPI mode

Input: ads7846: select correct SPI mode

The device is using a protocoll where writes are on the falling, reads are on the rising edge of the clock. This maps to SPI mode 1.

drivers/input/touchscreen/ads7846.c +4 -0
Index: linux-2.6/drivers/input/touchscreen/ads7846.c
===================================================================
@@ -683,6 +683,10 @@ static int __devinit ads7846_probe(struc
 
 	dev_set_drvdata(&spi->dev, ts);
 	spi->dev.power.power_state = PMSG_ON;
+	spi->mode = SPI_MODE_1;
+	err = spi_setup(spi);
+	if (err < 0)
+		goto err_free_mem;
 
 	ts->spi = spi;
 	ts->input = input_dev;