OSDN Git Service

Input: elan_i2c - handle devices with patterns above 1
authorJingle Wu <jingle.wu@emc.com.tw>
Thu, 16 Jul 2020 05:12:08 +0000 (22:12 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Sat, 18 Jul 2020 00:35:59 +0000 (17:35 -0700)
Extend fetching and parsing parameters of the controllers to devices with
"patterns" above 1 (which currently should be handled in the same fashion
as devices with pattern 1).

Signed-off-by: Jingle Wu <jingle.wu@emc.com.tw>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/mouse/elan_i2c_i2c.c

index bceb4bc..bb499f0 100644 (file)
@@ -284,7 +284,7 @@ static int elan_i2c_get_version(struct i2c_client *client,
                return error;
        }
 
-       if (pattern_ver == 0x01)
+       if (pattern_ver >= 0x01)
                *version = iap ? val[1] : val[0];
        else
                *version = val[0];
@@ -305,7 +305,7 @@ static int elan_i2c_get_sm_version(struct i2c_client *client,
                return error;
        }
 
-       if (pattern_ver == 0x01) {
+       if (pattern_ver >= 0x01) {
                error = elan_i2c_read_cmd(client, ETP_I2C_IC_TYPE_CMD, val);
                if (error) {
                        dev_err(&client->dev, "failed to get ic type: %d\n",