Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/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
  • Loading branch information
Linus Torvalds committed Oct 17, 2015
2 parents 4f3f957 + a487c03 commit 16c8b9c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 3 additions & 7 deletions drivers/input/mouse/cyapa_gen6.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,14 +241,10 @@ static int cyapa_gen6_read_sys_info(struct cyapa *cyapa)
memcpy(&cyapa->product_id[13], &resp_data[62], 2);
cyapa->product_id[15] = '\0';

/* Get the number of Rx electrodes. */
rotat_align = resp_data[68];
if (rotat_align) {
cyapa->electrodes_rx = cyapa->electrodes_y;
cyapa->electrodes_rx = cyapa->electrodes_y;
} else {
cyapa->electrodes_rx = cyapa->electrodes_x;
cyapa->electrodes_rx = cyapa->electrodes_y;
}
cyapa->electrodes_rx =
rotat_align ? cyapa->electrodes_y : cyapa->electrodes_x;
cyapa->aligned_electrodes_rx = (cyapa->electrodes_rx + 3) & ~3u;

if (!cyapa->electrodes_x || !cyapa->electrodes_y ||
Expand Down
8 changes: 6 additions & 2 deletions drivers/input/touchscreen/ads7846.c
Original file line number Diff line number Diff line change
Expand Up @@ -668,18 +668,22 @@ static int ads7846_no_filter(void *ads, int data_idx, int *val)

static int ads7846_get_value(struct ads7846 *ts, struct spi_message *m)
{
int value;
struct spi_transfer *t =
list_entry(m->transfers.prev, struct spi_transfer, transfer_list);

if (ts->model == 7845) {
return be16_to_cpup((__be16 *)&(((char*)t->rx_buf)[1])) >> 3;
value = be16_to_cpup((__be16 *)&(((char *)t->rx_buf)[1]));
} else {
/*
* adjust: on-wire is a must-ignore bit, a BE12 value, then
* padding; built from two 8 bit values written msb-first.
*/
return be16_to_cpup((__be16 *)t->rx_buf) >> 3;
value = be16_to_cpup((__be16 *)t->rx_buf);
}

/* enforce ADC output is 12 bits width */
return (value >> 3) & 0xfff;
}

static void ads7846_update_value(struct spi_message *m, int val)
Expand Down

0 comments on commit 16c8b9c

Please sign in to comment.