linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Input: elantech: adjust hw_version detection logic
@ 2011-11-08 12:08 JJ Ding
  2011-11-08 17:55 ` Marc Dietrich
  0 siblings, 1 reply; 4+ messages in thread
From: JJ Ding @ 2011-11-08 12:08 UTC (permalink / raw)
  To: Marc Dietrich, Dmitry Torokhov, Éric Piel; +Cc: linux-input, JJ Ding

This patch fixes some v3 hardware (fw_version: 0x150500) wrongly detected
as v2 hardware.

Reported-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: JJ Ding <jj_ding@emc.com.tw>
---
Hi list,

This is patched against v3.2-rc1.

Marc, could you please test this again? Thanks a lot.

br,
jj

 drivers/input/mouse/elantech.c |   26 ++++++++++++++++++--------
 1 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
index 09b93b1..e2a9867 100644
--- a/drivers/input/mouse/elantech.c
+++ b/drivers/input/mouse/elantech.c
@@ -1210,18 +1210,28 @@ static int elantech_reconnect(struct psmouse *psmouse)
  */
 static int elantech_set_properties(struct elantech_data *etd)
 {
+	/* This represents the version of IC body. */
 	int ver = (etd->fw_version & 0x0f0000) >> 16;
 
+	/* Early version of Elan touchpads doesn't obey the rule. */
 	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;
+	else {
+		switch (ver) {
+		case 2:
+		case 4:
+			etd->hw_version = 2;
+			break;
+		case 5:
+			etd->hw_version = 3;
+			break;
+		case 6:
+			etd->hw_version = 4;
+			break;
+		default:
+			return -1;
+		}
+	}
 
 	/*
 	 * Turn on packet checking by default.
-- 
1.7.8.rc1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] Input: elantech: adjust hw_version detection logic
  2011-11-08 12:08 [PATCH] Input: elantech: adjust hw_version detection logic JJ Ding
@ 2011-11-08 17:55 ` Marc Dietrich
  2011-11-09  1:55   ` JJ Ding
  2011-11-09  5:28   ` Éric Piel
  0 siblings, 2 replies; 4+ messages in thread
From: Marc Dietrich @ 2011-11-08 17:55 UTC (permalink / raw)
  To: JJ Ding; +Cc: Dmitry Torokhov, Éric Piel, linux-input

hi Jj,

On Tuesday 08 November 2011 20:08:19 JJ Ding wrote:
> This patch fixes some v3 hardware (fw_version: 0x150500) wrongly detected
> as v2 hardware.
> 
> Reported-by: Marc Dietrich <marvin24@gmx.de>
> Signed-off-by: JJ Ding <jj_ding@emc.com.tw>
> ---
> Hi list,
> 
> This is patched against v3.2-rc1.
> 
> Marc, could you please test this again? Thanks a lot.

patch works fine here. You may add:

	Tested-By: Marc Dietrich <marvin24@gmx.de>

Btw, are there any known issues with suspend/resume? The touchpad doesn't seem 
to wakeup again after resume, but that's propably a problem of our kbd 
controller driver. Just in case there's something known...

Thanks Marc

