diff mbox

elantech: clean up hardware/firmware version check

Message ID 4DD6E8F4.5070101@tudelft.nl (mailing list archive)
State New, archived
Headers show

Commit Message

Éric Piel May 20, 2011, 10:19 p.m. UTC
Op 17-05-11 07:44, Dmitry Torokhov schreef:
:
> I am not happy with the protocol checks from Dell, I am not sure they
> make much sense; so I dropped patch 3 for now and because of that patch
> 2 did not make much sense either. Actually patch 2 did not make sense on
> its own in any case as it should have been partially rolled into 3 and
> partially into 4.
Hello,
Find below patch 2 rebased. Actually, as half of if is not useful
anymore (we gave up on checking the data for version 2) and you had
integrated the other half already, this doesn't contain a lot anymore.
So it ends up being just a clean up patch, mostly putting all the
version checks in the same place.

See you,
Eric


8<-----------------------------------------------------------------

According to the protocol document, there are a couple of different
versions of the hardware and firmware. Using the version number, it
should be possible to distinguish between them, at least for the
properties we care about. This moves all the version check together.

Signed-off-by: Éric Piel <eric.piel@tremplin-utc.net>
---
 drivers/input/mouse/elantech.c |   28 ++++++++++++++--------------
 1 files changed, 14 insertions(+), 14 deletions(-)

Comments

Henrik Rydberg July 4, 2011, 8:30 p.m. UTC | #1
Hi Éric,

> Find below patch 2 rebased. Actually, as half of if is not useful
> anymore (we gave up on checking the data for version 2) and you had
> integrated the other half already, this doesn't contain a lot anymore.
> So it ends up being just a clean up patch, mostly putting all the
> version checks in the same place.

Did you get any response to this one?

