linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Input: elan_i2c - add ASUS EeeBook X205TA special touchpad fw
@ 2017-03-05  2:13 Matjaz Hegedic
  2017-03-06 19:54 ` Dmitry Torokhov
  0 siblings, 1 reply; 6+ messages in thread
From: Matjaz Hegedic @ 2017-03-05  2:13 UTC (permalink / raw)
  To: dmitry.torokhov; +Cc: linux-input, linux-kernel, Matjaz Hegedic

EeeBook X205TA is yet another ASUS device with a special touchpad
firmware that needs to be accounted for during initialization, or
else the touchpad will go into an invalid state upon suspend/resume.
Adding the appropriate ic_type and product_id check fixes the problem.

Signed-off-by: Matjaz Hegedic <matjaz.hegedic@gmail.com>
---
 drivers/input/mouse/elan_i2c_core.c | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/drivers/input/mouse/elan_i2c_core.c b/drivers/input/mouse/elan_i2c_core.c
index 2c7d287..dde3ad7 100644
--- a/drivers/input/mouse/elan_i2c_core.c
+++ b/drivers/input/mouse/elan_i2c_core.c
@@ -218,17 +218,19 @@ static int elan_query_product(struct elan_tp_data *data)
 
 static int elan_check_ASUS_special_fw(struct elan_tp_data *data)
 {
-	if (data->ic_type != 0x0E)
-		return false;
-
-	switch (data->product_id) {
-	case 0x05 ... 0x07:
-	case 0x09:
-	case 0x13:
-		return true;
-	default:
-		return false;
+	if (data->ic_type == 0x0E) {
+		switch (data->product_id) {
+		case 0x05 ... 0x07:
+		case 0x09:
+		case 0x13:
+			return true;
+		}
 	}
+	/* ASUS EeeBook X205TA */
+	else if (data->ic_type == 0x8 && data->product_id == 0x26)
+		return true;
+
+	return false;
 }
 
 static int __elan_initialize(struct elan_tp_data *data)
-- 
2.7.4

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

* Re: [PATCH] Input: elan_i2c - add ASUS EeeBook X205TA special touchpad fw
  2017-03-05  2:13 [PATCH] Input: elan_i2c - add ASUS EeeBook X205TA special touchpad fw Matjaz Hegedic
@ 2017-03-06 19:54 ` Dmitry Torokhov
  2017-03-07  7:05   ` 廖崇榮
  0 siblings, 1 reply; 6+ messages in thread
From: Dmitry Torokhov @ 2017-03-06 19:54 UTC (permalink / raw)
  To: KT Liao; +Cc: linux-input, linux-kernel, Matjaz Hegedic

On Sun, Mar 05, 2017 at 03:13:02AM +0100, Matjaz Hegedic wrote:
> EeeBook X205TA is yet another ASUS device with a special touchpad
> firmware that needs to be accounted for during initialization, or
> else the touchpad will go into an invalid state upon suspend/resume.
> Adding the appropriate ic_type and product_id check fixes the problem.

KT, does this look reasonable? Are there more ASUS models that need such
handling?

> 
> Signed-off-by: Matjaz Hegedic <matjaz.hegedic@gmail.com>
> ---
>  drivers/input/mouse/elan_i2c_core.c | 22 ++++++++++++----------
>  1 file changed, 12 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/input/mouse/elan_i2c_core.c b/drivers/input/mouse/elan_i2c_core.c
> index 2c7d287..dde3ad7 100644
> --- a/drivers/input/mouse/elan_i2c_core.c
> +++ b/drivers/input/mouse/elan_i2c_core.c
> @@ -218,17 +218,19 @@ static int elan_query_product(struct elan_tp_data *data)
>  
>  static int elan_check_ASUS_special_fw(struct elan_tp_data *data)
>  {
> -	if (data->ic_type != 0x0E)
> -		return false;
> -
> -	switch (data->product_id) {
> -	case 0x05 ... 0x07:
> -	case 0x09:
> -	case 0x13:
> -		return true;
> -	default:
> -		return false;
> +	if (data->ic_type == 0x0E) {
> +		switch (data->product_id) {
> +		case 0x05 ... 0x07:
> +		case 0x09:
> +		case 0x13:
> +			return true;
> +		}
>  	}
> +	/* ASUS EeeBook X205TA */
> +	else if (data->ic_type == 0x8 && data->product_id == 0x26)
> +		return true;
> +
> +	return false;
>  }
>  
>  static int __elan_initialize(struct elan_tp_data *data)
> -- 
> 2.7.4
> 

Thanks.

-- 
Dmitry

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

* RE: [PATCH] Input: elan_i2c - add ASUS EeeBook X205TA special touchpad fw
  2017-03-06 19:54 ` Dmitry Torokhov
