diff options
author | Alexander Stein <alexander.stein@systec-electronic.com> | 2011-05-05 11:40:14 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2011-05-05 11:50:47 -0400 |
commit | 1dbe7dada2d03d1313183d439068f1f951a91244 (patch) | |
tree | 49f79d5fbaf5fc982f7a7742f94ed465a69220a9 | |
parent | bf283707d5fb174ec09215ae19860ad04ba7b67a (diff) |
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>
-rw-r--r-- | drivers/input/touchscreen/ads7846.c | 12 |
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 { | |||
281 | u8 command; | 281 | u8 command; |
282 | u8 ref_off; | 282 | u8 ref_off; |
283 | u16 scratch; | 283 | u16 scratch; |
284 | __be16 sample; | ||
285 | struct spi_message msg; | 284 | struct spi_message msg; |
286 | struct spi_transfer xfer[6]; | 285 | struct spi_transfer xfer[6]; |
286 | /* | ||
287 | * DMA (thus cache coherency maintenance) requires the | ||
288 | * transfer buffers to live in their own cache lines. | ||
289 | */ | ||
290 | __be16 sample ____cacheline_aligned; | ||
287 | }; | 291 | }; |
288 | 292 | ||
289 | struct ads7845_ser_req { | 293 | struct ads7845_ser_req { |
290 | u8 command[3]; | 294 | u8 command[3]; |
291 | u8 pwrdown[3]; | 295 | u8 pwrdown[3]; |
292 | u8 sample[3]; | ||
293 | struct spi_message msg; | 296 | struct spi_message msg; |
294 | struct spi_transfer xfer[2]; | 297 | struct spi_transfer xfer[2]; |
298 | /* | ||
299 | * DMA (thus cache coherency maintenance) requires the | ||
300 | * transfer buffers to live in their own cache lines. | ||
301 | */ | ||
302 | u8 sample[3] ____cacheline_aligned; | ||
295 | }; | 303 | }; |
296 | 304 | ||
297 | static int ads7846_read12_ser(struct device *dev, unsigned command) | 305 | static int ads7846_read12_ser(struct device *dev, unsigned command) |