RE: [PATCH] Input: elan_i2c - Use iap_version to get firmware information
Hi Dmitry, Please ignore this patch, I will send a right again. Thank you. Duson -Original Message- From: duson [mailto:duson...@emc.com.tw] Sent: Wednesday, September 02, 2015 8:45 AM To: Dmitry Torokhov Cc: linux-in...@vger.kernel.org; linux-kernel@vger.kernel.org; dusonlin@emc. com.tw Subject: [PATCH] Input: elan_i2c - Use iap_version to get firmware information When driver get exception ic type (0xFF), maybe occurred from wrong I2C protocol communication, system crash or other unknown situation, instead of ic_type we use iap_version to get firmware information. Signed-off-by: Duson Lin --- drivers/input/mouse/elan_i2c_core.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/input/mouse/elan_i2c_core.c b/drivers/input/mouse/elan_i2c_core.c index 5b5f403..494858c 100644 --- a/drivers/input/mouse/elan_i2c_core.c +++ b/drivers/input/mouse/elan_i2c_core.c @@ -4,7 +4,7 @@ * Copyright (c) 2013 ELAN Microelectronics Corp. * * Author: 林政維 (Duson Lin) - * Version: 1.5.9 + * Version: 1.6.0 * * Based on cyapa driver: * copyright (c) 2011-2012 Cypress Semiconductor, Inc. @@ -40,7 +40,7 @@ #include "elan_i2c.h" #define DRIVER_NAME"elan_i2c" -#define ELAN_DRIVER_VERSION"1.5.9" +#define ELAN_DRIVER_VERSION"1.6.0" #define ETP_MAX_PRESSURE 255 #define ETP_FWIDTH_REDUCE 90 #define ETP_FINGER_WIDTH 15 @@ -261,7 +261,7 @@ static int elan_query_device_info(struct elan_tp_data *data) if (error) return error; - error = elan_get_fwinfo(data->ic_type, &data->fw_vaildpage_count, + error = elan_get_fwinfo(data->iap_version, &data->fw_vaildpage_count, &data->fw_signature_address); if (error) { dev_err(&data->client->dev, -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
RE: [PATCH] Input: elan_i2c - Use iap_version to get firmware information
Hi Dmitry, Please ignore this patch, I will send a right again. Thank you. Duson -Original Message- From: duson [mailto:duson...@emc.com.tw] Sent: Wednesday, September 02, 2015 8:38 AM To: Dmitry Torokhov Cc: linux-in...@vger.kernel.org; linux-kernel@vger.kernel.org; dusonlin@emc. com.tw Subject: [PATCH] Input: elan_i2c - Use iap_version to get firmware information When driver get exception ic type (0xFF), maybe occurred from wrong I2C protocol communication, system crash or other unknown situation, instead of ic_type we use iap_version to get firmware information. --- drivers/input/mouse/elan_i2c_core.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/input/mouse/elan_i2c_core.c b/drivers/input/mouse/elan_i2c_core.c index 5b5f403..494858c 100644 --- a/drivers/input/mouse/elan_i2c_core.c +++ b/drivers/input/mouse/elan_i2c_core.c @@ -4,7 +4,7 @@ * Copyright (c) 2013 ELAN Microelectronics Corp. * * Author: 林政維 (Duson Lin) - * Version: 1.5.9 + * Version: 1.6.0 * * Based on cyapa driver: * copyright (c) 2011-2012 Cypress Semiconductor, Inc. @@ -40,7 +40,7 @@ #include "elan_i2c.h" #define DRIVER_NAME"elan_i2c" -#define ELAN_DRIVER_VERSION"1.5.9" +#define ELAN_DRIVER_VERSION"1.6.0" #define ETP_MAX_PRESSURE 255 #define ETP_FWIDTH_REDUCE 90 #define ETP_FINGER_WIDTH 15 @@ -261,7 +261,7 @@ static int elan_query_device_info(struct elan_tp_data *data) if (error) return error; - error = elan_get_fwinfo(data->ic_type, &data->fw_vaildpage_count, + error = elan_get_fwinfo(data->iap_version, &data->fw_vaildpage_count, &data->fw_signature_address); if (error) { dev_err(&data->client->dev, -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 5/5] Input: elan_i2c - Correct the x and y trace number.
The trace number does not need to subtract 1 now. Signed-off-by: Duson Lin --- drivers/input/mouse/elan_i2c_i2c.c |4 ++-- drivers/input/mouse/elan_i2c_smbus.c |4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/input/mouse/elan_i2c_i2c.c b/drivers/input/mouse/elan_i2c_i2c.c index 029941f..550f905 100644 --- a/drivers/input/mouse/elan_i2c_i2c.c +++ b/drivers/input/mouse/elan_i2c_i2c.c @@ -356,8 +356,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 06a2bcd..0b04151 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; } -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
RE: [PATCH 4/4] Input: elan_i2c - Add pressure normalization
Hi Dmitry, OK! I will send another patch again. Thank you. Duson -Original Message- From: Dmitry Torokhov [mailto:dmitry.torok...@gmail.com] Sent: Monday, April 13, 2015 7:15 AM To: duson Cc: linux-in...@vger.kernel.org; linux-kernel@vger.kernel.org; 黃世鵬 Subject: Re: [PATCH 4/4] Input: elan_i2c - Add pressure normalization Hi Duson, On Sat, Apr 11, 2015 at 07:01:00PM +0800, duson wrote: > Get pressure format flag form firmware to check need to send > normalized pressure data to upper OS or not. The normalized data will > approximate the measure of area of the ideal metal weight. For > example, using the > 8 mm metal weight touch the touchpad surface, the ideal value is > 4*4=16 (ignore the constent pi) and the pressure get from firmware will near > 16. > > Signed-off-by: Duson Lin > --- > drivers/input/mouse/elan_i2c.h |7 +-- > drivers/input/mouse/elan_i2c_core.c | 25 +++-- > drivers/input/mouse/elan_i2c_i2c.c | 26 -- > drivers/input/mouse/elan_i2c_smbus.c | 12 ++-- > 4 files changed, 54 insertions(+), 16 deletions(-) > > diff --git a/drivers/input/mouse/elan_i2c.h > b/drivers/input/mouse/elan_i2c.h index e100c1b..5ca846e 100644 > --- a/drivers/input/mouse/elan_i2c.h > +++ b/drivers/input/mouse/elan_i2c.h > @@ -1,4 +1,4 @@ > -/* > +/* > * Elan I2C/SMBus Touchpad driver > * > * Copyright (c) 2013 ELAN Microelectronics Corp. > @@ -17,7 +17,7 @@ > */ > > #ifndef _ELAN_I2C_H > -#define _ELAN_i2C_H > +#define _ELAN_I2C_H > This has already been fixed in my tree. > #include > > @@ -25,6 +25,7 @@ > #define ETP_ENABLE_CALIBRATE 0x0002 > #define ETP_DISABLE_CALIBRATE0x > #define ETP_DISABLE_POWER0x0001 > +#define ETP_PRESSURE_OFFSET 25 > > /* IAP Firmware handling */ > #define ETP_FW_NAME "elan_i2c.bin" > @@ -79,6 +80,8 @@ struct elan_transport_ops { > struct completion *reset_done); > > int (*get_report)(struct i2c_client *client, u8 *report); > + int (*get_pressure_adjustment)(struct i2c_client *client, > +int *adjustment); > }; > > extern const struct elan_transport_ops elan_smbus_ops, elan_i2c_ops; > diff --git a/drivers/input/mouse/elan_i2c_core.c > b/drivers/input/mouse/elan_i2c_core.c > index 4b970e2..6333ba6 100644 > --- a/drivers/input/mouse/elan_i2c_core.c > +++ b/drivers/input/mouse/elan_i2c_core.c > @@ -4,7 +4,7 @@ > * Copyright (c) 2013 ELAN Microelectronics Corp. > * > * Author: 林政維 (Duson Lin) > - * Version: 1.5.6 > + * Version: 1.5.7 > * > * Based on cyapa driver: > * copyright (c) 2011-2012 Cypress Semiconductor, Inc. > @@ -40,8 +40,7 @@ > #include "elan_i2c.h" > > #define DRIVER_NAME "elan_i2c" > -#define ELAN_DRIVER_VERSION "1.5.6" > -#define ETP_PRESSURE_OFFSET 25 > +#define ELAN_DRIVER_VERSION "1.5.7" > #define ETP_MAX_PRESSURE 255 > #define ETP_FWIDTH_REDUCE90 > #define ETP_FINGER_WIDTH 15 > @@ -81,7 +80,7 @@ struct elan_tp_data { > u8 sm_version; > u8 iap_version; > u16 fw_checksum; > - > + int pressure_adjustment; > u8 mode; > > boolirq_wake; > @@ -229,6 +228,11 @@ static int elan_query_device_info(struct elan_tp_data > *data) > if (error) > return error; > > + error = data->ops->get_pressure_adjustment(data->client, > +&data->pressure_adjustment); > + if (error) > + return error; > + > return 0; > } > > @@ -726,8 +730,8 @@ static void elan_report_contact(struct elan_tp_data *data, > struct input_dev *input = data->input; > unsigned int pos_x, pos_y; > unsigned int pressure, mk_x, mk_y; > - unsigned int area_x, area_y, major, minor, new_pressure; > - > + unsigned int area_x, area_y, major, minor; > + unsigned int scaled_pressure; > > if (contact_valid) { > pos_x = ((finger_data[0] & 0xf0) << 4) | @@ -756,15 +760,16 @@ > static void elan_report_contact(struct elan_tp_data *data, > major = max(area_x, area_y); > minor = min(area_x, area_y); > > - new_pressure = pressure + ETP_PRESSURE_OFFSET; > - if (new_pressure > ETP_MAX_PRESSURE) > - new_pressure = ETP_MAX_PRESSURE; > + scaled_pressure = pressure + data->pressure_adjustment; > + > + if (scaled_pressure > ETP_MAX_PRESSURE) > + scaled_pressure = ETP_MAX_PRESSURE; > > input_mt_slot(input, contact_num); > input_mt_report_slot_state(input, MT_TOOL_FINGER, true); > input_report_abs(input, ABS_MT_POSITION_X, pos_x); > input_report_abs(input, ABS_MT_POSITION_Y, data->max_y - pos_y); > -
RE: [PATCH] Input - elan_i2c: support multi ic type and iap format
Hi Dmitry, When can I fetch the newest linux source code and make sure this patch had be merged? Thank you Duson -Original Message- From: Dmitry Torokhov [mailto:dmitry.torok...@gmail.com] Sent: Tuesday, June 09, 2015 8:09 AM To: duson Cc: linux-kernel@vger.kernel.org; linux-in...@vger.kernel.org Subject: Re: [PATCH] Input - elan_i2c: support multi ic type and iap format On Sun, Jun 07, 2015 at 03:34:04AM +0800, duson wrote: > In order to support multi ic type for i2c/smbus protocol, add get ic > type command and check fw vaild page count and signature address function. > > Signed-off by: Duson Lin Applied, thank you (but please try to convince your mailer to not use quoted printable format). > --- > drivers/input/mouse/elan_i2c.h |5 ++-- > drivers/input/mouse/elan_i2c_core.c | 44 > ++ > drivers/input/mouse/elan_i2c_i2c.c |5 +++- > drivers/input/mouse/elan_i2c_smbus.c |6 +++-- > 4 files changed, 49 insertions(+), 11 deletions(-) > > diff --git a/drivers/input/mouse/elan_i2c.h > b/drivers/input/mouse/elan_i2c.h index 6d5f8a4..ff622a1 100644 > --- a/drivers/input/mouse/elan_i2c.h > +++ b/drivers/input/mouse/elan_i2c.h > @@ -33,9 +33,7 @@ > #define ETP_FW_IAP_PAGE_ERR (1 << 5) > #define ETP_FW_IAP_INTF_ERR (1 << 4) > #define ETP_FW_PAGE_SIZE 64 > -#define ETP_FW_VAILDPAGE_COUNT 768 > #define ETP_FW_SIGNATURE_SIZE6 > -#define ETP_FW_SIGNATURE_ADDRESS 0xBFFA > > struct i2c_client; > struct completion; > @@ -58,7 +56,8 @@ struct elan_transport_ops { >bool max_baseliune, u8 *value); > > int (*get_version)(struct i2c_client *client, bool iap, u8 *version); > - int (*get_sm_version)(struct i2c_client *client, u8 *version); > + 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); > > diff --git a/drivers/input/mouse/elan_i2c_core.c > b/drivers/input/mouse/elan_i2c_core.c > index fd5068b..81e7bc9 100644 > --- a/drivers/input/mouse/elan_i2c_core.c > +++ b/drivers/input/mouse/elan_i2c_core.c > @@ -4,7 +4,7 @@ > * Copyright (c) 2013 ELAN Microelectronics Corp. > * > * Author: 林政維 (Duson Lin) > - * Version: 1.5.7 > + * Version: 1.5.8 > * > * Based on cyapa driver: > * copyright (c) 2011-2012 Cypress Semiconductor, Inc. > @@ -40,7 +40,7 @@ > #include "elan_i2c.h" > > #define DRIVER_NAME "elan_i2c" > -#define ELAN_DRIVER_VERSION "1.5.7" > +#define ELAN_DRIVER_VERSION "1.5.8" > #define ETP_MAX_PRESSURE 255 > #define ETP_FWIDTH_REDUCE90 > #define ETP_FINGER_WIDTH 15 > @@ -83,6 +83,9 @@ struct elan_tp_data { > u16 fw_checksum; > int pressure_adjustment; > u8 mode; > + u8 ic_type; > + u16 fw_vaildpage_count; > + u16 fw_signature_address; > > boolirq_wake; > > @@ -91,6 +94,28 @@ struct elan_tp_data { > boolbaseline_ready; > }; > > +static int elan_get_fwinfo(u8 ic_type, u16 *vaildpage_count, > +u16 *signature_address) > +{ > + > + switch(ic_type) { > + case 0x09: > + *vaildpage_count = 768; > + break; > + case 0x0D: > + *vaildpage_count = 896; > + break; > + default: > + /* unknown ic type clear value */ > + *vaildpage_count = 0; > + *signature_address = 0; > + return -ENXIO; > + } > + *signature_address = (*vaildpage_count * ETP_FW_PAGE_SIZE) > + - ETP_FW_SIGNATURE_SIZE; > + return 0; > +} > + > static int elan_enable_power(struct elan_tp_data *data) { > int repeat = ETP_RETRY_COUNT; > @@ -221,7 +246,8 @@ static int elan_query_device_info(struct elan_tp_data > *data) > if (error) > return error; > > - error = data->ops->get_sm_version(data->client, &data->sm_version); > + error = data->ops->get_sm_version(data->client, &data->ic_type, > + &data->sm_version); > if (error) > return error; > > @@ -234,6 +260,14 @@ static int elan_query_device_info(struct elan_tp_data > *data) > if (error) > return error; > > + error = elan_get_fwinfo(data->ic_type, &data->fw_vaildpage_count, > + &data->fw_signature_address); > + if (error) { > + dev_err(&data->client->dev, > + "unknown ic type %d\n", data->ic_type); > + return error; > + } > + > return 0; > } > > @@ -318,7 +352,7 @@ static int __elan_update_firmware(struct elan_tp_data > *data, > iap
RE: [PATCH] Input - elantech: Add special check for fw_version 0x470f01 touchpad
Hi, I think it is different. It looks like the issue about these three laptops are enabled CRC but can't use the sanity check for crc_enabled=1 case. So, they need change to go to crc_enabled=0 case. * Fujitsu LIFEBOOK E544 0x470f00d0, 12, 09 2 hw buttons * Fujitsu LIFEBOOK E554 0x570f0140, 14, 0c 2 hw buttons * Fujitsu H730 0x570f00c0, 14, 0c 3 hw buttons (**) But the issue for 0x470f01 touchpad is the CRC doesn't enabled and the sanity check for crc_enabled=0 case still can't satisfy the check. BTW, yes, I can share the laptop information, I will upstream patch again. Thanks for your advice. Duson -Original Message- From: ulrik.debie...@e2big.org [mailto:ulrik.debie...@e2big.org] Sent: Thursday, July 23, 2015 3:55 AM To: duson Cc: linux-in...@vger.kernel.org; linux-kernel@vger.kernel.org; Dmitry Torokhov Subject: Re: [PATCH] Input - elantech: Add special check for fw_version 0x470f01 touchpad On Wed, Jul 22, 2015 at 09:55:51PM +0800, duson wrote: > > t is no need to check the packet[0] for sanity check when doing > elantech_packet_check_v4() function for fw_version = 0x470f01 touchpad. > Hi Duson, The laptops below also had issues with crc_enabled and they were solved by the elantech_dmi_force_crc_enabled table. (0dc1587905a50f8f61bbc29e850aa592821e4bea) * Fujitsu LIFEBOOK E544 0x470f00d0, 12, 09 2 hw buttons * Fujitsu LIFEBOOK E554 0x570f0140, 14, 0c 2 hw buttons * Fujitsu H7300x570f00c0, 14, 0c 3 hw buttons (**) Does the 0x470f01 laptop maybe have exactly the same issue ? In that case, would it not be better if we could harmonize the solution ? Do you also have the laptop name, firmware version and button configuration available for 0x470f01 and are you in a position to share that information ? > Signed-off by: Duson Lin > --- > drivers/input/mouse/elantech.c | 25 ++--- > drivers/input/mouse/elantech.h |1 + > 2 files changed, 23 insertions(+), 3 deletions(-) > > diff --git a/drivers/input/mouse/elantech.c > b/drivers/input/mouse/elantech.c index ce3d400..d969153 100644 > --- a/drivers/input/mouse/elantech.c > +++ b/drivers/input/mouse/elantech.c > @@ -784,6 +784,8 @@ static int elantech_packet_check_v4(struct psmouse *psmouse) > unsigned char *packet = psmouse->packet; > unsigned char packet_type = packet[3] & 0x03; > bool sanity_check; > + /* This represents the version of IC body. */ > + int ver = (etd->fw_version & 0x0f) >> 16; > > if (etd->tp_dev && (packet[3] & 0x0f) == 0x06) > return PACKET_TRACKPOINT; > @@ -796,9 +798,17 @@ static int elantech_packet_check_v4(struct psmouse *psmouse) >*/ > if (etd->crc_enabled) > sanity_check = ((packet[3] & 0x08) == 0x00); > - else > - sanity_check = ((packet[0] & 0x0c) == 0x04 && > - (packet[3] & 0x1c) == 0x10); > + else { > + /* > + * The sanity check only need to check packet[3] > + * when IC_body = 7 and PID = 0x2A > + */ > + if (ver == 7 && etd->samples[1] == 0x2A) > + sanity_check = ((packet[3] & 0x1c) == 0x10); > + else > + sanity_check = ((packet[0] & 0x0c) == 0x04 && > + (packet[3] & 0x1c) == 0x10); > + } > > if (!sanity_check) > return PACKET_UNKNOWN; > @@ -1648,6 +1658,15 @@ int elantech_init(struct psmouse *psmouse) >etd->capabilities[0], etd->capabilities[1], >etd->capabilities[2]); > > + if (etd->send_cmd(psmouse, ETP_SAMPLE_QUERY, > + etd->samples)) { > + psmouse_err(psmouse, "failed to query sample data.\n"); > + goto init_fail; > + } > + psmouse_info(psmouse, > + "Elan sample query result 0x%02x, 0x%02x, 0x%02x.\n", > + etd->samples[0], etd->samples[1], etd->samples[2]); > + Is this wise to run on all elantech hardware ? > if (elantech_set_absolute_mode(psmouse)) { > psmouse_err(psmouse, > "failed to put touchpad into absolute mode.\n"); diff --git > a/drivers/input/mouse/elantech.h b/drivers/input/mouse/elantech.h > index f965d15..e1cbf40 100644 > --- a/drivers/input/mouse/elantech.h > +++ b/drivers/input/mouse/elantech.h > @@ -129,6 +129,7 @@ struct elantech_data { > unsigned char reg_26; > unsigned char debug; > unsigned char capabilities[3]; > + unsigned char samples[3]; > bool paritycheck; > bool jumpy_cursor; > bool reports_pressure; > > > > > > > -- > To unsubscribe from this list: send the line "unsubscribe linux-input" > in the body of a message to majord...@vger.kernel.org More majordomo > info at http://vger.kernel.org/majordomo-info.html Kind regards
RE: [PATCH 3/3] Input - elantech: Add special check for fw_version 0x470f01 touchpad
Hi ulrik, dmitry, OK! Thanks your review, I will modify and upstream again. Thank you, Duson -Original Message- From: ulrik.debie...@e2big.org [mailto:ulrik.debie...@e2big.org] Sent: Friday, August 07, 2015 2:36 AM To: Dmitry Torokhov Cc: duson; linux-in...@vger.kernel.org; linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/3] Input - elantech: Add special check for fw_version 0x470f01 touchpad Hi Dmitry, Duson, On Wed, Aug 05, 2015 at 11:08:18AM -0700, Dmitry Torokhov wrote: > Hi Ulrik, > > On Sun, Aug 02, 2015 at 12:16:41PM +0800, duson wrote: > > It is no need to check the packet[0] for sanity check when doing > > elantech_packet_check_v4() function for fw_version = 0x470f01 touchpad. > > > > Are you OK with this version? Yes, I'm OK with this version (and also with the change you suggested below). Reviewed-by: Ulrik De Bie Thanks Ulrik > > Thanks! > > > Signed-off by: Duson Lin > > --- > > drivers/input/mouse/elantech.c | 28 +--- > > drivers/input/mouse/elantech.h |1 + > > 2 files changed, 26 insertions(+), 3 deletions(-) > > > > diff --git a/drivers/input/mouse/elantech.c > > b/drivers/input/mouse/elantech.c index 22b9ca9..5bc3d55 100644 > > --- a/drivers/input/mouse/elantech.c > > +++ b/drivers/input/mouse/elantech.c > > @@ -785,6 +785,9 @@ static int elantech_packet_check_v4(struct psmouse *psmouse) > > unsigned char packet_type = packet[3] & 0x03; > > bool sanity_check; > > > > + /* This represents the version of IC body. */ > > + int ver = (etd->fw_version & 0x0f) >> 16; > > + > > if (etd->tp_dev && (packet[3] & 0x0f) == 0x06) > > return PACKET_TRACKPOINT; > > > > @@ -796,9 +799,17 @@ static int elantech_packet_check_v4(struct psmouse *psmouse) > > */ > > if (etd->crc_enabled) > > sanity_check = ((packet[3] & 0x08) == 0x00); > > - else > > - sanity_check = ((packet[0] & 0x0c) == 0x04 && > > - (packet[3] & 0x1c) == 0x10); > > + else { > > + /* > > +* The sanity check only need to check packet[3] > > +* when IC_body = 7 and PID = 0x2A > > +*/ > > + if (ver == 7 && etd->samples[1] == 0x2A) > > + sanity_check = ((packet[3] & 0x1c) == 0x10); > > + else > > + sanity_check = ((packet[0] & 0x0c) == 0x04 && > > + (packet[3] & 0x1c) == 0x10); > > + } > > I'd write this as: > > if (etd->crc_enabled) > sanity_check = ((packet[3] & 0x08) == 0x00); > else if (ver == 7 && etd->samples[1] == 0x2A) > sanity_check = ((packet[3] & 0x1c) == 0x10); > else > sanity_check = ((packet[0] & 0x0c) == 0x04 && > (packet[3] & 0x1c) == 0x10); > > > > > if (!sanity_check) > > return PACKET_UNKNOWN; > > @@ -1116,6 +1127,7 @@ static int elantech_get_resolution_v4(struct psmouse *psmouse, > > * Avatar AVIU-145A2 0x361f00? clickpad > > * Fujitsu LIFEBOOK E544 0x470f00d0, 12, 09 2 hw buttons > > * Fujitsu LIFEBOOK E554 0x570f0140, 14, 0c 2 hw buttons > > + * Fujitsu T725 0x470f0105, 12, 09 2 hw buttons > > * Fujitsu H7300x570f00c0, 14, 0c 3 hw buttons (**) > > * Gigabyte U2442 0x450f0158, 17, 0c 2 hw buttons > > * Lenovo L430 0x350f02b9, 15, 0c 2 hw buttons (*) > > @@ -1651,6 +1663,16 @@ int elantech_init(struct psmouse *psmouse) > > etd->capabilities[0], etd->capabilities[1], > > etd->capabilities[2]); > > > > + if (etd->hw_version != 1) { > > + if (etd->send_cmd(psmouse, ETP_SAMPLE_QUERY, etd->samples)) { > > + psmouse_err(psmouse, "failed to query sample data\n"); > > + goto init_fail; > > + } > > + psmouse_info(psmouse, > > + "Elan sample query result %02x, %02x, %02x\n", > > + etd->samples[0], etd->samples[1], etd->samples[2]); > > + } > > + > > if (elantech_set_absolute_mode(psmouse)) { > > psmouse_err(psmouse, > > "failed to put touchpad into absolute mode.\n"); diff --git > > a/drivers/input/mouse/elantech.h b/drivers/input/mouse/elantech.h > > index f965d15..e1cbf40 100644 > > --- a/drivers/input/mouse/elantech.h > > +++ b/drivers/input/mouse/elantech.h > > @@ -129,6 +129,7 @@ struct elantech_data { > > unsigned char reg_26; > > unsigned char debug; > > unsigned char capabilities[3]; > > + unsigned char samples[3]; > > bool paritycheck; > > bool jumpy_cursor; > > bool reports_pressure; > > -- > > > > Thanks. > > -- > Dmitry > -- > To unsubscribe from this list: send the line "unsubscribe linux-input" > in the body of a message to majord...@vger.kern
[PATCH] Input: Change BTN_TOOL_FINGER flag when hover event trigger
Only ABS_DISTANCE is not enough for upper OS to distingiush hover event be triggered from object from faraway to and close touchpad surface or from object prepare to leave the touchpad surface. Add BTN_TOOL_FINGER flag to help it. object_from_farawayobject_inside_hover_area object_touch_surface BTN_TOUCH 0 0 1 BTN_TOOL_FINGER 0 1 1 ABS_DISTANCE 0 1 0 Signed-off by: Duson Lin --- drivers/hid/hid-magicmouse.c | 2 +- drivers/input/input-mt.c | 7 +-- drivers/input/mouse/elan_i2c_core.c | 15 +-- drivers/input/mouse/elantech.c | 2 +- drivers/input/mouse/focaltech.c | 2 +- drivers/input/mouse/synaptics.c | 2 +- drivers/input/touchscreen/atmel_mxt_ts.c | 2 +- drivers/input/touchscreen/edt-ft5x06.c | 2 +- drivers/input/touchscreen/egalax_ts.c| 2 +- drivers/input/touchscreen/ili210x.c | 2 +- drivers/input/touchscreen/mms114.c | 4 ++-- drivers/input/touchscreen/penmount.c | 2 +- drivers/input/touchscreen/rohm_bu21023.c | 2 +- drivers/input/touchscreen/wacom_w8001.c | 2 +- include/linux/input/mt.h | 3 ++- 15 files changed, 29 insertions(+), 22 deletions(-) diff --git a/drivers/hid/hid-magicmouse.c b/drivers/hid/hid-magicmouse.c index d6fa496..584e98b 100644 --- a/drivers/hid/hid-magicmouse.c +++ b/drivers/hid/hid-magicmouse.c @@ -353,7 +353,7 @@ static int magicmouse_raw_event(struct hid_device *hdev, input_report_rel(input, REL_Y, y); } else { /* USB_DEVICE_ID_APPLE_MAGICTRACKPAD */ input_report_key(input, BTN_MOUSE, clicks & 1); - input_mt_report_pointer_emulation(input, true); + input_mt_report_pointer_emulation(input, true, false); } input_sync(input); diff --git a/drivers/input/input-mt.c b/drivers/input/input-mt.c index 54fce56..30855a5 100644 --- a/drivers/input/input-mt.c +++ b/drivers/input/input-mt.c @@ -184,6 +184,7 @@ EXPORT_SYMBOL(input_mt_report_finger_count); * input_mt_report_pointer_emulation() - common pointer emulation * @dev: input device with allocated MT slots * @use_count: report number of active contacts as finger count + * @hover: report ABS_DISTANCE as hover event * * Performs legacy pointer emulation via BTN_TOUCH, ABS_X, ABS_Y and * ABS_PRESSURE. Touchpad finger count is emulated if use_count is true. @@ -191,7 +192,8 @@ EXPORT_SYMBOL(input_mt_report_finger_count); * The input core ensures only the KEY and ABS axes already setup for * this device will produce output. */ -void input_mt_report_pointer_emulation(struct input_dev *dev, bool use_count) +void input_mt_report_pointer_emulation(struct input_dev *dev, bool use_count, + bool hover) { struct input_mt *mt = dev->mt; struct input_mt_slot *oldest; @@ -220,6 +222,7 @@ void input_mt_report_pointer_emulation(struct input_dev *dev, bool use_count) input_event(dev, EV_KEY, BTN_TOUCH, count > 0); if (use_count) input_mt_report_finger_count(dev, count); + input_event(dev, EV_ABS, ABS_DISTANCE, hover); if (oldest) { int x = input_mt_get_value(oldest, ABS_MT_POSITION_X); @@ -290,7 +293,7 @@ void input_mt_sync_frame(struct input_dev *dev) if ((mt->flags & INPUT_MT_POINTER) && !(mt->flags & INPUT_MT_SEMI_MT)) use_count = true; - input_mt_report_pointer_emulation(dev, use_count); + input_mt_report_pointer_emulation(dev, use_count, false); mt->frame++; } diff --git a/drivers/input/mouse/elan_i2c_core.c b/drivers/input/mouse/elan_i2c_core.c index 2f58985..8b5e75a 100644 --- a/drivers/input/mouse/elan_i2c_core.c +++ b/drivers/input/mouse/elan_i2c_core.c @@ -4,7 +4,7 @@ * Copyright (c) 2013 ELAN Microelectronics Corp. * * Author: 林政維 (Duson Lin) - * Version: 1.6.0 + * Version: 1.6.2 * * Based on cyapa driver: * copyright (c) 2011-2012 Cypress Semiconductor, Inc. @@ -40,7 +40,7 @@ #include "elan_i2c.h" #define DRIVER_NAME"elan_i2c" -#define ELAN_DRIVER_VERSION"1.6.1" +#define ELAN_DRIVER_VERSION"1.6.2" #define ELAN_VENDOR_ID 0x04f3 #define ETP_MAX_PRESSURE 255 #define ETP_FWIDTH_REDUCE 90 @@ -845,7 +845,7 @@ static void elan_report_absolute(struct elan_tp_data *data, u8 *packet) { struct input_dev *input = data->input; u8 *finger_data = &packet[ETP_FINGER_DATA_OFFSET]; - int i; + int i, valid_count = 0; u8 tp_info = packet[ETP_TOUCH_INFO_OFFSET]; u8 hover_info = packet[ETP_HOVER_INFO_OFFSET]; bool contact_valid, hover_event; @@ -855,13 +855,16 @@ static void elan_report_absolute(struct elan_tp_data *data, u8 *packet) contact_valid = tp_info & (1U << (3 + i)); elan_rep
[PATCH] Input: Change BTN_TOOL_FINGER flag when hover event trigger
Only ABS_DISTANCE is not enough for upper OS to distingiush hover event be triggered from object from faraway to and close touchpad surface or from object prepare to leave the touchpad surface. Add BTN_TOOL_FINGER flag to help it. object_from_farawayobject_inside_hover_area object_touch_surface BTN_TOUCH 0 0 1 BTN_TOOL_FINGER 0 1 1 ABS_DISTANCE 0 1 0 Signed-off by: Duson Lin --- drivers/hid/hid-magicmouse.c | 2 +- drivers/input/input-mt.c | 7 +-- drivers/input/mouse/elan_i2c_core.c | 15 +-- drivers/input/mouse/elantech.c | 2 +- drivers/input/mouse/focaltech.c | 2 +- drivers/input/mouse/synaptics.c | 2 +- drivers/input/touchscreen/atmel_mxt_ts.c | 2 +- drivers/input/touchscreen/edt-ft5x06.c | 2 +- drivers/input/touchscreen/egalax_ts.c| 2 +- drivers/input/touchscreen/ili210x.c | 2 +- drivers/input/touchscreen/mms114.c | 4 ++-- drivers/input/touchscreen/penmount.c | 2 +- drivers/input/touchscreen/rohm_bu21023.c | 2 +- drivers/input/touchscreen/wacom_w8001.c | 2 +- include/linux/input/mt.h | 3 ++- 15 files changed, 29 insertions(+), 22 deletions(-) diff --git a/drivers/hid/hid-magicmouse.c b/drivers/hid/hid-magicmouse.c index d6fa496..584e98b 100644 --- a/drivers/hid/hid-magicmouse.c +++ b/drivers/hid/hid-magicmouse.c @@ -353,7 +353,7 @@ static int magicmouse_raw_event(struct hid_device *hdev, input_report_rel(input, REL_Y, y); } else { /* USB_DEVICE_ID_APPLE_MAGICTRACKPAD */ input_report_key(input, BTN_MOUSE, clicks & 1); - input_mt_report_pointer_emulation(input, true); + input_mt_report_pointer_emulation(input, true, false); } input_sync(input); diff --git a/drivers/input/input-mt.c b/drivers/input/input-mt.c index 54fce56..30855a5 100644 --- a/drivers/input/input-mt.c +++ b/drivers/input/input-mt.c @@ -184,6 +184,7 @@ EXPORT_SYMBOL(input_mt_report_finger_count); * input_mt_report_pointer_emulation() - common pointer emulation * @dev: input device with allocated MT slots * @use_count: report number of active contacts as finger count + * @hover: report ABS_DISTANCE as hover event * * Performs legacy pointer emulation via BTN_TOUCH, ABS_X, ABS_Y and * ABS_PRESSURE. Touchpad finger count is emulated if use_count is true. @@ -191,7 +192,8 @@ EXPORT_SYMBOL(input_mt_report_finger_count); * The input core ensures only the KEY and ABS axes already setup for * this device will produce output. */ -void input_mt_report_pointer_emulation(struct input_dev *dev, bool use_count) +void input_mt_report_pointer_emulation(struct input_dev *dev, bool use_count, + bool hover) { struct input_mt *mt = dev->mt; struct input_mt_slot *oldest; @@ -220,6 +222,7 @@ void input_mt_report_pointer_emulation(struct input_dev *dev, bool use_count) input_event(dev, EV_KEY, BTN_TOUCH, count > 0); if (use_count) input_mt_report_finger_count(dev, count); + input_event(dev, EV_ABS, ABS_DISTANCE, hover); if (oldest) { int x = input_mt_get_value(oldest, ABS_MT_POSITION_X); @@ -290,7 +293,7 @@ void input_mt_sync_frame(struct input_dev *dev) if ((mt->flags & INPUT_MT_POINTER) && !(mt->flags & INPUT_MT_SEMI_MT)) use_count = true; - input_mt_report_pointer_emulation(dev, use_count); + input_mt_report_pointer_emulation(dev, use_count, false); mt->frame++; } diff --git a/drivers/input/mouse/elan_i2c_core.c b/drivers/input/mouse/elan_i2c_core.c index 2f58985..8b5e75a 100644 --- a/drivers/input/mouse/elan_i2c_core.c +++ b/drivers/input/mouse/elan_i2c_core.c @@ -4,7 +4,7 @@ * Copyright (c) 2013 ELAN Microelectronics Corp. * * Author: 林政維 (Duson Lin) - * Version: 1.6.0 + * Version: 1.6.2 * * Based on cyapa driver: * copyright (c) 2011-2012 Cypress Semiconductor, Inc. @@ -40,7 +40,7 @@ #include "elan_i2c.h" #define DRIVER_NAME"elan_i2c" -#define ELAN_DRIVER_VERSION"1.6.1" +#define ELAN_DRIVER_VERSION"1.6.2" #define ELAN_VENDOR_ID 0x04f3 #define ETP_MAX_PRESSURE 255 #define ETP_FWIDTH_REDUCE 90 @@ -845,7 +845,7 @@ static void elan_report_absolute(struct elan_tp_data *data, u8 *packet) { struct input_dev *input = data->input; u8 *finger_data = &packet[ETP_FINGER_DATA_OFFSET]; - int i; + int i, valid_count = 0; u8 tp_info = packet[ETP_TOUCH_INFO_OFFSET]; u8 hover_info = packet[ETP_HOVER_INFO_OFFSET]; bool contact_valid, hover_event; @@ -855,13 +855,16 @@ static void elan_report_absolute(struct elan_tp_data *data, u8 *packet) contact_valid = tp_info & (1U << (3 + i)); elan_rep
[PATCH] Input: Change BTN_TOOL_FINGER falg when HOVER event trigger
Only ABS_DISTANCE is not enough for upper OS to distiguish hover event be triggered from object form faraway to and close touchpad surface or from object prepare to leave the touchpad surface. We add BNT_TOOL_FINGER to help it. Object_at_faraway object_at_hover_area object_touch_touchpad BTN_TOUCH 0 01 BTN_TOOL_FINGER 0 11 ABS_DISTANCE 0 10 Signed-off by: Duson Lin --- drivers/input/mouse/elan_i2c_core.c | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/input/mouse/elan_i2c_core.c b/drivers/input/mouse/elan_i2c_core.c index 2f58985..9392a8c 100644 --- a/drivers/input/mouse/elan_i2c_core.c +++ b/drivers/input/mouse/elan_i2c_core.c @@ -4,7 +4,7 @@ * Copyright (c) 2013 ELAN Microelectronics Corp. * * Author: 林政維 (Duson Lin) - * Version: 1.6.0 + * Version: 1.6.1 * * Based on cyapa driver: * copyright (c) 2011-2012 Cypress Semiconductor, Inc. @@ -845,23 +845,27 @@ static void elan_report_absolute(struct elan_tp_data *data, u8 *packet) { struct input_dev *input = data->input; u8 *finger_data = &packet[ETP_FINGER_DATA_OFFSET]; - int i; + int i, valid_count = 0; u8 tp_info = packet[ETP_TOUCH_INFO_OFFSET]; u8 hover_info = packet[ETP_HOVER_INFO_OFFSET]; bool contact_valid, hover_event; - hover_event = hover_info & 0x40; + hover_event = (hover_info & 0x40); for (i = 0; i < ETP_MAX_FINGERS; i++) { contact_valid = tp_info & (1U << (3 + i)); elan_report_contact(data, i, contact_valid, finger_data); - if (contact_valid) + if (contact_valid) { finger_data += ETP_FINGER_DATA_LEN; + valid_count++; + } } input_report_key(input, BTN_LEFT, tp_info & 0x01); + input_report_key(input, BTN_TOOL_FINGER, + ((hover_event != 0) | (valid_count > 0))); input_report_abs(input, ABS_DISTANCE, hover_event != 0); - input_mt_report_pointer_emulation(input, true); + input_mt_report_pointer_emulation(input, false); input_sync(input); } -- 1.7.9.5
RE: [PATCH] Input: Change BTN_TOOL_FINGER falg when HOVER event trigger
Hello Dmitry, Please check my response below, thanks. -Original Message- From: 'Dmitry Torokhov' [mailto:dmitry.torok...@gmail.com] Sent: Wednesday, March 30, 2016 10:31 AM To: DusonLin Cc: Linux-kernel@vger.kernel.org; linux-in...@vger.kernel.org; 'Charles Mooney'; 'jeff'; 'Phoenix' Subject: Re: [PATCH] Input: Change BTN_TOOL_FINGER falg when HOVER event trigger Hi Duson, On Wed, Mar 30, 2016 at 10:02:02AM +0800, DusonLin wrote: > Only ABS_DISTANCE is not enough for upper OS to distiguish hover > event be triggered from object form faraway to and close touchpad > surface or from object prepare to leave the touchpad surface. We add > BNT_TOOL_FINGER to help it. > > Object_at_faraway object_at_hover_area > object_touch_touchpad > BTN_TOUCH 0 01 > BTN_TOOL_FINGER 0 11 >ABS_DISTANCE 0 10 > > Signed-off by: Duson Lin > --- > drivers/input/mouse/elan_i2c_core.c | 14 +- > 1 file changed, 9 insertions(+), 5 deletions(-) > > diff --git a/drivers/input/mouse/elan_i2c_core.c > b/drivers/input/mouse/elan_i2c_core.c > index 2f58985..9392a8c 100644 > --- a/drivers/input/mouse/elan_i2c_core.c > +++ b/drivers/input/mouse/elan_i2c_core.c > @@ -4,7 +4,7 @@ > * Copyright (c) 2013 ELAN Microelectronics Corp. > * > * Author: 林政維 (Duson Lin) > - * Version: 1.6.0 > + * Version: 1.6.1 > * > * Based on cyapa driver: > * copyright (c) 2011-2012 Cypress Semiconductor, Inc. > @@ -845,23 +845,27 @@ static void elan_report_absolute(struct > elan_tp_data *data, u8 *packet) { > struct input_dev *input = data->input; > u8 *finger_data = &packet[ETP_FINGER_DATA_OFFSET]; > - int i; > + int i, valid_count = 0; This appears all whitespace-damaged. [duson] will do. > u8 tp_info = packet[ETP_TOUCH_INFO_OFFSET]; > u8 hover_info = packet[ETP_HOVER_INFO_OFFSET]; > bool contact_valid, hover_event; > > - hover_event = hover_info & 0x40; > + hover_event = (hover_info & 0x40); We do not need parentheses here. [duson] will do. > for (i = 0; i < ETP_MAX_FINGERS; i++) { > contact_valid = tp_info & (1U << (3 + i)); > elan_report_contact(data, i, contact_valid, > finger_data); > > - if (contact_valid) > + if (contact_valid) { > finger_data += ETP_FINGER_DATA_LEN; > + valid_count++; > + } > } > >input_report_key(input, BTN_LEFT, tp_info & 0x01); > + input_report_key(input, BTN_TOOL_FINGER, > + ((hover_event != 0) | (valid_count > 0))); You do not want to use "bitwise or" here. > input_report_abs(input, ABS_DISTANCE, hover_event != 0); > - input_mt_report_pointer_emulation(input, true); > + input_mt_report_pointer_emulation(input, false); I wonder if we should teach input_mt_report_pointer_emulation() to handle hover properly. [duson] But, it looks like the hover is not standard function and not all of touchpad support this function, Even though, we still teach inpu_mt_report_pointer_emulation() to handle this function? Thanks. -- Dmitry
RE: [PATCH 2/2] Input - elantech: Add special check for fw_version 0x470f01 touchpad
Hi, Sorry for later reply, I am not sure version 1 is ok or not, so, I think I should modify my patch and let ETP_SAMPLE_QUERY only work for version 2,3,4. And for your question, yes, I think you can use "etd->samples" at elantech_set_range for version 2, even though the definition of these three bytes maybe different between version 2 and 3. Thank you, Duson -Original Message- From: ulrik.debie...@e2big.org [mailto:ulrik.debie...@e2big.org] Sent: Wednesday, July 29, 2015 3:19 AM To: duson Cc: linux-in...@vger.kernel.org; linux-kernel@vger.kernel.org; Dmitry Torokhov Subject: Re: [PATCH 2/2] Input - elantech: Add special check for fw_version 0x470f01 touchpad Hi Duson, Thanks for your update. Your latest patch has 2 trailing whitespaces problems as shown by checkpatch.pl. There was another comment you probably overlooked in my previous mail: > + if (etd->send_cmd(psmouse, ETP_SAMPLE_QUERY, > + etd->samples)) { Is this wise to run on all elantech hardware ? No regression ? Currently it is called when hw_version = 2 and some other conditions in the function elantech_set_range. That could be a hint that the range hw_version 2->7 is probably ok, but what about hw_version 1 ? Is it normal that the semantics of ETP_SAMPLE_QUERY on hw_version 2 is totally different from the fw_version 0x470f01 ? Assuming there are no regressions introduced by ETP_SAMPLE_QUERY, I would change elantech_set_range to use the stored sample values instead of querying for it again. That probably can be put in a separate patch. Thanks, Kind Regards, Ulrik On Thu, Jul 23, 2015 at 08:54:32AM +0800, duson wrote: > > It is no need to check the packet[0] for sanity check when doing > elantech_packet_check_v4() function for fw_version = 0x470f01 touchpad. > > Signed-off by: Duson Lin > --- > drivers/input/mouse/elantech.c | 26 +++--- > drivers/input/mouse/elantech.h |1 + > 2 files changed, 24 insertions(+), 3 deletions(-) > > diff --git a/drivers/input/mouse/elantech.c > b/drivers/input/mouse/elantech.c index ce3d400..6c6c2bb 100644 > --- a/drivers/input/mouse/elantech.c > +++ b/drivers/input/mouse/elantech.c > @@ -784,6 +784,8 @@ static int elantech_packet_check_v4(struct psmouse *psmouse) > unsigned char *packet = psmouse->packet; > unsigned char packet_type = packet[3] & 0x03; > bool sanity_check; > + /* This represents the version of IC body. */ > + int ver = (etd->fw_version & 0x0f) >> 16; > > if (etd->tp_dev && (packet[3] & 0x0f) == 0x06) > return PACKET_TRACKPOINT; > @@ -796,9 +798,17 @@ static int elantech_packet_check_v4(struct psmouse *psmouse) >*/ > if (etd->crc_enabled) > sanity_check = ((packet[3] & 0x08) == 0x00); > - else > - sanity_check = ((packet[0] & 0x0c) == 0x04 && > - (packet[3] & 0x1c) == 0x10); > + else { > + /* > + * The sanity check only need to check packet[3] > + * when IC_body = 7 and PID = 0x2A > + */ > + if (ver == 7 && etd->samples[1] == 0x2A) > + sanity_check = ((packet[3] & 0x1c) == 0x10); > + else > + sanity_check = ((packet[0] & 0x0c) == 0x04 && > + (packet[3] & 0x1c) == 0x10); > + } > > if (!sanity_check) > return PACKET_UNKNOWN; > @@ -1117,6 +1127,7 @@ static int elantech_get_resolution_v4(struct psmouse *psmouse, > * Fujitsu LIFEBOOK E544 0x470f00d0, 12, 09 2 hw buttons > * Fujitsu LIFEBOOK E554 0x570f0140, 14, 0c 2 hw buttons > * Fujitsu H7300x570f00c0, 14, 0c 3 hw buttons (**) > + * Fujitsu T725 0x470f0105, 12, 09 2 hw buttons > * Gigabyte U2442 0x450f0158, 17, 0c 2 hw buttons > * Lenovo L430 0x350f02b9, 15, 0c 2 hw buttons (*) > * Lenovo L530 0x350f02b9, 15, 0c 2 hw buttons (*) > @@ -1648,6 +1659,15 @@ int elantech_init(struct psmouse *psmouse) >etd->capabilities[0], etd->capabilities[1], >etd->capabilities[2]); > > + if (etd->send_cmd(psmouse, ETP_SAMPLE_QUERY, > + etd->samples)) { > + psmouse_err(psmouse, "failed to query sample data.\n"); > + goto init_fail; > + } > + psmouse_info(psmouse, > + "Elan sample query result 0x%02x, 0x%02x, 0x%02x.\n", > + etd->samples[0], etd->samples[1], etd->samples[2]); > + > if (elantech_set_absolute_mode(psmouse)) { > psmouse_err(psmouse, > "failed to put touchpad into absolute mode.\n"); diff --git > a/drivers/input/mouse/elantech.h b/drivers/input/mouse/elantech.h > index f965d15..e1cbf40 100644 > --- a/drivers/input/mouse/elantech.h > +++ b/drivers/input/mouse/el
RE: [PATCH] Input: elan_i2c - enable ELAN0100 acpi panels
Hi Michele, The vaildpage_count for type 0x08 should be 512, not 768. Thanks Duson -Original Message- From: Michele Curti [mailto:michele.cu...@gmail.com] Sent: Saturday, August 22, 2015 2:59 PM To: ji...@kernel.org; dmitry.torok...@gmail.com; duson...@emc.com.tw Cc: ble...@chromium.org; k.kozlow...@samsung.com; charliemoo...@chromium.org; benjamin.tissoi...@redhat.com; linux-in...@vger.kernel.org; linux-kernel@vger.kernel.org; Michele Curti Subject: [PATCH] Input: elan_i2c - enable ELAN0100 acpi panels Enable ELAN0100 touchpad driver, found on a Asus X205TA laptop, to gain 2,3 fingers tap and 2 fingers scroll. Signed-off-by: Michele Curti --- drivers/hid/hid-core.c | 1 + drivers/input/mouse/elan_i2c_core.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 22afab9..70a11ac 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -2294,6 +2294,7 @@ static const struct hid_device_id hid_ignore_list[] = { { HID_USB_DEVICE(USB_VENDOR_ID_DREAM_CHEEKY, 0x0004) }, { HID_USB_DEVICE(USB_VENDOR_ID_DREAM_CHEEKY, 0x000a) }, { HID_I2C_DEVICE(USB_VENDOR_ID_ELAN, 0x0400) }, + { HID_I2C_DEVICE(USB_VENDOR_ID_ELAN, 0x0401) }, { HID_USB_DEVICE(USB_VENDOR_ID_ESSENTIAL_REALITY, USB_DEVICE_ID_ESSENTIAL_REALITY_P5) }, { HID_USB_DEVICE(USB_VENDOR_ID_ETT, USB_DEVICE_ID_TC5UH) }, { HID_USB_DEVICE(USB_VENDOR_ID_ETT, USB_DEVICE_ID_TC4UM) }, diff --git a/drivers/input/mouse/elan_i2c_core.c b/drivers/input/mouse/elan_i2c_core.c index 67388f4..3f1eef0 100644 --- a/drivers/input/mouse/elan_i2c_core.c +++ b/drivers/input/mouse/elan_i2c_core.c @@ -98,6 +98,7 @@ static int elan_get_fwinfo(u8 ic_type, u16 *vaildpage_count, u16 *signature_address) { switch(ic_type) { + case 0x08: case 0x09: *vaildpage_count = 768; break; @@ -1165,6 +1166,7 @@ MODULE_DEVICE_TABLE(i2c, elan_id); #ifdef CONFIG_ACPI static const struct acpi_device_id elan_acpi_id[] = { { "ELAN", 0 }, + { "ELAN0100", 0 }, { "ELAN0600", 0 }, { } }; -- 2.5.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/