linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "jeffrey.lin" <jeffrey.lin@raydium.corp-partner.google.com>
To: dmitry.torokhov@gmail.com, furquan@google.com,
	seanpaul@chromium.org, rrangel@chromium.org,
	dan.carpenter@oracle.com
Cc: jeffrey.lin@rad-ic.com, KP.li@rad-ic.com,
	jeffrey.lin@raydium.corp-partner.google.com,
	calvin.tseng@rad-ic.com, simba.hsu@rad-ic.com,
	linux-kernel@vger.kernel.org, linux-input@vger.kernel.org
Subject: [PATCH] Input: raydium_ts_i2c: Do not send zero length
Date: Tue, 15 Dec 2020 11:21:06 +0800	[thread overview]
Message-ID: <1608002466-9263-1-git-send-email-jeffrey.lin@raydium.corp-partner.google.com> (raw)

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


             reply	other threads:[~2020-12-15  3:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-15  3:21 jeffrey.lin [this message]
2020-12-15  5:48 ` [PATCH] Input: raydium_ts_i2c: Do not send zero length Dmitry Torokhov
     [not found]   ` <CAGdSJX2esa41ypqhGGVSJn+Yqxz8gTyz4HYmfB4WfVDEJLgVYw@mail.gmail.com>
2020-12-15  6:27     ` Dmitry Torokhov
2020-12-15 11:20 jeffrey.lin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1608002466-9263-1-git-send-email-jeffrey.lin@raydium.corp-partner.google.com \
    --to=jeffrey.lin@raydium.corp-partner.google.com \
    --cc=KP.li@rad-ic.com \
    --cc=calvin.tseng@rad-ic.com \
    --cc=dan.carpenter@oracle.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=furquan@google.com \
    --cc=jeffrey.lin@rad-ic.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rrangel@chromium.org \
    --cc=seanpaul@chromium.org \
    --cc=simba.hsu@rad-ic.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).