# Re: \[PATCH v2\] input: qt602240 - Add ATMEL QT602240 touchscreen driver

- From: Joonyoung Shim \<hidden\>
- Date: 2010-06-29 03:33:38 
- List: linux-input
- Page: https://ratatoskr.run/linux-input/2010/06/8914152
- Thread: https://ratatoskr.run/linux-input/2010/06/8914152/t.md

```text
Hi,

On 6/28/2010 11:26 PM, Dan Murphy wrote:
> I don't see any error handling from the IC here.
> 
> Generally this IC should give a few error messages if a X/Y line is broken,
> the chip goes into reset, or the chip is missed configured.
> 

The configuration error can occur and if the chip detect it, we get
messages from message object in interrupt handler and can see it. If 
needs, i can add error print.

> This is a bad situation here
> +       /* Read dummy message to make high CHG pin */
> +       do {
> +               ret = qt602240_read_object(data, QT602240_GEN_MESSAGE, 0);
> +               if (ret < 0)
> +                       return ret;
> +       } while (ret != 0xff);
> 
> The chip may have an error and constantly send you the message which means
> you will never get out of this loop.  This can be bad as your probe or
> load_fw may never return.
> 

Hmm, this chip reports always 0xff value if the message is nothing, but
i will add count to prevent unlikely loop.

Thanks.
```