@ 2017-03-07  7:05   ` 廖崇榮
  2017-03-07 10:51     ` Matjaž Hegedič
  0 siblings, 1 reply; 6+ messages in thread
From: 廖崇榮 @ 2017-03-07  7:05 UTC (permalink / raw)
  To: 'Dmitry Torokhov'
  Cc: linux-input, linux-kernel, 'Matjaz Hegedic',
	黃世鵬 經理,
	miller_wang

Hi Dmitry

-----Original Message-----
From: Dmitry Torokhov [mailto:dmitry.torokhov@gmail.com] 
Sent: Tuesday, March 07, 2017 3:55 AM
To: KT Liao
Cc: linux-input@vger.kernel.org; linux-kernel@vger.kernel.org; Matjaz
Hegedic
Subject: Re: [PATCH] Input: elan_i2c - add ASUS EeeBook X205TA special
touchpad fw

On Sun, Mar 05, 2017 at 03:13:02AM +0100, Matjaz Hegedic wrote:
> EeeBook X205TA is yet another ASUS device with a special touchpad 
> firmware that needs to be accounted for during initialization, or else 
> the touchpad will go into an invalid state upon suspend/resume.
> Adding the appropriate ic_type and product_id check fixes the problem.

KT, does this look reasonable? Are there more ASUS models that need such
handling?
[KT] : I just discuss it with FW team. 
We can't confirm it right now because it's an old product. And the solution
focus on power-on issue, not suspend/resume.
I will let you know once we figure it out.

Our FW has modified, the issue should not happen on new models.

