All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Input: elants_i2c - get product id on recovery mode for FW update
@ 2016-08-24  8:44 Johnny Chuang
  2016-08-25  8:31   ` kbuild test robot
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Johnny Chuang @ 2016-08-24  8:44 UTC (permalink / raw)
  To: Dmitry Torokhov, Daniel Kurtz, Jennifer Tsai, linux-kernel, linux-input
  Cc: James Chen, Paul Liang, Jeff Chuang, Johnny Chuang

This CL takes the responsibility for getting product/hardware id
on recovery mode.
It will fix firmware update script could not find correspond firmware
file name on recovery mode.
BTW, firmware must need to support reading product/hardware id
on boot code.

Signed-off-by: Johnny Chuang <johnny.chuang@emc.com.tw>
---
 drivers/input/touchscreen/elants_i2c.c | 30 +++++++++++++++++++-----------
 1 file changed, 19 insertions(+), 11 deletions(-)

diff --git a/drivers/input/touchscreen/elants_i2c.c b/drivers/input/touchscreen/elants_i2c.c
index ac09855..24662c3 100644
--- a/drivers/input/touchscreen/elants_i2c.c
+++ b/drivers/input/touchscreen/elants_i2c.c
@@ -298,7 +298,7 @@ static u16 elants_i2c_parse_version(u8 *buf)
 	return get_unaligned_be32(buf) >> 4;
 }
 
-static int elants_i2c_query_fw_id(struct elants_data *ts)
+static int elants_i2c_query_hw_version(struct elants_data *ts)
 {
 	struct i2c_client *client = ts->client;
 	int error, retry_cnt;
@@ -318,8 +318,13 @@ static int elants_i2c_query_fw_id(struct elants_data *ts)
 			error, (int)sizeof(resp), resp);
 	}
 
-	dev_err(&client->dev,
-		"Failed to read fw id or fw id is invalid\n");
+	if (error) {
+		dev_err(&clent->dev,
+			"Failed to read fw id: %d\n", error);
+		return error;
+	}
+
+	dev_err(&clent->dev, "Invalid fw id: %#04x\n", ts->hw_version);
 
 	return -EINVAL;
 }
@@ -508,7 +513,7 @@ static int elants_i2c_fastboot(struct i2c_client *client)
 static int elants_i2c_initialize(struct elants_data *ts)
 {
 	struct i2c_client *client = ts->client;
-	int error, retry_cnt;
+	int error, error2, retry_cnt;
 	const u8 hello_packet[] = { 0x55, 0x55, 0x55, 0x55 };
 	const u8 recov_packet[] = { 0x55, 0x55, 0x80, 0x80 };
 	u8 buf[HEADER_SIZE];
@@ -553,18 +558,21 @@ static int elants_i2c_initialize(struct elants_data *ts)
 		}
 	}
 
+	/* hw version is available even if device in recovery state */
+	error2 = elants_i2c_query_hw_version(ts);
 	if (!error)
-		error = elants_i2c_query_fw_id(ts);
+		error = error2;
 	if (!error)
 		error = elants_i2c_query_fw_version(ts);
+	if (!error)
+		error = elants_i2c_query_test_version(ts);
+	if (!error)
+		error = elants_i2c_query_bc_version(ts);
+	if (!error)
+		error = elants_i2c_query_ts_info(ts);
 
-	if (error) {
+	if (error)
 		ts->iap_mode = ELAN_IAP_RECOVERY;
-	} else {
-		elants_i2c_query_test_version(ts);
-		elants_i2c_query_bc_version(ts);
-		elants_i2c_query_ts_info(ts);
-	}
 
 	return 0;
 }
-- 
1.8.3.2

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

* Re: [PATCH] Input: elants_i2c - get product id on recovery mode for FW update
  2016-08-24  8:44 [PATCH] Input: elants_i2c - get product id on recovery mode for FW update Johnny Chuang
@ 2016-08-25  8:31   ` kbuild test robot
  2016-08-25 10:11 ` Johnny Chuang
  2016-09-23  8:01 ` [PATCH v3] " Johnny Chuang
  2 siblings, 0 replies; 10+ messages in thread
From: kbuild test robot @ 2016-08-25  8:31 UTC (permalink / raw)
  To: Johnny Chuang
  Cc: kbuild-all, Dmitry Torokhov, Daniel Kurtz, Jennifer Tsai,
	linux-kernel, linux-input, James Chen, Paul Liang, Jeff Chuang,
	Johnny Chuang

