Re: [PATCH 1/3] Input: atmel_mxt_ts - Make wait-after-reset period compatible with all chips

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jul 04, 2011 at 12:05:31PM +0300, Iiro Valkonen wrote:
> The delay before the chip can be accessed after reset varies between different
> chips in maXTouch family. Waiting for 200ms and then monitoring the CHG (chip
> is ready when the line is low) is guaranteed to work with all chips.
> 
> Signed-off-by: Iiro Valkonen <iiro.valkonen@xxxxxxxxx>
> ---
>  drivers/input/touchscreen/atmel_mxt_ts.c |    4 +++-
>  include/linux/i2c/atmel_mxt_ts.h         |    1 +
>  2 files changed, 4 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c
> index 1e61387..8870e7b 100644
> --- a/drivers/input/touchscreen/atmel_mxt_ts.c
> +++ b/drivers/input/touchscreen/atmel_mxt_ts.c
> @@ -170,7 +170,7 @@
>  #define MXT_BOOT_VALUE		0xa5
>  #define MXT_BACKUP_VALUE	0x55
>  #define MXT_BACKUP_TIME		25	/* msec */
> -#define MXT_RESET_TIME		65	/* msec */
> +#define MXT_RESET_TIME		200	/* msec */
>  
>  #define MXT_FWRESET_TIME	175	/* msec */
>  
> @@ -828,6 +828,8 @@ static int mxt_initialize(struct mxt_data *data)
>  	mxt_write_object(data, MXT_GEN_COMMAND,
>  			MXT_COMMAND_RESET, 1);
>  	msleep(MXT_RESET_TIME);
> +	while (data->pdata->read_chg())
> +		msleep(2);

I would prefer if we did not wait indefinitely but timed out after
certain number of retries.

Thanks.

-- 
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux