]> err.no Git - linux-2.6/commitdiff
Input: ads7846 - select correct SPI mode
authorImre Deak <imre.deak@nokia.com>
Thu, 18 Jan 2007 05:45:38 +0000 (00:45 -0500)
committerDmitry Torokhov <dtor@insightbb.com>
Thu, 18 Jan 2007 05:45:38 +0000 (00:45 -0500)
Talk to ADS7846 chip using SPI mode 1, which is what the chip
supports: writes on falling clock edge, reads on rising.

Signed-off-by: Imre Deak <imre.deak@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
drivers/input/touchscreen/ads7846.c

index d983cc51ad32e67f2edac5c1f147bd46d3c31683..11979be33589c1593e54ddf27dad3612b07be6f8 100644 (file)
@@ -710,6 +710,10 @@ static int __devinit ads7846_probe(struct spi_device *spi)
         * may not.  So we stick to very-portable 8 bit words, both RX and TX.
         */
        spi->bits_per_word = 8;
+       spi->mode = SPI_MODE_1;
+       err = spi_setup(spi);
+       if (err < 0)
+               return err;
 
        ts = kzalloc(sizeof(struct ads7846), GFP_KERNEL);
        input_dev = input_allocate_device();