Skip to content

Commit

Permalink
Input: elan_i2c - fix calculating number of x and y traces.
Browse files Browse the repository at this point in the history
According to Elan's firmware engineers we should not be subtracting 1 form
the raw number of x and y traces so that the pitch size is correct. For
example, if the touchpad x resolution is 2800 and x trace number is 20,
the pitch size of x should be 2800/20 = 140, not 2800/19 = 147.36.

Signed-off-by: Duson Lin <dusonlin@emc.com.tw>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
  • Loading branch information
Duson Lin authored and Dmitry Torokhov committed Apr 20, 2015
1 parent 090ad32 commit 9f42380
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions drivers/input/mouse/elan_i2c_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -365,8 +365,8 @@ static int elan_i2c_get_num_traces(struct i2c_client *client,
return error;
}

*x_traces = val[0] - 1;
*y_traces = val[1] - 1;
*x_traces = val[0];
*y_traces = val[1];

return 0;
}
Expand Down
4 changes: 2 additions & 2 deletions drivers/input/mouse/elan_i2c_smbus.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,8 @@ static int elan_smbus_get_num_traces(struct i2c_client *client,
return error;
}

*x_traces = val[1] - 1;
*y_traces = val[2] - 1;
*x_traces = val[1];
*y_traces = val[2];

return 0;
}
Expand Down

0 comments on commit 9f42380

Please sign in to comment.