> According to the protocol document, there are a couple of different
> versions of the hardware and firmware. Using the version number, it
> should be possible to distinguish between them, at least for the
> properties we care about. This moves all the version check together.
> 
> Signed-off-by: Éric Piel <eric.piel@tremplin-utc.net>
> ---
>  drivers/input/mouse/elantech.c |   28 ++++++++++++++--------------
>  1 files changed, 14 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
> index 3250356..0d9c547 100644
> --- a/drivers/input/mouse/elantech.c
> +++ b/drivers/input/mouse/elantech.c
> @@ -757,15 +757,25 @@ int elantech_init(struct psmouse *psmouse)
>  		etd->hw_version = 2;
>  		/* For now show extra debug information */
>  		etd->debug = 1;
> -		/* Don't know how to do parity checking for version 2 */
> -		etd->paritycheck = 0;
> +		/* Version 2 doesn't contain control bits */
> +		etd->paritycheck = false;
>  
>  		if (etd->fw_version >= 0x020800)
>  			etd->reports_pressure = true;
> -
> +	} else if ((etd->fw_version == 0x020022) || (etd->fw_version == 0x020600)) {
> +		/*
> +		 * This firmware suffers from misreporting coordinates when
> +		 * a touch action starts causing the mouse cursor or scrolled page
> +		 * to jump. Enable a workaround.
> +		 */
> +		pr_info("firmware version 2.0.34/2.6.0 detected, enabling jumpy cursor workaround\n");
> +		etd->jumpy_cursor = 1;
> +		etd->debug = 1;
> +		etd->hw_version = 1;
> +		etd->paritycheck = true;
>  	} else {
>  		etd->hw_version = 1;
> -		etd->paritycheck = 1;
> +		etd->paritycheck = true;
>  	}
>  
>  	pr_info("assuming hardware version %d, firmware version %d.%d.%d\n",
> @@ -779,16 +789,6 @@ int elantech_init(struct psmouse *psmouse)
>  		param[0], param[1], param[2]);
>  	etd->capabilities = param[0];
>  
> -	/*
> -	 * This firmware suffers from misreporting coordinates when
> -	 * a touch action starts causing the mouse cursor or scrolled page
> -	 * to jump. Enable a workaround.
> -	 */
> -	if (etd->fw_version == 0x020022 || etd->fw_version == 0x020600) {
> -		pr_info("firmware version 2.0.34/2.6.0 detected, enabling jumpy cursor workaround\n");
> -		etd->jumpy_cursor = true;
> -	}
> -
>  	if (elantech_set_absolute_mode(psmouse)) {
>  		pr_err("failed to put touchpad into absolute mode.\n");
>  		goto init_fail;
> -- 
> 1.7.5.1
> 

    Acked-by: Henrik Rydberg <rydberg@euromail.se>

Thanks,
Henrik
--
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
Éric Piel July 22, 2011, 1:38 p.m. UTC | #2
Op 04-07-11 22:30, Henrik Rydberg schreef:
> Hi Éric,
>
>> Find below patch 2 rebased. Actually, as half of if is not useful
>> anymore (we gave up on checking the data for version 2) and you had
>> integrated the other half already, this doesn't contain a lot anymore.
>> So it ends up being just a clean up patch, mostly putting all the
>> version checks in the same place.
>
> Did you get any response to this one?
Not yet.

Dmitry, could you take this patch for elantech?

Cheers,
Éric

>
>> According to the protocol document, there are a couple of different
>> versions of the hardware and firmware. Using the version number, it
>> should be possible to distinguish between them, at least for the
>> properties we care about. This moves all the version check together.
>>
>> Signed-off-by: Éric Piel<eric.piel@tremplin-utc.net>
>> ---
>>   drivers/input/mouse/elantech.c |   28 ++++++++++++++--------------
>>   1 files changed, 14 insertions(+), 14 deletions(-)
>>
>> diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
>> index 3250356..0d9c547 100644
>> --- a/drivers/input/mouse/elantech.c
>> +++ b/drivers/input/mouse/elantech.c
>> @@ -757,15 +757,25 @@ int elantech_init(struct psmouse *psmouse)
>>   		etd->hw_version = 2;
>>   		/* For now show extra debug information */
>>   		etd->debug = 1;
>> -		/* Don't know how to do parity checking for version 2 */
>> -		etd->paritycheck = 0;
>> +		/* Version 2 doesn't contain control bits */
>> +		etd->paritycheck = false;
>>
>>   		if (etd->fw_version>= 0x020800)
>>   			etd->reports_pressure = true;
>> -
>> +	} else if ((etd->fw_version == 0x020022) || (etd->fw_version == 0x020600)) {
>> +		/*
>> +		 * This firmware suffers from misreporting coordinates when
>> +		 * a touch action starts causing the mouse cursor or scrolled page
>> +		 * to jump. Enable a workaround.
>> +		 */
>> +		pr_info("firmware version 2.0.34/2.6.0 detected, enabling jumpy cursor workaround\n");
>> +		etd->jumpy_cursor = 1;
>> +		etd->debug = 1;
>> +		etd->hw_version = 1;
>> +		etd->paritycheck = true;
>>   	} else {
>>   		etd->hw_version = 1;
>> -		etd->paritycheck = 1;
>> +		etd->paritycheck = true;
>>   	}
>>
>>   	pr_info("assuming hardware version %d, firmware version %d.%d.%d\n",
>> @@ -779,16 +789,6 @@ int elantech_init(struct psmouse *psmouse)
>>   		param[0], param[1], param[2]);
>>   	etd->capabilities = param[0];
>>
>> -	/*
>> -	 * This firmware suffers from misreporting coordinates when
>> -	 * a touch action starts causing the mouse cursor or scrolled page
>> -	 * to jump. Enable a workaround.
>> -	 */
>> -	if (etd->fw_version == 0x020022 || etd->fw_version == 0x020600) {
>> -		pr_info("firmware version 2.0.34/2.6.0 detected, enabling jumpy cursor workaround\n");
>> -		etd->jumpy_cursor = true;
>> -	}
>> -
>>   	if (elantech_set_absolute_mode(psmouse)) {
>>   		pr_err("failed to put touchpad into absolute mode.\n");
>>   		goto init_fail;
>> --
>> 1.7.5.1
>>
>
>      Acked-by: Henrik Rydberg<rydberg@euromail.se>

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

Patch

diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
index 3250356..0d9c547 100644
--- a/drivers/input/mouse/elantech.c
+++ b/drivers/input/mouse/elantech.c
@@ -757,15 +757,25 @@  int elantech_init(struct psmouse *psmouse)
 		etd->hw_version = 2;
 		/* For now show extra debug information */
 		etd->debug = 1;
-		/* Don't know how to do parity checking for version 2 */
-		etd->paritycheck = 0;
+		/* Version 2 doesn't contain control bits */
+		etd->paritycheck = false;
 
 		if (etd->fw_version >= 0x020800)
 			etd->reports_pressure = true;
-
+	} else if ((etd->fw_version == 0x020022) || (etd->fw_version == 0x020600)) {
+		/*
+		 * This firmware suffers from misreporting coordinates when
+		 * a touch action starts causing the mouse cursor or scrolled page
+		 * to jump. Enable a workaround.
+		 */
+		pr_info("firmware version 2.0.34/2.6.0 detected, enabling jumpy cursor workaround\n");
+		etd->jumpy_cursor = 1;
+		etd->debug = 1;
+		etd->hw_version = 1;
+		etd->paritycheck = true;
 	} else {
 		etd->hw_version = 1;
-		etd->paritycheck = 1;
+		etd->paritycheck = true;
 	}
 
 	pr_info("assuming hardware version %d, firmware version %d.%d.%d\n",
@@ -779,16 +789,6 @@  int elantech_init(struct psmouse *psmouse)
 		param[0], param[1], param[2]);
 	etd->capabilities = param[0];
 
-	/*
-	 * This firmware suffers from misreporting coordinates when
-	 * a touch action starts causing the mouse cursor or scrolled page
-	 * to jump. Enable a workaround.
-	 */
-	if (etd->fw_version == 0x020022 || etd->fw_version == 0x020600) {
-		pr_info("firmware version 2.0.34/2.6.0 detected, enabling jumpy cursor workaround\n");
-		etd->jumpy_cursor = true;
-	}
-
 	if (elantech_set_absolute_mode(psmouse)) {
 		pr_err("failed to put touchpad into absolute mode.\n");
 		goto init_fail;