Linux Input Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH 1/3] Input: elan_i2c - Do no operation for elan_smbus_set_mode function
@ 2019-12-09 11:11 Dave Wang
  2020-07-21 16:12 ` Dmitry Torokhov
  0 siblings, 1 reply; 4+ messages in thread
From: Dave Wang @ 2019-12-09 11:11 UTC (permalink / raw)
  To: Linux-input, Linux-kernel, Dmitry.torokhov
  Cc: phoenix, josh.chen, jingle.wu, kai.heng.feng, Dave Wang

Some touchpads might get error while triggerring the set_mode command
in SMBus interface. Do no operation for elan_smbus_set_mode function.

Signed-off-by: Dave Wang <dave.wang@emc.com.tw>
---
 drivers/input/mouse/elan_i2c_smbus.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/input/mouse/elan_i2c_smbus.c b/drivers/input/mouse/elan_i2c_smbus.c
index 8c3185d54c73..bcb9ec4a7a6b 100644
--- a/drivers/input/mouse/elan_i2c_smbus.c
+++ b/drivers/input/mouse/elan_i2c_smbus.c
@@ -84,10 +84,7 @@ static int elan_smbus_initialize(struct i2c_client *client)
 
 static int elan_smbus_set_mode(struct i2c_client *client, u8 mode)
 {
-	u8 cmd[4] = { 0x00, 0x07, 0x00, mode };
-
-	return i2c_smbus_write_block_data(client, ETP_SMBUS_IAP_CMD,
-					  sizeof(cmd), cmd);
+	return 0; /* A no-op */
 }
 
 static int elan_smbus_sleep_control(struct i2c_client *client, bool sleep)
-- 
2.17.1


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

* Re: [PATCH 1/3] Input: elan_i2c - Do no operation for elan_smbus_set_mode function
  2019-12-09 11:11 [PATCH 1/3] Input: elan_i2c - Do no operation for elan_smbus_set_mode function Dave Wang
@ 2020-07-21 16:12 ` Dmitry Torokhov
  2020-07-22  2:19   ` Dave.Wang
  2020-07-22  2:55   ` Dave.Wang
  0 siblings, 2 replies; 4+ messages in thread
From: Dmitry Torokhov @ 2020-07-21 16:12 UTC (permalink / raw)
  To: Dave Wang
  Cc: Linux-input, Linux-kernel, phoenix, josh.chen, jingle.wu, kai.heng.feng

Hi Dave,

On Mon, Dec 09, 2019 at 06:11:07AM -0500, Dave Wang wrote:
> Some touchpads might get error while triggerring the set_mode command
> in SMBus interface. Do no operation for elan_smbus_set_mode function.

Are there devices that do not trigger errors? How do we put SMbus
devices into low power mode?

> 
> Signed-off-by: Dave Wang <dave.wang@emc.com.tw>
> ---
>  drivers/input/mouse/elan_i2c_smbus.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/input/mouse/elan_i2c_smbus.c b/drivers/input/mouse/elan_i2c_smbus.c
> index 8c3185d54c73..bcb9ec4a7a6b 100644
> --- a/drivers/input/mouse/elan_i2c_smbus.c
> +++ b/drivers/input/mouse/elan_i2c_smbus.c
> @@ -84,10 +84,7 @@ static int elan_smbus_initialize(struct i2c_client *client)
>  
>  static int elan_smbus_set_mode(struct i2c_client *client, u8 mode)
>  {
> -	u8 cmd[4] = { 0x00, 0x07, 0x00, mode };
> -
> -	return i2c_smbus_write_block_data(client, ETP_SMBUS_IAP_CMD,
> -					  sizeof(cmd), cmd);
> +	return 0; /* A no-op */
>  }
>  
>  static int elan_smbus_sleep_control(struct i2c_client *client, bool sleep)
> -- 
> 2.17.1
> 

Thanks.

-- 
Dmitry

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

