linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Input: wdt87xx_i2c - fix the flash erase issue
@ 2016-09-05  9:02 hn.chen
  2016-09-05 17:28 ` Dmitry Torokhov
  0 siblings, 1 reply; 2+ messages in thread
From: hn.chen @ 2016-09-05  9:02 UTC (permalink / raw)
  To: linux-input; +Cc: linux-kernel, dmitry.torokhov, HungNien Chen

From: HungNien Chen <hn.chen@weidahitech.com>

Flash erase wait 50ms for the operation completed in last driver.
It will take risk since the spec says the typical is 30ms but the max is
200ms. Replace the value with 200ms for safty.

Signed-off-by: HungNien Chen <hn.chen@weidahitech.com>
---
 drivers/input/touchscreen/wdt87xx_i2c.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/input/touchscreen/wdt87xx_i2c.c b/drivers/input/touchscreen/wdt87xx_i2c.c
index 73861ad..2519617 100644
--- a/drivers/input/touchscreen/wdt87xx_i2c.c
+++ b/drivers/input/touchscreen/wdt87xx_i2c.c
@@ -23,7 +23,7 @@
 #include <asm/unaligned.h>
 
 #define WDT87XX_NAME		"wdt87xx_i2c"
-#define WDT87XX_DRV_VER		"0.9.7"
+#define WDT87XX_DRV_VER		"0.9.8"
 #define WDT87XX_FW_NAME		"wdt87xx_fw.bin"
 #define WDT87XX_CFG_NAME	"wdt87xx_cfg.bin"
 
@@ -157,6 +157,7 @@
 /* Controller requires minimum 300us between commands */
 #define WDT_COMMAND_DELAY_MS		2
 #define WDT_FLASH_WRITE_DELAY_MS	4
+#define	WDT_FLASH_ERASE_DELAY_MS	200
 #define WDT_FW_RESET_TIME		2500
 
 struct wdt87xx_sys_param {
@@ -726,7 +727,7 @@ static int wdt87xx_write_firmware(struct i2c_client *client, const void *chunk)
 				break;
 			}
 
-			msleep(50);
+			msleep(WDT_FLASH_ERASE_DELAY_MS);
 
 			error = wdt87xx_write_data(client, data, start_addr,
 						   page_size);
-- 
1.9.1

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

* Re: [PATCH] Input: wdt87xx_i2c - fix the flash erase issue
  2016-09-05  9:02 [PATCH] Input: wdt87xx_i2c - fix the flash erase issue hn.chen
@ 2016-09-05 17:28 ` Dmitry Torokhov
  0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Torokhov @ 2016-09-05 17:28 UTC (permalink / raw)
  To: hn.chen; +Cc: linux-input, linux-kernel

On Mon, Sep 05, 2016 at 05:02:16PM +0800, hn.chen@weidahitech.com wrote:
> From: HungNien Chen <hn.chen@weidahitech.com>
> 
> Flash erase wait 50ms for the operation completed in last driver.
> It will take risk since the spec says the typical is 30ms but the max is
> 200ms. Replace the value with 200ms for safty.
> 
> Signed-off-by: HungNien Chen <hn.chen@weidahitech.com>

Applied, thank you.

> ---
>  drivers/input/touchscreen/wdt87xx_i2c.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/input/touchscreen/wdt87xx_i2c.c b/drivers/input/touchscreen/wdt87xx_i2c.c
> index 73861ad..2519617 100644
> --- a/drivers/input/touchscreen/wdt87xx_i2c.c
> +++ b/drivers/input/touchscreen/wdt87xx_i2c.c
> @@ -23,7 +23,7 @@
>  #include <asm/unaligned.h>
>  
>  #define WDT87XX_NAME		"wdt87xx_i2c"
> -#define WDT87XX_DRV_VER		"0.9.7"
> +#define WDT87XX_DRV_VER		"0.9.8"
>  #define WDT87XX_FW_NAME		"wdt87xx_fw.bin"
>  #define WDT87XX_CFG_NAME	"wdt87xx_cfg.bin"
>  
> @@ -157,6 +157,7 @@
>  /* Controller requires minimum 300us between commands */
>  #define WDT_COMMAND_DELAY_MS		2
>  #define WDT_FLASH_WRITE_DELAY_MS	4
> +#define	WDT_FLASH_ERASE_DELAY_MS	200
>  #define WDT_FW_RESET_TIME		2500
>  
>  struct wdt87xx_sys_param {
> @@ -726,7 +727,7 @@ static int wdt87xx_write_firmware(struct i2c_client *client, const void *chunk)
>  				break;
>  			}
>  
> -			msleep(50);
> +			msleep(WDT_FLASH_ERASE_DELAY_MS);
>  
>  			error = wdt87xx_write_data(client, data, start_addr,
>  						   page_size);
> -- 
> 1.9.1
> 

-- 
Dmitry

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

end of thread, other threads:[~2016-09-05 17:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-05  9:02 [PATCH] Input: wdt87xx_i2c - fix the flash erase issue hn.chen
2016-09-05 17:28 ` 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).