summaryrefslogtreecommitdiffstats
path: root/drivers/input/touchscreen
diff options
context:
space:
mode:
authorAlexander Stein <alexander.stein@systec-electronic.com>2011-05-05 17:40:14 +0200
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2011-05-05 17:50:47 +0200
commit1dbe7dada2d03d1313183d439068f1f951a91244 (patch)
tree49f79d5fbaf5fc982f7a7742f94ed465a69220a9 /drivers/input/touchscreen
parentInput: wm831x-ts - move BTN_TOUCH reporting to data transfer (diff)
downloadlinux-1dbe7dada2d03d1313183d439068f1f951a91244.tar.xz
linux-1dbe7dada2d03d1313183d439068f1f951a91244.zip
Input: ads7846 - make transfer buffers DMA safe
req.sample needs its own cacheline otherwise accessing req.msg fetches it in again. Note: This effect doesn't occur if the underlying SPI driver doesn't use DMA at all. Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/touchscreen')
-rw-r--r--drivers/input/touchscreen/ads7846.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
index c24946f51256..ab51a8dbdb5a 100644
--- a/drivers/input/touchscreen/ads7846.c
+++ b/drivers/input/touchscreen/ads7846.c
@@ -281,17 +281,25 @@ struct ser_req {
u8 command;
u8 ref_off;
u16 scratch;
- __be16 sample;
struct spi_message msg;
struct spi_transfer xfer[6];
+ /*
+ * DMA (thus cache coherency maintenance) requires the
+ * transfer buffers to live in their own cache lines.
+ */
+ __be16 sample ____cacheline_aligned;
};
struct ads7845_ser_req {
u8 command[3];
u8 pwrdown[3];
- u8 sample[3];
struct spi_message msg;
struct spi_transfer xfer[2];
+ /*
+ * DMA (thus cache coherency maintenance) requires the
+ * transfer buffers to live in their own cache lines.
+ */
+ u8 sample[3] ____cacheline_aligned;
};
static int ads7846_read12_ser(struct device *dev, unsigned command)