Thanks		KT
> 
> Signed-off-by: Matjaz Hegedic <matjaz.hegedic@gmail.com>
> ---
>  drivers/input/mouse/elan_i2c_core.c | 22 ++++++++++++----------
>  1 file changed, 12 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/input/mouse/elan_i2c_core.c 
> b/drivers/input/mouse/elan_i2c_core.c
> index 2c7d287..dde3ad7 100644
> --- a/drivers/input/mouse/elan_i2c_core.c
> +++ b/drivers/input/mouse/elan_i2c_core.c
> @@ -218,17 +218,19 @@ static int elan_query_product(struct 
> elan_tp_data *data)
>  
>  static int elan_check_ASUS_special_fw(struct elan_tp_data *data)  {
> -	if (data->ic_type != 0x0E)
> -		return false;
> -
> -	switch (data->product_id) {
> -	case 0x05 ... 0x07:
> -	case 0x09:
> -	case 0x13:
> -		return true;
> -	default:
> -		return false;
> +	if (data->ic_type == 0x0E) {
> +		switch (data->product_id) {
> +		case 0x05 ... 0x07:
> +		case 0x09:
> +		case 0x13:
> +			return true;
> +		}
>  	}
> +	/* ASUS EeeBook X205TA */
> +	else if (data->ic_type == 0x8 && data->product_id == 0x26)
> +		return true;
> +
> +	return false;
>  }
>  
>  static int __elan_initialize(struct elan_tp_data *data)
> --
> 2.7.4
> 

Thanks.

-- 
Dmitry

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

* Re: [PATCH] Input: elan_i2c - add ASUS EeeBook X205TA special touchpad fw
  2017-03-07  7:05   ` 廖崇榮
@ 2017-03-07 10:51     ` Matjaž Hegedič
  2017-03-08  6:30       ` 廖崇榮
  0 siblings, 1 reply; 6+ messages in thread
From: Matjaž Hegedič @ 2017-03-07 10:51 UTC (permalink / raw)
  To: 廖崇榮, 'Dmitry Torokhov'
  Cc: linux-input, linux-kernel,
	黃世鵬 經理,
	miller_wang

Hi Dmitry, KT!

On 2017-03-07 08:05, 廖崇榮 wrote:
> Hi Dmitry
>
> -----Original Message-----
> From: Dmitry Torokhov [mailto:dmitry.torokhov@gmail.com]
> Sent: Tuesday, March 07, 2017 3:55 AM
> To: KT Liao
> Cc: linux-input@vger.kernel.org; linux-kernel@vger.kernel.org; Matjaz
> Hegedic
> Subject: Re: [PATCH] Input: elan_i2c - add ASUS EeeBook X205TA special
> touchpad fw
>
> On Sun, Mar 05, 2017 at 03:13:02AM +0100, Matjaz Hegedic wrote:
>> EeeBook X205TA is yet another ASUS device with a special touchpad
>> firmware that needs to be accounted for during initialization, or else
>> the touchpad will go into an invalid state upon suspend/resume.
>> Adding the appropriate ic_type and product_id check fixes the problem.
>
> KT, does this look reasonable? Are there more ASUS models that need such
> handling?
> [KT] : I just discuss it with FW team.
> We can't confirm it right now because it's an old product. And the solution
> focus on power-on issue, not suspend/resume.
> I will let you know once we figure it out.
>
> Our FW has modified, the issue should not happen on new models.
>
> Thanks		KT

As it is now, the touchpad will stop working upon resume, returning an
invalid id (and requires a cumbersome workaround of reloading the 
module). As the touchpad FW is opaque to me, the only way I could 
resolve the bug was through trial-and-error. Including the touchpad in 
the 'special fw' resolves the bug and the touchpad resumes without issue.

Now, even if the function is indeed used to resolve a different issue on 
other ASUS touchpads, I would argue that this is the most pragmatic way 
of resolving the problem on X205TA, X205TAW and F205TA (and possibly 
also X200HA & X206HA, though I don't have those to test).

It shouldn't affect any other models or touchpad products.

Thanks!

>>
>> Signed-off-by: Matjaz Hegedic <matjaz.hegedic@gmail.com>
>> ---
>>  drivers/input/mouse/elan_i2c_core.c | 22 ++++++++++++----------
>>  1 file changed, 12 insertions(+), 10 deletions(-)
>>
>> diff --git a/drivers/input/mouse/elan_i2c_core.c
>> b/drivers/input/mouse/elan_i2c_core.c
>> index 2c7d287..dde3ad7 100644
>> --- a/drivers/input/mouse/elan_i2c_core.c
>> +++ b/drivers/input/mouse/elan_i2c_core.c
>> @@ -218,17 +218,19 @@ static int elan_query_product(struct
>> elan_tp_data *data)
>>
>>  static int elan_check_ASUS_special_fw(struct elan_tp_data *data)  {
>> -	if (data->ic_type != 0x0E)
>> -		return false;
>> -
>> -	switch (data->product_id) {
>> -	case 0x05 ... 0x07:
>> -	case 0x09:
>> -	case 0x13:
>> -		return true;
>> -	default:
>> -		return false;
>> +	if (data->ic_type == 0x0E) {
>> +		switch (data->product_id) {
>> +		case 0x05 ... 0x07:
>> +		case 0x09:
>> +		case 0x13:
>> +			return true;
>> +		}
>>  	}
>> +	/* ASUS EeeBook X205TA */
>> +	else if (data->ic_type == 0x8 && data->product_id == 0x26)
>> +		return true;
>> +
>> +	return false;
>>  }
>>
>>  static int __elan_initialize(struct elan_tp_data *data)
>> --
>> 2.7.4
>>
>
> Thanks.
>

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

* RE: [PATCH] Input: elan_i2c - add ASUS EeeBook X205TA special touchpad fw
  2017-03-07 10:51     ` Matjaž Hegedič
@ 2017-03-08  6:30       ` 廖崇榮
  2017-03-10 22:36         ` 'Dmitry Torokhov'
  0 siblings, 1 reply; 6+ messages in thread
From: 廖崇榮 @ 2017-03-08  6:30 UTC (permalink / raw)
  To: 'Matjaž Hegedič', 'Dmitry Torokhov'
  Cc: linux-input, linux-kernel,
	'黃世鵬 經理',
	miller_wang

Hi Matjaz,

-----Original Message-----
From: Matjaž Hegedič [mailto:matjaz.hegedic@gmail.com] 
Sent: Tuesday, March 07, 2017 6:52 PM
To: 廖崇榮; 'Dmitry Torokhov'
Cc: linux-input@vger.kernel.org; linux-kernel@vger.kernel.org; 黃世鵬 經理; miller_wang@emc.com.tw
Subject: Re: [PATCH] Input: elan_i2c - add ASUS EeeBook X205TA special touchpad fw

Hi Dmitry, KT!

On 2017-03-07 08:05, 廖崇榮 wrote:
> Hi Dmitry
>
> -----Original Message-----
> From: Dmitry Torokhov [mailto:dmitry.torokhov@gmail.com]
> Sent: Tuesday, March 07, 2017 3:55 AM
> To: KT Liao
> Cc: linux-input@vger.kernel.org; linux-kernel@vger.kernel.org; Matjaz 
> Hegedic
> Subject: Re: [PATCH] Input: elan_i2c - add ASUS EeeBook X205TA special 
> touchpad fw
>
> On Sun, Mar 05, 2017 at 03:13:02AM +0100, Matjaz Hegedic wrote:
>> EeeBook X205TA is yet another ASUS device with a special touchpad 
>> firmware that needs to be accounted for during initialization, or 
>> else the touchpad will go into an invalid state upon suspend/resume.
>> Adding the appropriate ic_type and product_id check fixes the problem.
>
> KT, does this look reasonable? Are there more ASUS models that need 
> such handling?
> [KT] : I just discuss it with FW team.
> We can't confirm it right now because it's an old product. And the 
> solution focus on power-on issue, not suspend/resume.
> I will let you know once we figure it out.
>
> Our FW has modified, the issue should not happen on new models.
>
> Thanks		KT

As it is now, the touchpad will stop working upon resume, returning an invalid id (and requires a cumbersome workaround of reloading the module). As the touchpad FW is opaque to me, the only way I could resolve the bug was through trial-and-error. Including the touchpad in the 'special fw' resolves the bug and the touchpad resumes without issue.

Now, even if the function is indeed used to resolve a different issue on other ASUS touchpads, I would argue that this is the most pragmatic way of resolving the problem on X205TA, X205TAW and F205TA (and possibly also X200HA & X206HA, though I don't have those to test).

It shouldn't affect any other models or touchpad products.

Thanks!

I agree your opinion.
The special handle simply changes the sequence of commands and adds delay cycle. 
It is harmless to general Elan products but rescue control flaws in some FW.

Thanks		KT
>>
>> Signed-off-by: Matjaz Hegedic <matjaz.hegedic@gmail.com>
>> ---
>>  drivers/input/mouse/elan_i2c_core.c | 22 ++++++++++++----------
>>  1 file changed, 12 insertions(+), 10 deletions(-)
>>
>> diff --git a/drivers/input/mouse/elan_i2c_core.c
>> b/drivers/input/mouse/elan_i2c_core.c
>> index 2c7d287..dde3ad7 100644
>> --- a/drivers/input/mouse/elan_i2c_core.c
>> +++ b/drivers/input/mouse/elan_i2c_core.c
>> @@ -218,17 +218,19 @@ static int elan_query_product(struct 
>> elan_tp_data *data)
>>
>>  static int elan_check_ASUS_special_fw(struct elan_tp_data *data)  {
>> -	if (data->ic_type != 0x0E)
>> -		return false;
>> -
>> -	switch (data->product_id) {
>> -	case 0x05 ... 0x07:
>> -	case 0x09:
>> -	case 0x13:
>> -		return true;
>> -	default:
>> -		return false;
>> +	if (data->ic_type == 0x0E) {
>> +		switch (data->product_id) {
>> +		case 0x05 ... 0x07:
>> +		case 0x09:
>> +		case 0x13:
>> +			return true;
>> +		}
>>  	}
>> +	/* ASUS EeeBook X205TA */
>> +	else if (data->ic_type == 0x8 && data->product_id == 0x26)
>> +		return true;
>> +
>> +	return false;
>>  }
>>
>>  static int __elan_initialize(struct elan_tp_data *data)
>> --
>> 2.7.4
>>
>
> Thanks.
>

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

* Re: [PATCH] Input: elan_i2c - add ASUS EeeBook X205TA special touchpad fw
  2017-03-08  6:30       ` 廖崇榮
@ 2017-03-10 22:36         ` 'Dmitry Torokhov'
  0 siblings, 0 replies; 6+ messages in thread
From: 'Dmitry Torokhov' @ 2017-03-10 22:36 UTC (permalink / raw)
  To: 廖崇榮
  Cc: 'Matjaž Hegedič',
	linux-input, linux-kernel,
	'黃世鵬 經理',
	miller_wang

On Wed, Mar 08, 2017 at 02:30:42PM +0800, 廖崇榮 wrote:
> Hi Matjaz,
> 
> -----Original Message-----
> From: Matjaž Hegedič [mailto:matjaz.hegedic@gmail.com] 
> Sent: Tuesday, March 07, 2017 6:52 PM
> To: 廖崇榮; 'Dmitry Torokhov'
> Cc: linux-input@vger.kernel.org; linux-kernel@vger.kernel.org; 黃世鵬 經理; miller_wang@emc.com.tw
> Subject: Re: [PATCH] Input: elan_i2c - add ASUS EeeBook X205TA special touchpad fw
> 
> Hi Dmitry, KT!
> 
> On 2017-03-07 08:05, 廖崇榮 wrote:
> > Hi Dmitry
> >
> > -----Original Message-----
> > From: Dmitry Torokhov [mailto:dmitry.torokhov@gmail.com]
> > Sent: Tuesday, March 07, 2017 3:55 AM
> > To: KT Liao
> > Cc: linux-input@vger.kernel.org; linux-kernel@vger.kernel.org; Matjaz 
> > Hegedic
> > Subject: Re: [PATCH] Input: elan_i2c - add ASUS EeeBook X205TA special 
> > touchpad fw
> >
> > On Sun, Mar 05, 2017 at 03:13:02AM +0100, Matjaz Hegedic wrote:
> >> EeeBook X205TA is yet another ASUS device with a special touchpad 
> >> firmware that needs to be accounted for during initialization, or 
> >> else the touchpad will go into an invalid state upon suspend/resume.
> >> Adding the appropriate ic_type and product_id check fixes the problem.
> >
> > KT, does this look reasonable? Are there more ASUS models that need 
> > such handling?
> > [KT] : I just discuss it with FW team.
> > We can't confirm it right now because it's an old product. And the 
> > solution focus on power-on issue, not suspend/resume.
> > I will let you know once we figure it out.
> >
> > Our FW has modified, the issue should not happen on new models.
> >
> > Thanks		KT
> 
> As it is now, the touchpad will stop working upon resume, returning an invalid id (and requires a cumbersome workaround of reloading the module). As the touchpad FW is opaque to me, the only way I could resolve the bug was through trial-and-error. Including the touchpad in the 'special fw' resolves the bug and the touchpad resumes without issue.
> 
> Now, even if the function is indeed used to resolve a different issue on other ASUS touchpads, I would argue that this is the most pragmatic way of resolving the problem on X205TA, X205TAW and F205TA (and possibly also X200HA & X206HA, though I don't have those to test).
> 
> It shouldn't affect any other models or touchpad products.
> 
> Thanks!
> 
> I agree your opinion.
> The special handle simply changes the sequence of commands and adds delay cycle. 
> It is harmless to general Elan products but rescue control flaws in some FW.
> 
> Thanks		KT

OK, I added KT as Acked-by and marked for stable.

Thanks.

-- 
Dmitry

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

end of thread, other threads:[~2017-03-10 22:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-05  2:13 [PATCH] Input: elan_i2c - add ASUS EeeBook X205TA special touchpad fw Matjaz Hegedic
2017-03-06 19:54 ` Dmitry Torokhov
2017-03-07  7:05   ` 廖崇榮
2017-03-07 10:51     ` Matjaž Hegedič
2017-03-08  6:30       ` 廖崇榮
2017-03-10 22:36         ` 'Dmitry Torokhov'

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