Skip to content

Commit

Permalink
Input: synaptics-rmi4 - fix register descriptor subpacket map constru…
Browse files Browse the repository at this point in the history
…ction

The map_offset variable is specific to the register and needs to be reset
in the loop. Otherwise, subsequent register's subpacket maps will have
their bits set at the wrong index.

Signed-off-by: Andrew Duggan <[email protected]>
Tested-by: Nitin Chaudhary <[email protected]>
Reviewed-by: Benjamin Tissoires <[email protected]>
Cc: [email protected]
Signed-off-by: Dmitry Torokhov <[email protected]>
  • Loading branch information
aduggan-syna authored and dtor committed Aug 22, 2016
1 parent fae1698 commit 3e29d6b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/input/rmi4/rmi_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,6 @@ int rmi_read_register_desc(struct rmi_device *d, u16 addr,
goto free_struct_buff;

reg = find_first_bit(rdesc->presense_map, RMI_REG_DESC_PRESENSE_BITS);
map_offset = 0;
for (i = 0; i < rdesc->num_registers; i++) {
struct rmi_register_desc_item *item = &rdesc->registers[i];
int reg_size = struct_buf[offset];
Expand All @@ -576,6 +575,8 @@ int rmi_read_register_desc(struct rmi_device *d, u16 addr,
item->reg = reg;
item->reg_size = reg_size;

map_offset = 0;

do {
for (b = 0; b < 7; b++) {
if (struct_buf[offset] & (0x1 << b))
Expand Down

0 comments on commit 3e29d6b

Please sign in to comment.