[-- Attachment #1: Type: text/plain, Size: 1745 bytes --]

Hi Johnny,

[auto build test ERROR on input/next]
[also build test ERROR on v4.8-rc3 next-20160824]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
[Suggest to use git(>=2.9.0) format-patch --base=<commit> (or --base=auto for convenience) to record what (public, well-known) commit your patch series was built on]
[Check https://git-scm.com/docs/git-format-patch for more information]

url:    https://github.com/0day-ci/linux/commits/Johnny-Chuang/Input-elants_i2c-get-product-id-on-recovery-mode-for-FW-update/20160824-170047
base:   https://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git next
config: i386-allmodconfig (attached as .config)
compiler: gcc-6 (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All errors (new ones prefixed by >>):

   drivers/input/touchscreen/elants_i2c.c: In function 'elants_i2c_query_hw_version':
>> drivers/input/touchscreen/elants_i2c.c:322:12: error: 'clent' undeclared (first use in this function)
      dev_err(&clent->dev,
               ^~~~~
   drivers/input/touchscreen/elants_i2c.c:322:12: note: each undeclared identifier is reported only once for each function it appears in

vim +/clent +322 drivers/input/touchscreen/elants_i2c.c

   316	
   317			dev_dbg(&client->dev, "read fw id error=%d, buf=%*phC\n",
   318				error, (int)sizeof(resp), resp);
   319		}
   320	
   321		if (error) {
 > 322			dev_err(&clent->dev,
   323				"Failed to read fw id: %d\n", error);
   324			return error;
   325		}

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 54574 bytes --]

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

* Re: [PATCH] Input: elants_i2c - get product id on recovery mode for FW update
@ 2016-08-25  8:31   ` kbuild test robot
  0 siblings, 0 replies; 10+ messages in thread
From: kbuild test robot @ 2016-08-25  8:31 UTC (permalink / raw)
  Cc: kbuild-all, Dmitry Torokhov, Daniel Kurtz, Jennifer Tsai,
	linux-kernel, linux-input, James Chen, Paul Liang, Jeff Chuang,
	Johnny Chuang

[-- Attachment #1: Type: text/plain, Size: 1745 bytes --]

Hi Johnny,

[auto build test ERROR on input/next]
[also build test ERROR on v4.8-rc3 next-20160824]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
[Suggest to use git(>=2.9.0) format-patch --base=<commit> (or --base=auto for convenience) to record what (public, well-known) commit your patch series was built on]
[Check https://git-scm.com/docs/git-format-patch for more information]

url:    https://github.com/0day-ci/linux/commits/Johnny-Chuang/Input-elants_i2c-get-product-id-on-recovery-mode-for-FW-update/20160824-170047
base:   https://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git next
config: i386-allmodconfig (attached as .config)
compiler: gcc-6 (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All errors (new ones prefixed by >>):

   drivers/input/touchscreen/elants_i2c.c: In function 'elants_i2c_query_hw_version':
>> drivers/input/touchscreen/elants_i2c.c:322:12: error: 'clent' undeclared (first use in this function)
      dev_err(&clent->dev,
               ^~~~~
   drivers/input/touchscreen/elants_i2c.c:322:12: note: each undeclared identifier is reported only once for each function it appears in

vim +/clent +322 drivers/input/touchscreen/elants_i2c.c

   316	
   317			dev_dbg(&client->dev, "read fw id error=%d, buf=%*phC\n",
   318				error, (int)sizeof(resp), resp);
   319		}
   320	
   321		if (error) {
 > 322			dev_err(&clent->dev,
   323				"Failed to read fw id: %d\n", error);
   324			return error;
   325		}

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 54574 bytes --]

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

* [PATCH] Input: elants_i2c - get product id on recovery mode for FW update
  2016-08-24  8:44 [PATCH] Input: elants_i2c - get product id on recovery mode for FW update Johnny Chuang
  2016-08-25  8:31   ` kbuild test robot
@ 2016-08-25 10:11 ` Johnny Chuang
  2016-08-25 16:40   ` Dmitry Torokhov
  2016-09-23  8:01 ` [PATCH v3] " Johnny Chuang
  2 siblings, 1 reply; 10+ messages in thread
From: Johnny Chuang @ 2016-08-25 10:11 UTC (permalink / raw)
  To: Dmitry Torokhov, Daniel Kurtz, Jennifer Tsai, linux-kernel, linux-input
  Cc: James Chen, Paul Liang, Jeff Chuang, Johnny Chuang

This CL takes the responsibility for getting product/hardware id
on recovery mode.
It will fix firmware update script could not find correspond firmware
file name on recovery mode.
BTW, firmware must need to support reading product/hardware id
on boot code.

Signed-off-by: Johnny Chuang <johnny.chuang@emc.com.tw>
---
 drivers/input/touchscreen/elants_i2c.c | 30 +++++++++++++++++++-----------
 1 file changed, 19 insertions(+), 11 deletions(-)

diff --git a/drivers/input/touchscreen/elants_i2c.c b/drivers/input/touchscreen/elants_i2c.c
index ac09855..dc9f608 100644
--- a/drivers/input/touchscreen/elants_i2c.c
+++ b/drivers/input/touchscreen/elants_i2c.c
@@ -298,7 +298,7 @@ static u16 elants_i2c_parse_version(u8 *buf)
 	return get_unaligned_be32(buf) >> 4;
 }
 
-static int elants_i2c_query_fw_id(struct elants_data *ts)
+static int elants_i2c_query_hw_version(struct elants_data *ts)
 {
 	struct i2c_client *client = ts->client;
 	int error, retry_cnt;
@@ -318,8 +318,13 @@ static int elants_i2c_query_fw_id(struct elants_data *ts)
 			error, (int)sizeof(resp), resp);
 	}
 
-	dev_err(&client->dev,
-		"Failed to read fw id or fw id is invalid\n");
+	if (error) {
+		dev_err(&client->dev,
+			"Failed to read fw id: %d\n", error);
+		return error;
+	}
+
+	dev_err(&client->dev, "Invalid fw id: %#04x\n", ts->hw_version);
 
 	return -EINVAL;
 }
@@ -508,7 +513,7 @@ static int elants_i2c_fastboot(struct i2c_client *client)
 static int elants_i2c_initialize(struct elants_data *ts)
 {
 	struct i2c_client *client = ts->client;
-	int error, retry_cnt;
+	int error, error2, retry_cnt;
 	const u8 hello_packet[] = { 0x55, 0x55, 0x55, 0x55 };
 	const u8 recov_packet[] = { 0x55, 0x55, 0x80, 0x80 };
 	u8 buf[HEADER_SIZE];
@@ -553,18 +558,21 @@ static int elants_i2c_initialize(struct elants_data *ts)
 		}
 	}
 
+	/* hw version is available even if device in recovery state */
+	error2 = elants_i2c_query_hw_version(ts);
 	if (!error)
-		error = elants_i2c_query_fw_id(ts);
+		error = error2;
 	if (!error)
 		error = elants_i2c_query_fw_version(ts);
+	if (!error)
+		error = elants_i2c_query_test_version(ts);
+	if (!error)
+		error = elants_i2c_query_bc_version(ts);
+	if (!error)
+		error = elants_i2c_query_ts_info(ts);
 
-	if (error) {
+	if (error)
 		ts->iap_mode = ELAN_IAP_RECOVERY;
-	} else {
-		elants_i2c_query_test_version(ts);
-		elants_i2c_query_bc_version(ts);
-		elants_i2c_query_ts_info(ts);
-	}
 
 	return 0;
 }
-- 
1.8.3.2

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

* Re: [PATCH] Input: elants_i2c - get product id on recovery mode for FW update
  2016-08-25 10:11 ` Johnny Chuang
@ 2016-08-25 16:40   ` Dmitry Torokhov
  0 siblings, 0 replies; 10+ messages in thread
From: Dmitry Torokhov @ 2016-08-25 16:40 UTC (permalink / raw)
  To: Johnny Chuang
  Cc: Daniel Kurtz, Jennifer Tsai, linux-kernel, linux-input,
	James Chen, Paul Liang, Jeff Chuang

On Thu, Aug 25, 2016 at 06:11:56PM +0800, Johnny Chuang wrote:
> This CL takes the responsibility for getting product/hardware id
> on recovery mode.
> It will fix firmware update script could not find correspond firmware
> file name on recovery mode.
> BTW, firmware must need to support reading product/hardware id
> on boot code.
> 
> Signed-off-by: Johnny Chuang <johnny.chuang@emc.com.tw>

Applied, thank you.

> ---
>  drivers/input/touchscreen/elants_i2c.c | 30 +++++++++++++++++++-----------
>  1 file changed, 19 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/input/touchscreen/elants_i2c.c b/drivers/input/touchscreen/elants_i2c.c
> index ac09855..dc9f608 100644
> --- a/drivers/input/touchscreen/elants_i2c.c
> +++ b/drivers/input/touchscreen/elants_i2c.c
> @@ -298,7 +298,7 @@ static u16 elants_i2c_parse_version(u8 *buf)
>  	return get_unaligned_be32(buf) >> 4;
>  }
>  
> -static int elants_i2c_query_fw_id(struct elants_data *ts)
> +static int elants_i2c_query_hw_version(struct elants_data *ts)
>  {
>  	struct i2c_client *client = ts->client;
>  	int error, retry_cnt;
> @@ -318,8 +318,13 @@ static int elants_i2c_query_fw_id(struct elants_data *ts)
>  			error, (int)sizeof(resp), resp);
>  	}
>  
> -	dev_err(&client->dev,
> -		"Failed to read fw id or fw id is invalid\n");
> +	if (error) {
> +		dev_err(&client->dev,
> +			"Failed to read fw id: %d\n", error);
> +		return error;
> +	}
> +
> +	dev_err(&client->dev, "Invalid fw id: %#04x\n", ts->hw_version);
>  
>  	return -EINVAL;
>  }
> @@ -508,7 +513,7 @@ static int elants_i2c_fastboot(struct i2c_client *client)
>  static int elants_i2c_initialize(struct elants_data *ts)
>  {
>  	struct i2c_client *client = ts->client;
> -	int error, retry_cnt;
> +	int error, error2, retry_cnt;
>  	const u8 hello_packet[] = { 0x55, 0x55, 0x55, 0x55 };
>  	const u8 recov_packet[] = { 0x55, 0x55, 0x80, 0x80 };
>  	u8 buf[HEADER_SIZE];
> @@ -553,18 +558,21 @@ static int elants_i2c_initialize(struct elants_data *ts)
>  		}
>  	}
>  
> +	/* hw version is available even if device in recovery state */
> +	error2 = elants_i2c_query_hw_version(ts);
>  	if (!error)
> -		error = elants_i2c_query_fw_id(ts);
> +		error = error2;
>  	if (!error)
>  		error = elants_i2c_query_fw_version(ts);
> +	if (!error)
> +		error = elants_i2c_query_test_version(ts);
> +	if (!error)
> +		error = elants_i2c_query_bc_version(ts);
> +	if (!error)
> +		error = elants_i2c_query_ts_info(ts);
>  
> -	if (error) {
> +	if (error)
>  		ts->iap_mode = ELAN_IAP_RECOVERY;
> -	} else {
> -		elants_i2c_query_test_version(ts);
> -		elants_i2c_query_bc_version(ts);
> -		elants_i2c_query_ts_info(ts);
> -	}
>  
>  	return 0;
>  }
> -- 
> 1.8.3.2
> 

-- 
Dmitry

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

* [PATCH v3] Input: elants_i2c - get product id on recovery mode for FW update
  2016-08-24  8:44 [PATCH] Input: elants_i2c - get product id on recovery mode for FW update Johnny Chuang
  2016-08-25  8:31   ` kbuild test robot
  2016-08-25 10:11 ` Johnny Chuang
@ 2016-09-23  8:01 ` Johnny Chuang
  2016-09-23 21:30   ` Dmitry Torokhov
  2 siblings, 1 reply; 10+ messages in thread
From: Johnny Chuang @ 2016-09-23  8:01 UTC (permalink / raw)
  To: Dmitry Torokhov, Daniel Kurtz, Jennifer Tsai, linux-kernel, linux-input
  Cc: James Chen, Paul Liang, Jeff Chuang, Agnes Cheng, Johnny Chuang

This CL takes the responsibility for getting product/hardware id
on recovery mode.
It will fix firmware update script could not find correspond firmware
file name on recovery mode.
BTW, firmware must need to support reading product/hardware id
on boot code.

Signed-off-by: Johnny Chuang <johnny.chuang@emc.com.tw>
---
 drivers/input/touchscreen/elants_i2c.c | 31 ++++++++++++++++++++-----------
 1 file changed, 20 insertions(+), 11 deletions(-)

diff --git a/drivers/input/touchscreen/elants_i2c.c b/drivers/input/touchscreen/elants_i2c.c
index ac09855..02aec28 100644
--- a/drivers/input/touchscreen/elants_i2c.c
+++ b/drivers/input/touchscreen/elants_i2c.c
@@ -298,7 +298,7 @@ static u16 elants_i2c_parse_version(u8 *buf)
 	return get_unaligned_be32(buf) >> 4;
 }
 
-static int elants_i2c_query_fw_id(struct elants_data *ts)
+static int elants_i2c_query_hw_version(struct elants_data *ts)
 {
 	struct i2c_client *client = ts->client;
 	int error, retry_cnt;
@@ -318,8 +318,13 @@ static int elants_i2c_query_fw_id(struct elants_data *ts)
 			error, (int)sizeof(resp), resp);
 	}
 
-	dev_err(&client->dev,
-		"Failed to read fw id or fw id is invalid\n");
+	if (error) {
+		dev_err(&client->dev,
+			"Failed to read fw id: %d\n", error);
+		return error;
+	}
+
+	dev_err(&client->dev, "Invalid fw id: %#04x\n", ts->hw_version);
 
 	return -EINVAL;
 }
@@ -508,7 +513,7 @@ static int elants_i2c_fastboot(struct i2c_client *client)
 static int elants_i2c_initialize(struct elants_data *ts)
 {
 	struct i2c_client *client = ts->client;
-	int error, retry_cnt;
+	int error, error2, retry_cnt;
 	const u8 hello_packet[] = { 0x55, 0x55, 0x55, 0x55 };
 	const u8 recov_packet[] = { 0x55, 0x55, 0x80, 0x80 };
 	u8 buf[HEADER_SIZE];
@@ -553,18 +558,22 @@ static int elants_i2c_initialize(struct elants_data *ts)
 		}
 	}
 
+	/* hw version is available even if device in recovery state */
+	error2 = elants_i2c_query_hw_version(ts);
 	if (!error)
-		error = elants_i2c_query_fw_id(ts);
+		error = error2;
+
 	if (!error)
 		error = elants_i2c_query_fw_version(ts);
+	if (!error)
+		error = elants_i2c_query_test_version(ts);
+	if (!error)
+		error = elants_i2c_query_bc_version(ts);
+	if (!error)
+		error = elants_i2c_query_ts_info(ts);
 
-	if (error) {
+	if (error)
 		ts->iap_mode = ELAN_IAP_RECOVERY;
-	} else {
-		elants_i2c_query_test_version(ts);
-		elants_i2c_query_bc_version(ts);
-		elants_i2c_query_ts_info(ts);
-	}
 
 	return 0;
 }
-- 
1.8.3.2

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

* Re: [PATCH v3] Input: elants_i2c - get product id on recovery mode for FW update
  2016-09-23  8:01 ` [PATCH v3] " Johnny Chuang
@ 2016-09-23 21:30   ` Dmitry Torokhov
  2016-09-26  2:30       ` Johnny.Chuang
  0 siblings, 1 reply; 10+ messages in thread
From: Dmitry Torokhov @ 2016-09-23 21:30 UTC (permalink / raw)
  To: Johnny Chuang
  Cc: Daniel Kurtz, Jennifer Tsai, linux-kernel, linux-input,
	James Chen, Paul Liang, Jeff Chuang, Agnes Cheng

On Fri, Sep 23, 2016 at 04:01:17PM +0800, Johnny Chuang wrote:
> This CL takes the responsibility for getting product/hardware id
> on recovery mode.
> It will fix firmware update script could not find correspond firmware
> file name on recovery mode.
> BTW, firmware must need to support reading product/hardware id
> on boot code.
> 
> Signed-off-by: Johnny Chuang <johnny.chuang@emc.com.tw>

This appears to be exactly the same as to what I already have in my
"next" branch...

> ---
>  drivers/input/touchscreen/elants_i2c.c | 31 ++++++++++++++++++++-----------
>  1 file changed, 20 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/input/touchscreen/elants_i2c.c b/drivers/input/touchscreen/elants_i2c.c
> index ac09855..02aec28 100644
> --- a/drivers/input/touchscreen/elants_i2c.c
> +++ b/drivers/input/touchscreen/elants_i2c.c
> @@ -298,7 +298,7 @@ static u16 elants_i2c_parse_version(u8 *buf)
>  	return get_unaligned_be32(buf) >> 4;
>  }
>  
> -static int elants_i2c_query_fw_id(struct elants_data *ts)
> +static int elants_i2c_query_hw_version(struct elants_data *ts)
>  {
>  	struct i2c_client *client = ts->client;
>  	int error, retry_cnt;
> @@ -318,8 +318,13 @@ static int elants_i2c_query_fw_id(struct elants_data *ts)
>  			error, (int)sizeof(resp), resp);
>  	}
>  
> -	dev_err(&client->dev,
> -		"Failed to read fw id or fw id is invalid\n");
> +	if (error) {
> +		dev_err(&client->dev,
> +			"Failed to read fw id: %d\n", error);
> +		return error;
> +	}
> +
> +	dev_err(&client->dev, "Invalid fw id: %#04x\n", ts->hw_version);
>  
>  	return -EINVAL;
>  }
> @@ -508,7 +513,7 @@ static int elants_i2c_fastboot(struct i2c_client *client)
>  static int elants_i2c_initialize(struct elants_data *ts)
>  {
>  	struct i2c_client *client = ts->client;
> -	int error, retry_cnt;
> +	int error, error2, retry_cnt;
>  	const u8 hello_packet[] = { 0x55, 0x55, 0x55, 0x55 };
>  	const u8 recov_packet[] = { 0x55, 0x55, 0x80, 0x80 };
>  	u8 buf[HEADER_SIZE];
> @@ -553,18 +558,22 @@ static int elants_i2c_initialize(struct elants_data *ts)
>  		}
>  	}
>  
> +	/* hw version is available even if device in recovery state */
> +	error2 = elants_i2c_query_hw_version(ts);
>  	if (!error)
> -		error = elants_i2c_query_fw_id(ts);
> +		error = error2;
> +
>  	if (!error)
>  		error = elants_i2c_query_fw_version(ts);
> +	if (!error)
> +		error = elants_i2c_query_test_version(ts);
> +	if (!error)
> +		error = elants_i2c_query_bc_version(ts);
> +	if (!error)
> +		error = elants_i2c_query_ts_info(ts);
>  
> -	if (error) {
> +	if (error)
>  		ts->iap_mode = ELAN_IAP_RECOVERY;
> -	} else {
> -		elants_i2c_query_test_version(ts);
> -		elants_i2c_query_bc_version(ts);
> -		elants_i2c_query_ts_info(ts);
> -	}
>  
>  	return 0;
>  }
> -- 
> 1.8.3.2
> 

