diff mbox

Input: elan_i2c - enable ELAN0600 acpi panels

Message ID 1427837698-419-1-git-send-email-benjamin.tissoires@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Benjamin Tissoires March 31, 2015, 9:34 p.m. UTC
ELAN0600 seems to work just fine in mouse emulation mode through i2c-hid,
but to have full raw touch support we need to register it in elan_i2c.ko

Found on a Lenovo Yoga 3 11".

Reported-and-tested-by: Alessio Treglia <alessio@debian.org>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
---

Hi,

Alessio reported this touchpad on the Lenovo Yoga 3. I must say that I am
rather surprised that we need a cross tree support to enable this panel
and I would expect that the driver would be in the HID subtree, not a direct
input device.

I understand the driver needs to access to the raw I2C commands, but still,
we could have worked around in the HID tree directly.
Not to mention that the DT binding would have required only i2c-hid, not a
custom vendor.

Anyway, Jiri, Dmitry, who wants to take this one?

Cheers,
Benjamin

 drivers/hid/hid-core.c              | 1 +
 drivers/input/mouse/elan_i2c_core.c | 1 +
 2 files changed, 2 insertions(+)

Comments

Dmitry Torokhov April 3, 2015, 9:05 p.m. UTC | #1
On Tue, Mar 31, 2015 at 05:34:58PM -0400, Benjamin Tissoires wrote:
> ELAN0600 seems to work just fine in mouse emulation mode through i2c-hid,
> but to have full raw touch support we need to register it in elan_i2c.ko
> 
> Found on a Lenovo Yoga 3 11".
> 
> Reported-and-tested-by: Alessio Treglia <alessio@debian.org>
> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
> ---
> 
> Hi,
> 
> Alessio reported this touchpad on the Lenovo Yoga 3. I must say that I am
> rather surprised that we need a cross tree support to enable this panel
> and I would expect that the driver would be in the HID subtree, not a direct
> input device.
> 
> I understand the driver needs to access to the raw I2C commands, but still,
> we could have worked around in the HID tree directly.
> Not to mention that the DT binding would have required only i2c-hid, not a
> custom vendor.
> 
> Anyway, Jiri, Dmitry, who wants to take this one?

Hmm, so elan_i2c.ko (and elants_i2c) is intended to be used with devices
that are not compatible with HID protocol, as far as I know. I guess
there are firmwares that can do both, but then we should default to HID.

Duson, any comments?

Thanks!

