diff mbox series

driver: input: touchscreen: modify Raydium i2c touchscreen driver

Message ID 20210415085829.1419147-1-simba.hsu@raydium.corp-partner.google.com (mailing list archive)
State Superseded
Headers show
Series driver: input: touchscreen: modify Raydium i2c touchscreen driver | expand

Commit Message

simba.hsu April 15, 2021, 8:58 a.m. UTC
This path makes auto-update available when IC's status is
Recovery mode.

Signed-off-by: simba.hsu@raydium.corp-partner.google.com
Change-Id: I5ae54896a201b949eba7514500a7e75574f5726b
---
 drivers/input/touchscreen/raydium_i2c_ts.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Raul Rangel April 15, 2021, 4:05 p.m. UTC | #1
On Thu, Apr 15, 2021 at 2:58 AM simba.hsu
<simba.hsu@raydium.corp-partner.google.com> wrote:
>
> This path makes auto-update available when IC's status is
> Recovery mode.
>
> Signed-off-by: simba.hsu@raydium.corp-partner.google.com
> Change-Id: I5ae54896a201b949eba7514500a7e75574f5726b
> ---
>  drivers/input/touchscreen/raydium_i2c_ts.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/input/touchscreen/raydium_i2c_ts.c b/drivers/input/touchscreen/raydium_i2c_ts.c
> index 444479ef699e..a97403c55f75 100644
> --- a/drivers/input/touchscreen/raydium_i2c_ts.c
> +++ b/drivers/input/touchscreen/raydium_i2c_ts.c
> @@ -298,6 +298,7 @@ static int raydium_i2c_query_ts_BL_info(struct raydium_data *ts)
>                                          0x10, 0xc0, 0x01, 0x00, 0x04, 0x00};
>         int error;
>         u8 rbuf[5] = {0, 0, 0, 0, 0};
> +       u32 tmpdata = 0;
>
>         error = raydium_i2c_send(client,
>                                  RM_CMD_BOOT_WRT, get_hwid, sizeof(get_hwid));
> @@ -315,7 +316,8 @@ static int raydium_i2c_query_ts_BL_info(struct raydium_data *ts)
>         error = raydium_i2c_read(client,
>                                  RM_CMD_BOOT_CHK, rbuf, sizeof(rbuf));
>         if (!error) {
> -               ts->info.hw_ver = cpu_to_le32(rbuf[1]<<24|rbuf[2]<<16|rbuf[3]<<8|rbuf[4]);
> +               tmpdata = (rbuf[1]<<24|rbuf[2]<<16|rbuf[3]<<8|rbuf[4]);
Can you use be32_to_cpup instead?

> +               ts->info.hw_ver = cpu_to_le32(tmpdata);
>                 dev_err(&client->dev, "HWID %08X\n", ts->info.hw_ver);
>         } else {
>                 ts->info.hw_ver = cpu_to_le32(0xffffffffUL);
> --
> 2.25.1
>
Dmitry Torokhov April 15, 2021, 7:17 p.m. UTC | #2
HI,

On Thu, Apr 15, 2021 at 04:58:29PM +0800, simba.hsu wrote:
> This path makes auto-update available when IC's status is
> Recovery mode.

Could you please explain in more detail what the issue is. Also please
improve the patch subject, as "modify Raydium i2c touchscreen driver"
does not really convey the substance of the patch.

Also, the patch does not apply to my tree, was it based on some other
tree?

> 
> Signed-off-by: simba.hsu@raydium.corp-partner.google.com

Please use your Raydium email for signoff.

> Change-Id: I5ae54896a201b949eba7514500a7e75574f5726b

No need to send change-id tags, they are not used in mainline kernel.

> ---
>  drivers/input/touchscreen/raydium_i2c_ts.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/input/touchscreen/raydium_i2c_ts.c b/drivers/input/touchscreen/raydium_i2c_ts.c
> index 444479ef699e..a97403c55f75 100644
> --- a/drivers/input/touchscreen/raydium_i2c_ts.c
> +++ b/drivers/input/touchscreen/raydium_i2c_ts.c
> @@ -298,6 +298,7 @@ static int raydium_i2c_query_ts_BL_info(struct raydium_data *ts)
>  					 0x10, 0xc0, 0x01, 0x00, 0x04, 0x00};
>  	int error;
>  	u8 rbuf[5] = {0, 0, 0, 0, 0};
> +	u32 tmpdata = 0;
>  
>  	error = raydium_i2c_send(client,
>  				 RM_CMD_BOOT_WRT, get_hwid, sizeof(get_hwid));
> @@ -315,7 +316,8 @@ static int raydium_i2c_query_ts_BL_info(struct raydium_data *ts)
>  	error = raydium_i2c_read(client,
>  				 RM_CMD_BOOT_CHK, rbuf, sizeof(rbuf));
>  	if (!error) {
> -		ts->info.hw_ver = cpu_to_le32(rbuf[1]<<24|rbuf[2]<<16|rbuf[3]<<8|rbuf[4]);
> +		tmpdata = (rbuf[1]<<24|rbuf[2]<<16|rbuf[3]<<8|rbuf[4]);
> +		ts->info.hw_ver = cpu_to_le32(tmpdata);

On the face of it I can't see why the code would behave differently,
nut then there is no raydium_i2c_query_ts_BL_info() in the copy of the
driver I have here.

>  		dev_err(&client->dev, "HWID %08X\n", ts->info.hw_ver);
>  	} else {
>  		ts->info.hw_ver = cpu_to_le32(0xffffffffUL);
> -- 
> 2.25.1
> 

Thanks.
diff mbox series

Patch

diff --git a/drivers/input/touchscreen/raydium_i2c_ts.c b/drivers/input/touchscreen/raydium_i2c_ts.c
index 444479ef699e..a97403c55f75 100644
--- a/drivers/input/touchscreen/raydium_i2c_ts.c
+++ b/drivers/input/touchscreen/raydium_i2c_ts.c
@@ -298,6 +298,7 @@  static int raydium_i2c_query_ts_BL_info(struct raydium_data *ts)
 					 0x10, 0xc0, 0x01, 0x00, 0x04, 0x00};
 	int error;
 	u8 rbuf[5] = {0, 0, 0, 0, 0};
+	u32 tmpdata = 0;
 
 	error = raydium_i2c_send(client,
 				 RM_CMD_BOOT_WRT, get_hwid, sizeof(get_hwid));
@@ -315,7 +316,8 @@  static int raydium_i2c_query_ts_BL_info(struct raydium_data *ts)
 	error = raydium_i2c_read(client,
 				 RM_CMD_BOOT_CHK, rbuf, sizeof(rbuf));
 	if (!error) {
-		ts->info.hw_ver = cpu_to_le32(rbuf[1]<<24|rbuf[2]<<16|rbuf[3]<<8|rbuf[4]);
+		tmpdata = (rbuf[1]<<24|rbuf[2]<<16|rbuf[3]<<8|rbuf[4]);
+		ts->info.hw_ver = cpu_to_le32(tmpdata);
 		dev_err(&client->dev, "HWID %08X\n", ts->info.hw_ver);
 	} else {
 		ts->info.hw_ver = cpu_to_le32(0xffffffffUL);