linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Input: raydium_ts_i2c: Do not send zero length
@ 2020-12-15 11:20 jeffrey.lin
  0 siblings, 0 replies; 4+ messages in thread
From: jeffrey.lin @ 2020-12-15 11:20 UTC (permalink / raw)
  To: dmitry.torokhov, furquan, seanpaul, rrangel, dan.carpenter
  Cc: jeffrey.lin, KP.li, jeffrey.lin, calvin.tseng, simba.hsu,
	linux-kernel, linux-input

Add default write command package to prevent i2c quirk error of zero
data length as Raydium touch firmware update is executed.

Signed-off-by: jeffrey.lin <jeffrey.lin@rad-ic.com>
---
 drivers/input/touchscreen/raydium_i2c_ts.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/input/touchscreen/raydium_i2c_ts.c b/drivers/input/touchscreen/raydium_i2c_ts.c
index 603a948460d64..4d2d22a869773 100644
--- a/drivers/input/touchscreen/raydium_i2c_ts.c
+++ b/drivers/input/touchscreen/raydium_i2c_ts.c
@@ -445,6 +445,7 @@ static int raydium_i2c_write_object(struct i2c_client *client,
 				    enum raydium_bl_ack state)
 {
 	int error;
+	static const u8 cmd[] = { 0xFF, 0x39 };
 
 	error = raydium_i2c_send(client, RM_CMD_BOOT_WRT, data, len);
 	if (error) {
@@ -453,7 +454,7 @@ static int raydium_i2c_write_object(struct i2c_client *client,
 		return error;
 	}
 
-	error = raydium_i2c_send(client, RM_CMD_BOOT_ACK, NULL, 0);
+	error = raydium_i2c_send(client, RM_CMD_BOOT_ACK, cmd, sizeof(cmd));
 	if (error) {
 		dev_err(&client->dev, "Ack obj command failed: %d\n", error);
 		return error;
-- 
2.26.2


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

* Re: [PATCH] Input: raydium_ts_i2c: Do not send zero length
       [not found]   ` <CAGdSJX2esa41ypqhGGVSJn+Yqxz8gTyz4HYmfB4WfVDEJLgVYw@mail.gmail.com>
@ 2020-12-15  6:27     ` Dmitry Torokhov
  0 siblings, 0 replies; 4+ messages in thread
From: Dmitry Torokhov @ 2020-12-15  6:27 UTC (permalink / raw)
  To: Jeffrey Lin
  Cc: Furquan Shaikh, Sean Paul, rrangel, dan.carpenter, jeffrey.lin,
	KP.li, calvin.tseng, simba.hsu, linux-kernel, linux-input

On Tue, Dec 15, 2020 at 02:07:00PM +0800, Jeffrey Lin wrote:
> Yes, it is.

Great!

> 
> Dmitry Torokhov <dmitry.torokhov@gmail.com> 於 2020年12月15日 週二 下午1:48寫道:
> 
> > Hi Jeffrey,
> >
> > On Tue, Dec 15, 2020 at 11:21:06AM +0800, jeffrey.lin wrote:
> > > Add default write command package to prevent i2c quirk error of zero
> > > data length as Raydium touch firmware update is executed.
> > >
> > > Signed-off-by: jeffrey.lin <jeffrey.lin@rad-ic.com>
> > > BUG=b:174207906
> > > TEST=Successfully tested update Raydium touch firmware over 100 times
> > > Change-Id: I311b0d26d7642bb800547cd0e87013be17cb7e1b

Could you please drop these BUG/TEST/Change-Id and re-send from your
main account (jeffrey.lin@rad-ic.com)? Or simply add "From:" tag:

From: Jeffrey Lin <jeffrey.lin@rad-ic.com>

> > > ---
> > >  drivers/input/touchscreen/raydium_i2c_ts.c | 3 ++-
> > >  1 file changed, 2 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/input/touchscreen/raydium_i2c_ts.c
> > b/drivers/input/touchscreen/raydium_i2c_ts.c
> > > index 603a948460d64..4d2d22a869773 100644
> > > --- a/drivers/input/touchscreen/raydium_i2c_ts.c
> > > +++ b/drivers/input/touchscreen/raydium_i2c_ts.c
> > > @@ -445,6 +445,7 @@ static int raydium_i2c_write_object(struct
> > i2c_client *client,
> > >                                   enum raydium_bl_ack state)
> > >  {
> > >       int error;
> > > +     static const u8 cmd[] = { 0xFF, 0x39 };
> > >
> > >       error = raydium_i2c_send(client, RM_CMD_BOOT_WRT, data, len);
> > >       if (error) {
> > > @@ -453,7 +454,7 @@ static int raydium_i2c_write_object(struct
> > i2c_client *client,
> > >               return error;
> > >       }
> > >
> > > -     error = raydium_i2c_send(client, RM_CMD_BOOT_ACK, NULL, 0);
> > > +     error = raydium_i2c_send(client, RM_CMD_BOOT_ACK, cmd,
> > sizeof(cmd));
> >
> > Is this supported by all firmwares?
> >
> > >       if (error) {
> > >               dev_err(&client->dev, "Ack obj command failed: %d\n",
> > error);
> > >               return error;
> > > --
> > > 2.26.2
> > >
> >
> > Thanks.
> >
> > --
> > Dmitry
> >

Thanks!

-- 
Dmitry

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

* Re: [PATCH] Input: raydium_ts_i2c: Do not send zero length
  2020-12-15  3:21 jeffrey.lin
@ 2020-12-15  5:48 ` Dmitry Torokhov
       [not found]   ` <CAGdSJX2esa41ypqhGGVSJn+Yqxz8gTyz4HYmfB4WfVDEJLgVYw@mail.gmail.com>
  0 siblings, 1 reply; 4+ messages in thread
From: Dmitry Torokhov @ 2020-12-15  5:48 UTC (permalink / raw)
  To: jeffrey.lin
  Cc: furquan, seanpaul, rrangel, dan.carpenter, jeffrey.lin, KP.li,
	calvin.tseng, simba.hsu, linux-kernel, linux-input

Hi Jeffrey,

On Tue, Dec 15, 2020 at 11:21:06AM +0800, jeffrey.lin wrote:
> Add default write command package to prevent i2c quirk error of zero
> data length as Raydium touch firmware update is executed.
> 
> Signed-off-by: jeffrey.lin <jeffrey.lin@rad-ic.com>
> BUG=b:174207906
> TEST=Successfully tested update Raydium touch firmware over 100 times
> Change-Id: I311b0d26d7642bb800547cd0e87013be17cb7e1b
> ---
>  drivers/input/touchscreen/raydium_i2c_ts.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/input/touchscreen/raydium_i2c_ts.c b/drivers/input/touchscreen/raydium_i2c_ts.c
> index 603a948460d64..4d2d22a869773 100644
> --- a/drivers/input/touchscreen/raydium_i2c_ts.c
> +++ b/drivers/input/touchscreen/raydium_i2c_ts.c
> @@ -445,6 +445,7 @@ static int raydium_i2c_write_object(struct i2c_client *client,
>  				    enum raydium_bl_ack state)
>  {
>  	int error;
> +	static const u8 cmd[] = { 0xFF, 0x39 };
>  
>  	error = raydium_i2c_send(client, RM_CMD_BOOT_WRT, data, len);
>  	if (error) {
> @@ -453,7 +454,7 @@ static int raydium_i2c_write_object(struct i2c_client *client,
>  		return error;
>  	}
>  
> -	error = raydium_i2c_send(client, RM_CMD_BOOT_ACK, NULL, 0);
> +	error = raydium_i2c_send(client, RM_CMD_BOOT_ACK, cmd, sizeof(cmd));

Is this supported by all firmwares?

>  	if (error) {
>  		dev_err(&client->dev, "Ack obj command failed: %d\n", error);
>  		return error;
> -- 
> 2.26.2
> 

Thanks.

-- 
Dmitry

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

* [PATCH] Input: raydium_ts_i2c: Do not send zero length
@ 2020-12-15  3:21 jeffrey.lin
  2020-12-15  5:48 ` Dmitry Torokhov
  0 siblings, 1 reply; 4+ messages in thread
From: jeffrey.lin @ 2020-12-15  3:21 UTC (permalink / raw)
  To: dmitry.torokhov, furquan, seanpaul, rrangel, dan.carpenter
  Cc: jeffrey.lin, KP.li, jeffrey.lin, calvin.tseng, simba.hsu,
	linux-kernel, linux-input

Add default write command package to prevent i2c quirk error of zero
data length as Raydium touch firmware update is executed.

Signed-off-by: jeffrey.lin <jeffrey.lin@rad-ic.com>
BUG=b:174207906
TEST=Successfully tested update Raydium touch firmware over 100 times
Change-Id: I311b0d26d7642bb800547cd0e87013be17cb7e1b
---
 drivers/input/touchscreen/raydium_i2c_ts.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/input/touchscreen/raydium_i2c_ts.c b/drivers/input/touchscreen/raydium_i2c_ts.c
index 603a948460d64..4d2d22a869773 100644
--- a/drivers/input/touchscreen/raydium_i2c_ts.c
+++ b/drivers/input/touchscreen/raydium_i2c_ts.c
@@ -445,6 +445,7 @@ static int raydium_i2c_write_object(struct i2c_client *client,
 				    enum raydium_bl_ack state)
 {
 	int error;
+	static const u8 cmd[] = { 0xFF, 0x39 };
 
 	error = raydium_i2c_send(client, RM_CMD_BOOT_WRT, data, len);
 	if (error) {
@@ -453,7 +454,7 @@ static int raydium_i2c_write_object(struct i2c_client *client,
 		return error;
 	}
 
-	error = raydium_i2c_send(client, RM_CMD_BOOT_ACK, NULL, 0);
+	error = raydium_i2c_send(client, RM_CMD_BOOT_ACK, cmd, sizeof(cmd));
 	if (error) {
 		dev_err(&client->dev, "Ack obj command failed: %d\n", error);
 		return error;
-- 
2.26.2


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

end of thread, other threads:[~2020-12-15 11:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-15 11:20 [PATCH] Input: raydium_ts_i2c: Do not send zero length jeffrey.lin
  -- strict thread matches above, loose matches on Subject: below --
2020-12-15  3:21 jeffrey.lin
2020-12-15  5:48 ` Dmitry Torokhov
     [not found]   ` <CAGdSJX2esa41ypqhGGVSJn+Yqxz8gTyz4HYmfB4WfVDEJLgVYw@mail.gmail.com>
2020-12-15  6:27     ` 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).