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
This commit is contained in:
commit
16c8b9cb24
@ -241,14 +241,10 @@ static int cyapa_gen6_read_sys_info(struct cyapa *cyapa)
|
|||||||
memcpy(&cyapa->product_id[13], &resp_data[62], 2);
|
memcpy(&cyapa->product_id[13], &resp_data[62], 2);
|
||||||
cyapa->product_id[15] = '\0';
|
cyapa->product_id[15] = '\0';
|
||||||
|
|
||||||
|
/* Get the number of Rx electrodes. */
|
||||||
rotat_align = resp_data[68];
|
rotat_align = resp_data[68];
|
||||||
if (rotat_align) {
|
cyapa->electrodes_rx =
|
||||||
cyapa->electrodes_rx = cyapa->electrodes_y;
|
rotat_align ? cyapa->electrodes_y : cyapa->electrodes_x;
|
||||||
cyapa->electrodes_rx = cyapa->electrodes_y;
|
|
||||||
} else {
|
|
||||||
cyapa->electrodes_rx = cyapa->electrodes_x;
|
|
||||||
cyapa->electrodes_rx = cyapa->electrodes_y;
|
|
||||||
}
|
|
||||||
cyapa->aligned_electrodes_rx = (cyapa->electrodes_rx + 3) & ~3u;
|
cyapa->aligned_electrodes_rx = (cyapa->electrodes_rx + 3) & ~3u;
|
||||||
|
|
||||||
if (!cyapa->electrodes_x || !cyapa->electrodes_y ||
|
if (!cyapa->electrodes_x || !cyapa->electrodes_y ||
|
||||||
|
@ -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)
|
static int ads7846_get_value(struct ads7846 *ts, struct spi_message *m)
|
||||||
{
|
{
|
||||||
|
int value;
|
||||||
struct spi_transfer *t =
|
struct spi_transfer *t =
|
||||||
list_entry(m->transfers.prev, struct spi_transfer, transfer_list);
|
list_entry(m->transfers.prev, struct spi_transfer, transfer_list);
|
||||||
|
|
||||||
if (ts->model == 7845) {
|
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 {
|
} else {
|
||||||
/*
|
/*
|
||||||
* adjust: on-wire is a must-ignore bit, a BE12 value, then
|
* adjust: on-wire is a must-ignore bit, a BE12 value, then
|
||||||
* padding; built from two 8 bit values written msb-first.
|
* 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)
|
static void ads7846_update_value(struct spi_message *m, int val)
|
||||||
|
Loading…
Reference in New Issue
Block a user