-- 
Dmitry

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

* RE: [PATCH v3] Input: elants_i2c - get product id on recovery mode for FW update
  2016-09-23 21:30   ` Dmitry Torokhov
@ 2016-09-26  2:30       ` Johnny.Chuang
  0 siblings, 0 replies; 10+ messages in thread
From: Johnny.Chuang @ 2016-09-26  2:30 UTC (permalink / raw)
  To: 'Dmitry Torokhov'
  Cc: 'Daniel Kurtz', 'Jennifer Tsai',
	linux-kernel, linux-input, 'James Chen',
	'Paul Liang', 'Jeff Chuang',
	'Agnes Cheng'

There is only one different which is adding a new empty line for coding
style.

>  	if (!error)
> -		error = elants_i2c_query_fw_id(ts);
> +		error = error2;
> +
>  	if (!error)
>  		error = elants_i2c_query_fw_version(ts);

-----Original Message-----
From: Dmitry Torokhov [mailto:dmitry.torokhov@gmail.com] 
Sent: Saturday, September 24, 2016 5:31 AM
To: Johnny Chuang
Cc: Daniel Kurtz; Jennifer Tsai; linux-kernel@vger.kernel.org;
linux-input@vger.kernel.org; James Chen; Paul Liang; Jeff Chuang; Agnes
Cheng
Subject: Re: [PATCH v3] Input: elants_i2c - get product id on recovery mode
for FW update

