Skip to content

Commit

Permalink
Input: elan_i2c - expand maximum product_id form 0xFF to 0xFFFF
Browse files Browse the repository at this point in the history
In order to support more projects in the future, we expand the
maximum product_id value form 0xFF to 0xFFFF.

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 Sep 21, 2015
1 parent c84333a commit ed75a14
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion drivers/input/mouse/elan_i2c.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ struct elan_transport_ops {
int (*get_sm_version)(struct i2c_client *client,
u8* ic_type, u8 *version);
int (*get_checksum)(struct i2c_client *client, bool iap, u16 *csum);
int (*get_product_id)(struct i2c_client *client, u8 *id);
int (*get_product_id)(struct i2c_client *client, u16 *id);

int (*get_max)(struct i2c_client *client,
unsigned int *max_x, unsigned int *max_y);
Expand Down
4 changes: 2 additions & 2 deletions drivers/input/mouse/elan_i2c_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#include "elan_i2c.h"

#define DRIVER_NAME "elan_i2c"
#define ELAN_DRIVER_VERSION "1.6.0"
#define ELAN_DRIVER_VERSION "1.6.1"
#define ETP_MAX_PRESSURE 255
#define ETP_FWIDTH_REDUCE 90
#define ETP_FINGER_WIDTH 15
Expand Down Expand Up @@ -76,7 +76,7 @@ struct elan_tp_data {
unsigned int x_res;
unsigned int y_res;

u8 product_id;
u16 product_id;
u8 fw_version;
u8 sm_version;
u8 iap_version;
Expand Down
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 @@ -276,7 +276,7 @@ static int elan_i2c_get_sm_version(struct i2c_client *client,
return 0;
}

static int elan_i2c_get_product_id(struct i2c_client *client, u8 *id)
static int elan_i2c_get_product_id(struct i2c_client *client, u16 *id)
{
int error;
u8 val[3];
Expand All @@ -287,7 +287,7 @@ static int elan_i2c_get_product_id(struct i2c_client *client, u8 *id)
return error;
}

*id = val[0];
*id = le16_to_cpup((__le16 *)val);
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 @@ -183,7 +183,7 @@ static int elan_smbus_get_sm_version(struct i2c_client *client,
return 0;
}

static int elan_smbus_get_product_id(struct i2c_client *client, u8 *id)
static int elan_smbus_get_product_id(struct i2c_client *client, u16 *id)
{
int error;
u8 val[3];
Expand All @@ -195,7 +195,7 @@ static int elan_smbus_get_product_id(struct i2c_client *client, u8 *id)
return error;
}

*id = val[1];
*id = be16_to_cpup((__be16 *)val);
return 0;
}

Expand Down

0 comments on commit ed75a14

Please sign in to comment.