> 
> Cheers,
> Benjamin
> 
>  drivers/hid/hid-core.c              | 1 +
>  drivers/input/mouse/elan_i2c_core.c | 1 +
>  2 files changed, 2 insertions(+)
> 
> diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
> index 722a925..33a22f4 100644
> --- a/drivers/hid/hid-core.c
> +++ b/drivers/hid/hid-core.c
> @@ -2259,6 +2259,7 @@ static const struct hid_device_id hid_ignore_list[] = {
>  	{ HID_USB_DEVICE(USB_VENDOR_ID_DELORME, USB_DEVICE_ID_DELORME_EM_LT20) },
>  	{ 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_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 375d98f..ced9a9c 100644
> --- a/drivers/input/mouse/elan_i2c_core.c
> +++ b/drivers/input/mouse/elan_i2c_core.c
> @@ -1110,6 +1110,7 @@ MODULE_DEVICE_TABLE(i2c, elan_id);
>  #ifdef CONFIG_ACPI
>  static const struct acpi_device_id elan_acpi_id[] = {
>  	{ "ELAN0000", 0 },
> +	{ "ELAN0600", 0 },
>  	{ }
>  };
>  MODULE_DEVICE_TABLE(acpi, elan_acpi_id);
> -- 
> 2.3.4
>
Duson Lin April 9, 2015, 11:02 a.m. UTC | #2
Hi Dmitry,

Sorry later for reply. If touchpad is designed for Window OS, 
the firmware will support standard HID mouse format (non-driver) and elan raw data format (with driver).

So, if user change OS from Window to Linux, touchpad will work fine under HID format.

----------------------------------------------
Thanks,
ELAN Duson
? Email: dusonlin@emc.com.tw
----------------------------------------------





> Dmitry Torokhov <dmitry.torokhov@gmail.com> ? 2015?4?4? ??5:05 ???
> 
> On Tue, Mar 31, 2015 at 05:34:58PM -0400, Benjamin Tissoires wrote:
>> ELAN0600 seems to work just fine in mouse emulation mode through i2c-hid,
>> but to have full raw touch support we need to register it in elan_i2c.ko
>> 
>> Found on a Lenovo Yoga 3 11".
>> 
>> Reported-and-tested-by: Alessio Treglia <alessio@debian.org>
>> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
>> ---
>> 
>> Hi,
>> 
>> Alessio reported this touchpad on the Lenovo Yoga 3. I must say that I am
>> rather surprised that we need a cross tree support to enable this panel
>> and I would expect that the driver would be in the HID subtree, not a direct
>> input device.
>> 
>> I understand the driver needs to access to the raw I2C commands, but still,
>> we could have worked around in the HID tree directly.
>> Not to mention that the DT binding would have required only i2c-hid, not a
>> custom vendor.
>> 
>> Anyway, Jiri, Dmitry, who wants to take this one?
> 
> Hmm, so elan_i2c.ko (and elants_i2c) is intended to be used with devices
> that are not compatible with HID protocol, as far as I know. I guess
> there are firmwares that can do both, but then we should default to HID.
> 
> Duson, any comments?
> 
> Thanks!
> 
>> 
>> Cheers,
>> Benjamin
>> 
>> drivers/hid/hid-core.c              | 1 +
>> drivers/input/mouse/elan_i2c_core.c | 1 +
>> 2 files changed, 2 insertions(+)
>> 
>> diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
>> index 722a925..33a22f4 100644
>> --- a/drivers/hid/hid-core.c
>> +++ b/drivers/hid/hid-core.c
>> @@ -2259,6 +2259,7 @@ static const struct hid_device_id hid_ignore_list[] = {
>> 	{ HID_USB_DEVICE(USB_VENDOR_ID_DELORME, USB_DEVICE_ID_DELORME_EM_LT20) },
>> 	{ 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_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 375d98f..ced9a9c 100644
>> --- a/drivers/input/mouse/elan_i2c_core.c
>> +++ b/drivers/input/mouse/elan_i2c_core.c
>> @@ -1110,6 +1110,7 @@ MODULE_DEVICE_TABLE(i2c, elan_id);
>> #ifdef CONFIG_ACPI
>> static const struct acpi_device_id elan_acpi_id[] = {
>> 	{ "ELAN0000", 0 },
>> +	{ "ELAN0600", 0 },
>> 	{ }
>> };
>> MODULE_DEVICE_TABLE(acpi, elan_acpi_id);
>> -- 
>> 2.3.4
>> 
> 
> -- 
> Dmitry
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Benjamin Tissoires June 11, 2015, 8:19 p.m. UTC | #3
On Apr 09 2015 or thereabouts, duson wrote:
> Hi Dmitry,
> 
> Sorry later for reply. If touchpad is designed for Window OS, 
> the firmware will support standard HID mouse format (non-driver) and elan raw data format (with driver).
> 
> So, if user change OS from Window to Linux, touchpad will work fine under HID format.
> 

Well, Jurgen reported a ELAN0100 (04F3:0401) which is similar but does
not work with the below patch (when adapted to match his PID).
And like under Windows, the HID mouse report format is just not enough under
Linux. We need to have access to the raw touches to be able to provide a
consistent experience. So we need to get his device access to the
proprietary raw format.

I think what makes Jurgen's device unhappy is that the length of the
report 0x5d is 27 instead of 31 (according to the report descriptors).
But elan_i2c_i2c.c checks for the length of the report and fails (only
suppositions).

I would be happy to help here, but it looks like it is going to be
difficult to remotely debug this and switch the whole driver into HID,
especially given that elan_i2c_i2c uses a non-HID command to set the
touchpad in the absolute mode.

So basically, I don't know what to do for Jurgen, but we could still
enable Alessio's touchpad (the ELAN0600, below). Jiri, Dmitry?

Cheers,
Benjamin

> 
> 
> > Dmitry Torokhov <dmitry.torokhov@gmail.com> ? 2015?4?4? ??5:05 ???
> > 
> > On Tue, Mar 31, 2015 at 05:34:58PM -0400, Benjamin Tissoires wrote:
> >> ELAN0600 seems to work just fine in mouse emulation mode through i2c-hid,
> >> but to have full raw touch support we need to register it in elan_i2c.ko
> >> 
> >> Found on a Lenovo Yoga 3 11".
> >> 
> >> Reported-and-tested-by: Alessio Treglia <alessio@debian.org>
> >> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
> >> ---
> >> 
> >> Hi,
> >> 
> >> Alessio reported this touchpad on the Lenovo Yoga 3. I must say that I am
> >> rather surprised that we need a cross tree support to enable this panel
> >> and I would expect that the driver would be in the HID subtree, not a direct
> >> input device.
> >> 
> >> I understand the driver needs to access to the raw I2C commands, but still,
> >> we could have worked around in the HID tree directly.
> >> Not to mention that the DT binding would have required only i2c-hid, not a
> >> custom vendor.
> >> 
> >> Anyway, Jiri, Dmitry, who wants to take this one?
> > 
> > Hmm, so elan_i2c.ko (and elants_i2c) is intended to be used with devices
> > that are not compatible with HID protocol, as far as I know. I guess
> > there are firmwares that can do both, but then we should default to HID.
> > 
> > Duson, any comments?
> > 
> > Thanks!
> > 
> >> 
> >> Cheers,
> >> Benjamin
> >> 
> >> drivers/hid/hid-core.c              | 1 +
> >> drivers/input/mouse/elan_i2c_core.c | 1 +
> >> 2 files changed, 2 insertions(+)
> >> 
> >> diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
> >> index 722a925..33a22f4 100644
> >> --- a/drivers/hid/hid-core.c
> >> +++ b/drivers/hid/hid-core.c
> >> @@ -2259,6 +2259,7 @@ static const struct hid_device_id hid_ignore_list[] = {
> >> 	{ HID_USB_DEVICE(USB_VENDOR_ID_DELORME, USB_DEVICE_ID_DELORME_EM_LT20) },
> >> 	{ 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_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 375d98f..ced9a9c 100644
> >> --- a/drivers/input/mouse/elan_i2c_core.c
> >> +++ b/drivers/input/mouse/elan_i2c_core.c
> >> @@ -1110,6 +1110,7 @@ MODULE_DEVICE_TABLE(i2c, elan_id);
> >> #ifdef CONFIG_ACPI
> >> static const struct acpi_device_id elan_acpi_id[] = {
> >> 	{ "ELAN0000", 0 },
> >> +	{ "ELAN0600", 0 },
> >> 	{ }
> >> };
> >> MODULE_DEVICE_TABLE(acpi, elan_acpi_id);
> >> -- 
> >> 2.3.4
> >> 
> > 
> > -- 
> > Dmitry
> > 
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Dmitry Torokhov June 22, 2015, 9:37 p.m. UTC | #4
On Thu, Jun 11, 2015 at 04:19:48PM -0400, Benjamin Tissoires wrote:
> On Apr 09 2015 or thereabouts, duson wrote:
> > Hi Dmitry,
> > 
> > Sorry later for reply. If touchpad is designed for Window OS, 
> > the firmware will support standard HID mouse format (non-driver) and elan raw data format (with driver).
> > 
> > So, if user change OS from Window to Linux, touchpad will work fine under HID format.
> > 
> 
> Well, Jurgen reported a ELAN0100 (04F3:0401) which is similar but does
> not work with the below patch (when adapted to match his PID).
> And like under Windows, the HID mouse report format is just not enough under
> Linux. We need to have access to the raw touches to be able to provide a
> consistent experience. So we need to get his device access to the
> proprietary raw format.
> 
> I think what makes Jurgen's device unhappy is that the length of the
> report 0x5d is 27 instead of 31 (according to the report descriptors).
> But elan_i2c_i2c.c checks for the length of the report and fails (only
> suppositions).
> 
> I would be happy to help here, but it looks like it is going to be
> difficult to remotely debug this and switch the whole driver into HID,
> especially given that elan_i2c_i2c uses a non-HID command to set the
> touchpad in the absolute mode.
> 
> So basically, I don't know what to do for Jurgen, but we could still
> enable Alessio's touchpad (the ELAN0600, below). Jiri, Dmitry?

Yes, if the controller indeed has basic HID mode + advanced proprietary
protocol we should blacklist it in HID and let elan driver handle the
device. Devices that speak proper HID (both basic and multitouch) should
be handled by HID.

Thanks.
diff mbox

Patch

diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index 722a925..33a22f4 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -2259,6 +2259,7 @@  static const struct hid_device_id hid_ignore_list[] = {
 	{ HID_USB_DEVICE(USB_VENDOR_ID_DELORME, USB_DEVICE_ID_DELORME_EM_LT20) },
 	{ 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_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 375d98f..ced9a9c 100644
--- a/drivers/input/mouse/elan_i2c_core.c
+++ b/drivers/input/mouse/elan_i2c_core.c
@@ -1110,6 +1110,7 @@  MODULE_DEVICE_TABLE(i2c, elan_id);
 #ifdef CONFIG_ACPI
 static const struct acpi_device_id elan_acpi_id[] = {
 	{ "ELAN0000", 0 },
+	{ "ELAN0600", 0 },
 	{ }
 };
 MODULE_DEVICE_TABLE(acpi, elan_acpi_id);