diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-10-16 20:39:27 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-10-16 20:39:27 -0400 |
commit | 16c8b9cb246474ba4522182fc0d24caddcbba0dd (patch) | |
tree | 8277620648d4d0655046f437b18083b86c4095ea | |
parent | 4f3f9573b62be8953ac3d9888c253e0744af7195 (diff) | |
parent | a487c03fa28286d0de42558da1aa57d82d54fc4d (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Pull input fixes from Dmitry Torokhov:
"Just two small fixups to ads7846 touchscreen controller driver and
Cypress touchpad driver"
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
Input: cyapa - fix the copy paste error on electrodes_rx value
Input: ads7846 - correct the value got from SPI
-rw-r--r-- | drivers/input/mouse/cyapa_gen6.c | 10 | ||||
-rw-r--r-- | drivers/input/touchscreen/ads7846.c | 8 |
2 files changed, 9 insertions, 9 deletions
diff --git a/drivers/input/mouse/cyapa_gen6.c b/drivers/input/mouse/cyapa_gen6.c index 5f191071d44a..e4eb048d1bf6 100644 --- a/drivers/input/mouse/cyapa_gen6.c +++ b/drivers/input/mouse/cyapa_gen6.c | |||
@@ -241,14 +241,10 @@ static int cyapa_gen6_read_sys_info(struct cyapa *cyapa) | |||
241 | memcpy(&cyapa->product_id[13], &resp_data[62], 2); | 241 | memcpy(&cyapa->product_id[13], &resp_data[62], 2); |
242 | cyapa->product_id[15] = '\0'; | 242 | cyapa->product_id[15] = '\0'; |
243 | 243 | ||
244 | /* Get the number of Rx electrodes. */ | ||
244 | rotat_align = resp_data[68]; | 245 | rotat_align = resp_data[68]; |
245 | if (rotat_align) { | 246 | cyapa->electrodes_rx = |
246 | cyapa->electrodes_rx = cyapa->electrodes_y; | 247 | rotat_align ? cyapa->electrodes_y : cyapa->electrodes_x; |
247 | cyapa->electrodes_rx = cyapa->electrodes_y; | ||
248 | } else { | ||
249 | cyapa->electrodes_rx = cyapa->electrodes_x; | ||
250 | cyapa->electrodes_rx = cyapa->electrodes_y; | ||
251 | } | ||
252 | cyapa->aligned_electrodes_rx = (cyapa->electrodes_rx + 3) & ~3u; | 248 | cyapa->aligned_electrodes_rx = (cyapa->electrodes_rx + 3) & ~3u; |
253 | 249 | ||
254 | if (!cyapa->electrodes_x || !cyapa->electrodes_y || | 250 | if (!cyapa->electrodes_x || !cyapa->electrodes_y || |
diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c index 0f5f968592bd..04edc8f7122f 100644 --- a/drivers/input/touchscreen/ads7846.c +++ b/drivers/input/touchscreen/ads7846.c | |||
@@ -668,18 +668,22 @@ static int ads7846_no_filter(void *ads, int data_idx, int *val) | |||
668 | 668 | ||
669 | static int ads7846_get_value(struct ads7846 *ts, struct spi_message *m) | 669 | static int ads7846_get_value(struct ads7846 *ts, struct spi_message *m) |
670 | { | 670 | { |
671 | int value; | ||
671 | struct spi_transfer *t = | 672 | struct spi_transfer *t = |
672 | list_entry(m->transfers.prev, struct spi_transfer, transfer_list); | 673 | list_entry(m->transfers.prev, struct spi_transfer, transfer_list); |
673 | 674 | ||
674 | if (ts->model == 7845) { | 675 | if (ts->model == 7845) { |
675 | return be16_to_cpup((__be16 *)&(((char*)t->rx_buf)[1])) >> 3; | 676 | value = be16_to_cpup((__be16 *)&(((char *)t->rx_buf)[1])); |
676 | } else { | 677 | } else { |
677 | /* | 678 | /* |
678 | * adjust: on-wire is a must-ignore bit, a BE12 value, then | 679 | * adjust: on-wire is a must-ignore bit, a BE12 value, then |
679 | * padding; built from two 8 bit values written msb-first. | 680 | * padding; built from two 8 bit values written msb-first. |
680 | */ | 681 | */ |
681 | return be16_to_cpup((__be16 *)t->rx_buf) >> 3; | 682 | value = be16_to_cpup((__be16 *)t->rx_buf); |
682 | } | 683 | } |
684 | |||
685 | /* enforce ADC output is 12 bits width */ | ||
686 | return (value >> 3) & 0xfff; | ||
683 | } | 687 | } |
684 | 688 | ||
685 | static void ads7846_update_value(struct spi_message *m, int val) | 689 | static void ads7846_update_value(struct spi_message *m, int val) |