On Fri, Sep 23, 2016 at 04:01:17PM +0800, Johnny Chuang wrote:
> This CL takes the responsibility for getting product/hardware id on 
> recovery mode.
> It will fix firmware update script could not find correspond firmware 
> file name on recovery mode.
> BTW, firmware must need to support reading product/hardware id on boot 
> code.
> 
> Signed-off-by: Johnny Chuang <johnny.chuang@emc.com.tw>

This appears to be exactly the same as to what I already have in my "next"
branch...

> ---
>  drivers/input/touchscreen/elants_i2c.c | 31 
> ++++++++++++++++++++-----------
>  1 file changed, 20 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/input/touchscreen/elants_i2c.c 
> b/drivers/input/touchscreen/elants_i2c.c
> index ac09855..02aec28 100644
> --- a/drivers/input/touchscreen/elants_i2c.c
> +++ b/drivers/input/touchscreen/elants_i2c.c
> @@ -298,7 +298,7 @@ static u16 elants_i2c_parse_version(u8 *buf)
>  	return get_unaligned_be32(buf) >> 4;  }
>  
> -static int elants_i2c_query_fw_id(struct elants_data *ts)
> +static int elants_i2c_query_hw_version(struct elants_data *ts)
>  {
>  	struct i2c_client *client = ts->client;
>  	int error, retry_cnt;
> @@ -318,8 +318,13 @@ static int elants_i2c_query_fw_id(struct elants_data
*ts)
>  			error, (int)sizeof(resp), resp);
>  	}
>  
> -	dev_err(&client->dev,
> -		"Failed to read fw id or fw id is invalid\n");
> +	if (error) {
> +		dev_err(&client->dev,
> +			"Failed to read fw id: %d\n", error);
> +		return error;
> +	}
> +
> +	dev_err(&client->dev, "Invalid fw id: %#04x\n", ts->hw_version);
>  
>  	return -EINVAL;
>  }
> @@ -508,7 +513,7 @@ static int elants_i2c_fastboot(struct i2c_client 
> *client)  static int elants_i2c_initialize(struct elants_data *ts)  {
>  	struct i2c_client *client = ts->client;
> -	int error, retry_cnt;
> +	int error, error2, retry_cnt;
>  	const u8 hello_packet[] = { 0x55, 0x55, 0x55, 0x55 };
>  	const u8 recov_packet[] = { 0x55, 0x55, 0x80, 0x80 };
>  	u8 buf[HEADER_SIZE];
> @@ -553,18 +558,22 @@ static int elants_i2c_initialize(struct elants_data
*ts)
>  		}
>  	}
>  
> +	/* hw version is available even if device in recovery state */
> +	error2 = elants_i2c_query_hw_version(ts);
>  	if (!error)
> -		error = elants_i2c_query_fw_id(ts);
> +		error = error2;
> +
>  	if (!error)
>  		error = elants_i2c_query_fw_version(ts);
> +	if (!error)
> +		error = elants_i2c_query_test_version(ts);
> +	if (!error)
> +		error = elants_i2c_query_bc_version(ts);
> +	if (!error)
> +		error = elants_i2c_query_ts_info(ts);
>  
> -	if (error) {
> +	if (error)
>  		ts->iap_mode = ELAN_IAP_RECOVERY;
> -	} else {
> -		elants_i2c_query_test_version(ts);
> -		elants_i2c_query_bc_version(ts);
> -		elants_i2c_query_ts_info(ts);
> -	}
>  
>  	return 0;
>  }
> --
> 1.8.3.2
> 

