Input: elan_i2c - fix calculating number of x and y traces.
authorDuson Lin <dusonlin@emc.com.tw>
Mon, 20 Apr 2015 17:19:24 +0000 (10:19 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Mon, 20 Apr 2015 17:30:09 +0000 (10:30 -0700)
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>
drivers/input/mouse/elan_i2c_i2c.c
drivers/input/mouse/elan_i2c_smbus.c

index df221401c12a13855ca18e9bae8305ce420afce2..a0acbbf83bfd4faaa7d14a09dbe332848dc648e4 100644 (file)
@@ -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;
 }
index 62391b281020ac86ded536940f29677534854e91..30ab80dbcdd6e013d6854c63fb7bbe1874169596 100644 (file)
@@ -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;
 }