* RE: [PATCH 1/3] Input: elan_i2c - Do no operation for elan_smbus_set_mode function
  2020-07-21 16:12 ` Dmitry Torokhov
@ 2020-07-22  2:19   ` Dave.Wang
  2020-07-22  2:55   ` Dave.Wang
  1 sibling, 0 replies; 4+ messages in thread
From: Dave.Wang @ 2020-07-22  2:19 UTC (permalink / raw)
  To: 'Dmitry Torokhov'
  Cc: Linux-input, Linux-kernel, phoenix, josh.chen, jingle.wu, kai.heng.feng

Dear Dmitry,

Are there devices that do not trigger errors?
=> Yes, there exist devices that would act normally. However, our team
cannot organize the rule to recognize which devices could trigger this
command without error. 
What I sure about is that some devices would get TP no function while
triggering this command. 
Besides, ABS mode had been set in P/S2 protocol, so there is no need to set
ABS mode again in SMBUS driver. 

How do we put SMbus devices into low power mode?
=> As far as I am concerned, core.c only set the mode into ABS mode or
ENABLE_CALIBRATE mode after updating firmware. 
I don't know what or when to set SMbus devices into low power mode.

Best regards,
Dave

-----Original Message-----
From: Dmitry Torokhov [mailto:dmitry.torokhov@gmail.com] 
Sent: Wednesday, July 22, 2020 12:13 AM
To: Dave Wang <dave.wang@emc.com.tw>
Cc: Linux-input@vger.kernel.org; Linux-kernel@vger.kernel.org;
phoenix@emc.com.tw; josh.chen@emc.com.tw; jingle.wu@emc.com.tw;
kai.heng.feng@canonical.com
Subject: Re: [PATCH 1/3] Input: elan_i2c - Do no operation for
elan_smbus_set_mode function

Hi Dave,

On Mon, Dec 09, 2019 at 06:11:07AM -0500, Dave Wang wrote:
> Some touchpads might get error while triggerring the set_mode command 
> in SMBus interface. Do no operation for elan_smbus_set_mode function.

Are there devices that do not trigger errors? How do we put SMbus devices
into low power mode?

> 
> Signed-off-by: Dave Wang <dave.wang@emc.com.tw>
> ---
>  drivers/input/mouse/elan_i2c_smbus.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/input/mouse/elan_i2c_smbus.c 
> b/drivers/input/mouse/elan_i2c_smbus.c
> index 8c3185d54c73..bcb9ec4a7a6b 100644
> --- a/drivers/input/mouse/elan_i2c_smbus.c
> +++ b/drivers/input/mouse/elan_i2c_smbus.c
> @@ -84,10 +84,7 @@ static int elan_smbus_initialize(struct i2c_client 
> *client)
>  
>  static int elan_smbus_set_mode(struct i2c_client *client, u8 mode)  {
> -	u8 cmd[4] = { 0x00, 0x07, 0x00, mode };
> -
> -	return i2c_smbus_write_block_data(client, ETP_SMBUS_IAP_CMD,
> -					  sizeof(cmd), cmd);
> +	return 0; /* A no-op */
>  }
>  
>  static int elan_smbus_sleep_control(struct i2c_client *client, bool 
> sleep)
> --
> 2.17.1
> 

Thanks.

--
Dmitry


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

* RE: [PATCH 1/3] Input: elan_i2c - Do no operation for elan_smbus_set_mode function
  2020-07-21 16:12 ` Dmitry Torokhov
  2020-07-22  2:19   ` Dave.Wang
@ 2020-07-22  2:55   ` Dave.Wang
  1 sibling, 0 replies; 4+ messages in thread
From: Dave.Wang @ 2020-07-22  2:55 UTC (permalink / raw)
  To: 'Dmitry Torokhov'
  Cc: Linux-input, Linux-kernel, phoenix, josh.chen, jingle.wu, kai.heng.feng

Dear Dmitry,

Should this be moved into core? Or we only plan on using this on SMbus?
=> using on smbus.

What will happen after firmware update? How can userspace verify that the
firmware update completed successfully if we always return static data?
=> FW modified the architecture that reading register cmd in P/S2 and then
updating flow in SMbus.
As a result, it would not get success result while updating firmware in
SMbus driver.
Elan will use the tool to update firmware.

Can the device still be accessed via PS/2 while also using SMbus?
=> Yes, the device could still be accessed via PS/2 while also using SMbus.
However, we cannot use P/S2 driver and SMbus driver to read register
simultaneously because of the limitation of driver (elantench (ps2) driver
would be unmounted before loading into SMbus driver). So we use tool to
update firmware in SMbus interface.

Best regards,
Dave

-----Original Message-----
From: Dmitry Torokhov [mailto:dmitry.torokhov@gmail.com] 
Sent: Wednesday, July 22, 2020 12:13 AM
To: Dave Wang <dave.wang@emc.com.tw>
Cc: Linux-input@vger.kernel.org; Linux-kernel@vger.kernel.org;
phoenix@emc.com.tw; josh.chen@emc.com.tw; jingle.wu@emc.com.tw;
kai.heng.feng@canonical.com
Subject: Re: [PATCH 1/3] Input: elan_i2c - Do no operation for
elan_smbus_set_mode function

Hi Dave,

On Mon, Dec 09, 2019 at 06:11:07AM -0500, Dave Wang wrote:
> Some touchpads might get error while triggerring the set_mode command 
> in SMBus interface. Do no operation for elan_smbus_set_mode function.

Are there devices that do not trigger errors? How do we put SMbus devices
into low power mode?

> 
> Signed-off-by: Dave Wang <dave.wang@emc.com.tw>
> ---
>  drivers/input/mouse/elan_i2c_smbus.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/input/mouse/elan_i2c_smbus.c 
> b/drivers/input/mouse/elan_i2c_smbus.c
> index 8c3185d54c73..bcb9ec4a7a6b 100644
> --- a/drivers/input/mouse/elan_i2c_smbus.c
> +++ b/drivers/input/mouse/elan_i2c_smbus.c
> @@ -84,10 +84,7 @@ static int elan_smbus_initialize(struct i2c_client 
> *client)
>  
>  static int elan_smbus_set_mode(struct i2c_client *client, u8 mode)  {
> -	u8 cmd[4] = { 0x00, 0x07, 0x00, mode };
> -
> -	return i2c_smbus_write_block_data(client, ETP_SMBUS_IAP_CMD,
> -					  sizeof(cmd), cmd);
> +	return 0; /* A no-op */
>  }
>  
>  static int elan_smbus_sleep_control(struct i2c_client *client, bool 
> sleep)
> --
> 2.17.1
> 

Thanks.

--
Dmitry


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

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-09 11:11 [PATCH 1/3] Input: elan_i2c - Do no operation for elan_smbus_set_mode function Dave Wang
2020-07-21 16:12 ` Dmitry Torokhov
2020-07-22  2:19   ` Dave.Wang
2020-07-22  2:55   ` Dave.Wang

Linux Input Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-input/0 linux-input/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-input linux-input/ https://lore.kernel.org/linux-input \
		linux-input@vger.kernel.org
	public-inbox-index linux-input

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-input


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git