-- 
Dmitry

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

* RE: [PATCH v3] Input: elants_i2c - get product id on recovery mode for FW update
@ 2016-09-26  2:30       ` Johnny.Chuang
  0 siblings, 0 replies; 10+ messages in thread
From: Johnny.Chuang @ 2016-09-26  2:30 UTC (permalink / raw)
  To: 'Dmitry Torokhov'
  Cc: 'Daniel Kurtz', 'Jennifer Tsai',
	linux-kernel, linux-input, 'James Chen',
	'Paul Liang', 'Jeff Chuang',
	'Agnes Cheng'

There is only one different which is adding a new empty line for coding
style.

>  	if (!error)
> -		error = elants_i2c_query_fw_id(ts);
> +		error = error2;
> +
>  	if (!error)
>  		error = elants_i2c_query_fw_version(ts);

-----Original Message-----
From: Dmitry Torokhov [mailto:dmitry.torokhov@gmail.com] 
Sent: Saturday, September 24, 2016 5:31 AM
To: Johnny Chuang
Cc: Daniel Kurtz; Jennifer Tsai; linux-kernel@vger.kernel.org;
linux-input@vger.kernel.org; James Chen; Paul Liang; Jeff Chuang; Agnes
Cheng
Subject: Re: [PATCH v3] Input: elants_i2c - get product id on recovery mode
for FW update

On Fri, Sep 23, 2016 at 04:01:17PM +0800, Johnny Chuang wrote:
> This CL takes the responsibility for getting product/hardware id on 
> recovery mode.
> It will fix firmware update script could not find correspond firmware 
> file name on recovery mode.
> BTW, firmware must need to support reading product/hardware id on boot 
> code.
> 
> Signed-off-by: Johnny Chuang <johnny.chuang@emc.com.tw>

This appears to be exactly the same as to what I already have in my "next"
branch...

> ---
>  drivers/input/touchscreen/elants_i2c.c | 31 
> ++++++++++++++++++++-----------
>  1 file changed, 20 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/input/touchscreen/elants_i2c.c 
> b/drivers/input/touchscreen/elants_i2c.c
> index ac09855..02aec28 100644
> --- a/drivers/input/touchscreen/elants_i2c.c
> +++ b/drivers/input/touchscreen/elants_i2c.c
> @@ -298,7 +298,7 @@ static u16 elants_i2c_parse_version(u8 *buf)
>  	return get_unaligned_be32(buf) >> 4;  }
>  
> -static int elants_i2c_query_fw_id(struct elants_data *ts)
> +static int elants_i2c_query_hw_version(struct elants_data *ts)
>  {
>  	struct i2c_client *client = ts->client;
>  	int error, retry_cnt;
> @@ -318,8 +318,13 @@ static int elants_i2c_query_fw_id(struct elants_data
*ts)
>  			error, (int)sizeof(resp), resp);
>  	}
>  
> -	dev_err(&client->dev,
> -		"Failed to read fw id or fw id is invalid\n");
> +	if (error) {
> +		dev_err(&client->dev,
> +			"Failed to read fw id: %d\n", error);
> +		return error;
> +	}
> +
> +	dev_err(&client->dev, "Invalid fw id: %#04x\n", ts->hw_version);
>  
>  	return -EINVAL;
>  }
> @@ -508,7 +513,7 @@ static int elants_i2c_fastboot(struct i2c_client 
> *client)  static int elants_i2c_initialize(struct elants_data *ts)  {
>  	struct i2c_client *client = ts->client;
> -	int error, retry_cnt;
> +	int error, error2, retry_cnt;
>  	const u8 hello_packet[] = { 0x55, 0x55, 0x55, 0x55 };
>  	const u8 recov_packet[] = { 0x55, 0x55, 0x80, 0x80 };
>  	u8 buf[HEADER_SIZE];
> @@ -553,18 +558,22 @@ static int elants_i2c_initialize(struct elants_data
*ts)
>  		}
>  	}
>  
> +	/* hw version is available even if device in recovery state */
> +	error2 = elants_i2c_query_hw_version(ts);
>  	if (!error)
> -		error = elants_i2c_query_fw_id(ts);
> +		error = error2;
> +
>  	if (!error)
>  		error = elants_i2c_query_fw_version(ts);
> +	if (!error)
> +		error = elants_i2c_query_test_version(ts);
> +	if (!error)
> +		error = elants_i2c_query_bc_version(ts);
> +	if (!error)
> +		error = elants_i2c_query_ts_info(ts);
>  
> -	if (error) {
> +	if (error)
>  		ts->iap_mode = ELAN_IAP_RECOVERY;
> -	} else {
> -		elants_i2c_query_test_version(ts);
> -		elants_i2c_query_bc_version(ts);
> -		elants_i2c_query_ts_info(ts);
> -	}
>  
>  	return 0;
>  }
> --
> 1.8.3.2
> 

-- 
Dmitry


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

* Re: [PATCH v3] Input: elants_i2c - get product id on recovery mode for FW update
  2016-09-26  2:30       ` Johnny.Chuang
  (?)
