diff mbox series

Input: raydium_ts_i2c: Do not send zero length

Message ID 1608002466-9263-1-git-send-email-jeffrey.lin@raydium.corp-partner.google.com
State Superseded
Headers show
Series Input: raydium_ts_i2c: Do not send zero length | expand

Commit Message

jeffrey.lin Dec. 15, 2020, 3:21 a.m. UTC
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(-)

Comments

Dmitry Torokhov Dec. 15, 2020, 5:48 a.m. UTC | #1
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.
diff mbox series

Patch

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;