> 
>  drivers/input/mouse/elantech.c |   26 ++++++++++++++++++--------
>  1 files changed, 18 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
> index 09b93b1..e2a9867 100644
> --- a/drivers/input/mouse/elantech.c
> +++ b/drivers/input/mouse/elantech.c
> @@ -1210,18 +1210,28 @@ static int elantech_reconnect(struct psmouse
> *psmouse) */
>  static int elantech_set_properties(struct elantech_data *etd)
>  {
> +	/* This represents the version of IC body. */
>  	int ver = (etd->fw_version & 0x0f0000) >> 16;
> 
> +	/* Early version of Elan touchpads doesn't obey the rule. */
>  	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;
> +	else {
> +		switch (ver) {
> +		case 2:
> +		case 4:
> +			etd->hw_version = 2;
> +			break;
> +		case 5:
> +			etd->hw_version = 3;
> +			break;
> +		case 6:
> +			etd->hw_version = 4;
> +			break;
> +		default:
> +			return -1;
> +		}
> +	}
> 
>  	/*
>  	 * Turn on packet checking by default.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Input: elantech: adjust hw_version detection logic
  2011-11-08 17:55 ` Marc Dietrich
@ 2011-11-09  1:55   ` JJ Ding
  2011-11-09  5:28   ` Éric Piel
  1 sibling, 0 replies; 4+ messages in thread
From: JJ Ding @ 2011-11-09  1:55 UTC (permalink / raw)
  To: Marc Dietrich; +Cc: Dmitry Torokhov, Éric Piel, linux-input

On Tue, 08 Nov 2011 18:55:37 +0100, Marc Dietrich <marvin24@gmx.de> wrote:
> hi Jj,
> 
> On Tuesday 08 November 2011 20:08:19 JJ Ding wrote:
> > This patch fixes some v3 hardware (fw_version: 0x150500) wrongly detected
> > as v2 hardware.
> > 
> > Reported-by: Marc Dietrich <marvin24@gmx.de>
> > Signed-off-by: JJ Ding <jj_ding@emc.com.tw>
> > ---
> > Hi list,
> > 
> > This is patched against v3.2-rc1.
> > 
> > Marc, could you please test this again? Thanks a lot.
> 
> patch works fine here. You may add:
> 
> 	Tested-By: Marc Dietrich <marvin24@gmx.de>
> 

Thank you for the testing ;-)

> Btw, are there any known issues with suspend/resume? The touchpad doesn't seem 
> to wakeup again after resume, but that's propably a problem of our kbd 
> controller driver. Just in case there's something known...
> 
> Thanks Marc
> 
I am not aware of any issue with suspend/resume, AFAICT. But we really
test mostly on a standard PC hardware, I think I cannot say there's
none, since your board is arm-based.

Thanks,
jj

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Input: elantech: adjust hw_version detection logic
  2011-11-08 17:55 ` Marc Dietrich
  2011-11-09  1:55   ` JJ Ding
@ 2011-11-09  5:28   ` Éric Piel
  1 sibling, 0 replies; 4+ messages in thread
From: Éric Piel @ 2011-11-09  5:28 UTC (permalink / raw)
  To: Marc Dietrich; +Cc: JJ Ding, Dmitry Torokhov, linux-input

Op 08-11-11 18:55, Marc Dietrich schreef:
> hi Jj,
>
> On Tuesday 08 November 2011 20:08:19 JJ Ding wrote:
>> This patch fixes some v3 hardware (fw_version: 0x150500) wrongly detected
>> as v2 hardware.
>>
>> Reported-by: Marc Dietrich<marvin24@gmx.de>
>> Signed-off-by: JJ Ding<jj_ding@emc.com.tw>
>> ---
>> Hi list,
>>
>> This is patched against v3.2-rc1.
>>
>> Marc, could you please test this again? Thanks a lot.
Indeed, it looks good :-)
Acked-by: Éric Piel <eric.piel@tremplin-utc.net>

>
> patch works fine here. You may add:
>
> 	Tested-By: Marc Dietrich<marvin24@gmx.de>
>
> Btw, are there any known issues with suspend/resume? The touchpad doesn't seem
> to wakeup again after resume, but that's propably a problem of our kbd
> controller driver. Just in case there's something known...
Just for the info, I've never received any reports of problems with the 
suspend/resume (nor noticed any).

See you,
Éric

--
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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-11-09  5:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-08 12:08 [PATCH] Input: elantech: adjust hw_version detection logic JJ Ding
2011-11-08 17:55 ` Marc Dietrich
2011-11-09  1:55   ` JJ Ding
2011-11-09  5:28   ` Éric Piel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).