From: Duson Lin Date: Mon, 20 Apr 2015 17:19:24 +0000 (-0700) Subject: Input: elan_i2c - fix calculating number of x and y traces. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9f423801c9e849df56b37833df895685c9d8a940;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git Input: elan_i2c - fix calculating number of x and y traces. 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 Signed-off-by: Dmitry Torokhov --- diff --git a/drivers/input/mouse/elan_i2c_i2c.c b/drivers/input/mouse/elan_i2c_i2c.c index df221401c12a..a0acbbf83bfd 100644 --- a/drivers/input/mouse/elan_i2c_i2c.c +++ b/drivers/input/mouse/elan_i2c_i2c.c @@ -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; } diff --git a/drivers/input/mouse/elan_i2c_smbus.c b/drivers/input/mouse/elan_i2c_smbus.c index 62391b281020..30ab80dbcdd6 100644 --- a/drivers/input/mouse/elan_i2c_smbus.c +++ b/drivers/input/mouse/elan_i2c_smbus.c @@ -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; }