Subject: [PATCH] AD7879: Fix spi word size

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Similar patch as reported by Oskar Schirmer <os@xxxxxxxxx> for the
AD7877.

With no word size given in the users platform data, a generic spi host
controller driver will assume a default word size of eight bit.
Ensure spi->bits_per_word is set for 16-bit transfers.

Signed-off-by: Michael Hennerich <Michael.hennerich@xxxxxxxxxx>
---
 drivers/input/touchscreen/ad7879.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/drivers/input/touchscreen/ad7879.c
b/drivers/input/touchscreen/ad7879.c
index 794d070..ff490c0 100644
--- a/drivers/input/touchscreen/ad7879.c
+++ b/drivers/input/touchscreen/ad7879.c
@@ -715,6 +715,16 @@ static int __devinit ad7879_probe(struct spi_device
*spi)
 		return -EINVAL;
 	}
 
+	if (spi->bits_per_word != 16) {
+		spi->bits_per_word = 16;
+		error = spi_setup(spi);
+		if (error) {
+			dev_dbg(&spi->dev,
+				"spi master doesn't support 16 bits/word\n");
+			return error;
+		}
+	}   
+
 	ts = kzalloc(sizeof(struct ad7879), GFP_KERNEL);
 	if (!ts)
 		return -ENOMEM;
-- 
1.6.0.2


--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux