From: Imre Deak Date: Mon, 15 May 2006 09:14:41 +0000 (-0700) Subject: [PATCH] Input: ads7846: fix byteorder in the filtering logic X-Git-Tag: v2.6.17-omap1~67 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=b2a19bf4595bd083b2077868b57d56437d8883fa;p=linux-2.6-omap-h63xx.git [PATCH] Input: ads7846: fix byteorder in the filtering logic The BE->CPU conversion must be done also in the filtering logic. Signed-off-by: Imre Deak Acked-by: David Brownell --- diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c index 05a70b490e2..cb7fda152e4 100644 --- a/drivers/input/touchscreen/ads7846.c +++ b/drivers/input/touchscreen/ads7846.c @@ -471,7 +471,7 @@ static void ads7846_debounce(void *ads) m = &ts->msg[ts->msg_idx]; t = list_entry(m->transfers.prev, struct spi_transfer, transfer_list); - val = (*(u16 *)t->rx_buf) >> 3; + val = (be16_to_cpu(*(__be16 *)t->rx_buf) >> 3) & 0x0fff; if (!ts->read_cnt || (abs(ts->last_read - val) > ts->debounce_tol)) { /* Repeat it, if this was the first read or the read * wasn't consistent enough. */