@ 2016-09-27  2:54       ` 'Dmitry Torokhov'
  -1 siblings, 0 replies; 10+ messages in thread
From: 'Dmitry Torokhov' @ 2016-09-27  2:54 UTC (permalink / raw)
  To: Johnny.Chuang
  Cc: 'Daniel Kurtz', 'Jennifer Tsai',
	linux-kernel, linux-input, 'James Chen',
	'Paul Liang', 'Jeff Chuang',
	'Agnes Cheng'

On Mon, Sep 26, 2016 at 10:30:56AM +0800, Johnny.Chuang wrote:
> There is only one different which is adding a new empty line for coding
> style.
> 
> >  	if (!error)
> > -		error = elants_i2c_query_fw_id(ts);
> > +		error = error2;
> > +
> >  	if (!error)
> >  		error = elants_i2c_query_fw_version(ts);

OK, since I already applied the other version I'll ignore this one as
the difference is not important.

Thanks.

> 
> -----Original Message-----
> From: Dmitry Torokhov [mailto:dmitry.torokhov@gmail.com] 
> Sent: Saturday, September 24, 2016 5:31 AM
> To: Johnny Chuang
> Cc: Daniel Kurtz; Jennifer Tsai; linux-kernel@vger.kernel.org;
> linux-input@vger.kernel.org; James Chen; Paul Liang; Jeff Chuang; Agnes
> Cheng
> Subject: Re: [PATCH v3] Input: elants_i2c - get product id on recovery mode
> for FW update
> 
> On Fri, Sep 23, 2016 at 04:01:17PM +0800, Johnny Chuang wrote:
> > This CL takes the responsibility for getting product/hardware id on 
> > recovery mode.
> > It will fix firmware update script could not find correspond firmware 
> > file name on recovery mode.
> > BTW, firmware must need to support reading product/hardware id on boot 
> > code.
> > 
> > Signed-off-by: Johnny Chuang <johnny.chuang@emc.com.tw>
> 
> This appears to be exactly the same as to what I already have in my "next"
> branch...
> 
> > ---
> >  drivers/input/touchscreen/elants_i2c.c | 31 
> > ++++++++++++++++++++-----------
> >  1 file changed, 20 insertions(+), 11 deletions(-)
> > 
> > diff --git a/drivers/input/touchscreen/elants_i2c.c 
> > b/drivers/input/touchscreen/elants_i2c.c
> > index ac09855..02aec28 100644
> > --- a/drivers/input/touchscreen/elants_i2c.c
> > +++ b/drivers/input/touchscreen/elants_i2c.c
> > @@ -298,7 +298,7 @@ static u16 elants_i2c_parse_version(u8 *buf)
> >  	return get_unaligned_be32(buf) >> 4;  }
> >  
> > -static int elants_i2c_query_fw_id(struct elants_data *ts)
> > +static int elants_i2c_query_hw_version(struct elants_data *ts)
> >  {
> >  	struct i2c_client *client = ts->client;
> >  	int error, retry_cnt;
> > @@ -318,8 +318,13 @@ static int elants_i2c_query_fw_id(struct elants_data
> *ts)
> >  			error, (int)sizeof(resp), resp);
> >  	}
> >  
> > -	dev_err(&client->dev,
> > -		"Failed to read fw id or fw id is invalid\n");
> > +	if (error) {
> > +		dev_err(&client->dev,
> > +			"Failed to read fw id: %d\n", error);
> > +		return error;
> > +	}
> > +
> > +	dev_err(&client->dev, "Invalid fw id: %#04x\n", ts->hw_version);
> >  
> >  	return -EINVAL;
> >  }
> > @@ -508,7 +513,7 @@ static int elants_i2c_fastboot(struct i2c_client 
> > *client)  static int elants_i2c_initialize(struct elants_data *ts)  {
> >  	struct i2c_client *client = ts->client;
> > -	int error, retry_cnt;
> > +	int error, error2, retry_cnt;
> >  	const u8 hello_packet[] = { 0x55, 0x55, 0x55, 0x55 };
> >  	const u8 recov_packet[] = { 0x55, 0x55, 0x80, 0x80 };
> >  	u8 buf[HEADER_SIZE];
> > @@ -553,18 +558,22 @@ static int elants_i2c_initialize(struct elants_data
> *ts)
> >  		}
> >  	}
> >  
> > +	/* hw version is available even if device in recovery state */
> > +	error2 = elants_i2c_query_hw_version(ts);
> >  	if (!error)
> > -		error = elants_i2c_query_fw_id(ts);
> > +		error = error2;
> > +
> >  	if (!error)
> >  		error = elants_i2c_query_fw_version(ts);
> > +	if (!error)
> > +		error = elants_i2c_query_test_version(ts);
> > +	if (!error)
> > +		error = elants_i2c_query_bc_version(ts);
> > +	if (!error)
> > +		error = elants_i2c_query_ts_info(ts);
> >  
> > -	if (error) {
> > +	if (error)
> >  		ts->iap_mode = ELAN_IAP_RECOVERY;
> > -	} else {
> > -		elants_i2c_query_test_version(ts);
> > -		elants_i2c_query_bc_version(ts);
> > -		elants_i2c_query_ts_info(ts);
> > -	}
> >  
> >  	return 0;
> >  }
> > --
> > 1.8.3.2
> > 
> 
> -- 
> Dmitry
> 

-- 
Dmitry

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

end of thread, other threads:[~2016-09-27  2:55 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-24  8:44 [PATCH] Input: elants_i2c - get product id on recovery mode for FW update Johnny Chuang
2016-08-25  8:31 ` kbuild test robot
2016-08-25  8:31   ` kbuild test robot
2016-08-25 10:11 ` Johnny Chuang
2016-08-25 16:40   ` Dmitry Torokhov
2016-09-23  8:01 ` [PATCH v3] " Johnny Chuang
2016-09-23 21:30   ` Dmitry Torokhov
2016-09-26  2:30     ` Johnny.Chuang
2016-09-26  2:30       ` Johnny.Chuang
2016-09-27  2:54       ` 'Dmitry Torokhov'

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.