Linux Input/HID development
 help / color / mirror / Atom feed
From: Marc Dietrich <marvin24@gmx.de>
To: JJ Ding <jj_ding@emc.com.tw>
Cc: linux-input@vger.kernel.org,
	"Dmitry Torokhov" <dmitry.torokhov@gmail.com>,
	"Éric Piel" <E.A.B.Piel@tudelft.nl>,
	"Tom Lin" <tom_lin@emc.com.tw>,
	"Aaron Huang" <aaron_huang@emc.com.tw>
Subject: Re: Re: elantech touchpad problem (long)
Date: Mon, 07 Nov 2011 14:03:01 +0100	[thread overview]
Message-ID: <9720202.rmyIglRAGy@fb07-iapwap2> (raw)
In-Reply-To: <87fwi0fppd.fsf@emc.com.tw>

Hi Jj,

Am Montag, 7. November 2011, 13:48:14 schrieb JJ Ding:
> On Sat, 05 Nov 2011 22:57:38 +0100, Marc Dietrich <marvin24@gmx.de> wrote:
> > Hi,
> > 
> > my small arm netbook contains a elantech touchpad. It is connected via a
> > keyboard controller which communicates over a i2c bus with the host cpu. The
> > keyboard controller/host cpu communication is handled by a special driver (see
> > drivers/staging/nvec_ps2.c). Up to commmit 28f49616 (Input: elantech - add v3
> > hardware support) the touchpad was recognized as a Logitech mouse and it
> > worked fine this way.
> > 
> > Since commit 28f49616, the touchpad is detected as an elantech device (I
> > checked the hw and it is really one). The detected HW version is 2 and the
> > firmware version 0x150500). Unfortunately, the device still streams 3 byte
> > packets which are of course not handled by the elantech driver.
> 
> I thought we never shipped 0x150500, but obviously I was wrong.
> 
> In current version of Elantech driver, the hw_version detection is done
> in elantech_set_properties(), and it's done this way:
> 
> 	int ver = (etd->fw_version & 0x0f0000) >> 16;
> 
> 	if (etd->fw_version < 0x020030 || etd->fw_version == 0x020600)
> 		etd->hw_version = 1;
> 	else if (etd->fw_version < 0x150600)
> 		etd->hw_version = 2;
> 	else if (ver == 5)
> 		etd->hw_version = 3;
> 	else if (ver == 6)
> 		etd->hw_version = 4;
> 	else
> 		return -1;
> 
> This "ver" integer really means the version of the IC body, and the
> magic number 0x150600 is from an old version of our internal driver
> maintained by Tom Lin <tom_lin@emc.com.tw> (also CCed). Your touchpad
> seems to be a v3 hardware, but due to the fw_version(0x150500) less then
> the magic number, it's treated as a v2 by driver.
> 
> For now, could you please try the below patch? I think I will have to do
> some history homework and ask our senior firmware guys to come up with
> a correct patch.

you are right, patch makes the touchpad working. Somehow I only tested hardcoded v1 
and forgot to test v3. I hope this can still be included in 3.2.

Thanks for help!

Marc

> >From 660a96f7a6d7591054b0ef13aa02c41084b1d7f0 Mon Sep 17 00:00:00 2001
> 
> From: JJ Ding <jj_ding@emc.com.tw>
> Date: Mon, 7 Nov 2011 12:57:50 +0800
> Subject: [PATCH] Input: elantech: adjust hw_version detection logic
> 
> Signed-off-by: JJ Ding <jj_ding@emc.com.tw>
> ---
>  drivers/input/mouse/elantech.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
> index 09b93b1..fa64c3e 100644
> --- a/drivers/input/mouse/elantech.c
> +++ b/drivers/input/mouse/elantech.c
> @@ -1214,7 +1214,7 @@ static int elantech_set_properties(struct elantech_data *etd)
> 
>  	if (etd->fw_version < 0x020030 || etd->fw_version == 0x020600)
>  		etd->hw_version = 1;
> -	else if (etd->fw_version < 0x150600)
> +	else if (etd->fw_version < 0x150000)
>  		etd->hw_version = 2;
>  	else if (ver == 5)
>  		etd->hw_version = 3;
> 
> ...



      reply	other threads:[~2011-11-07 13:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-05 21:57 elantech touchpad problem (long) Marc Dietrich
2011-11-07  5:48 ` JJ Ding
2011-11-07 13:03   ` Marc Dietrich [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9720202.rmyIglRAGy@fb07-iapwap2 \
    --to=marvin24@gmx.de \
    --cc=E.A.B.Piel@tudelft.nl \
    --cc=aaron_huang@emc.com.tw \
    --cc=dmitry.torokhov@gmail.com \
    --cc=jj_ding@emc.com.tw \
    --cc=linux-input@vger.kernel.org \
    --cc=tom_lin@emc.com.tw \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox