<br><br><div class="gmail_quote">2012/6/11 Igor Grinberg <span dir="ltr"><<a href="mailto:grinberg@compulab.co.il" target="_blank">grinberg@compulab.co.il</a>></span><br><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Hi,<br>
<br>
This is input subsystem, add Dmitry and linux-input.<br>
<div class="im"><br>
On 06/11/12 17:00, Zumeng Chen wrote:<br>
> If we don't set proper debouce time for ads7846, then there are<br>
> flooded interrupt counters of ads7846 responding to one time<br>
> touch on screen, so the driver couldn't work well.<br>
><br>
> And since most OMAP3 series boards pass NULL pointer of board_pdata<br>
> to omap_ads7846_init, so it's more proper to set it in driver level<br>
> after having gpio_request done.<br>
<br>
</div>What about other non-OMAP platforms?<br></blockquote><div>Good point, I thought it should be the same situation, and I have no other boards<br>to validate it :) Then I'll fall back on my original patch to bracket them with OMAP3EVM<br>
</div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
NULL pointer for board_pdata, only means that the default pdata is used.<br>
Please, see the common-board-devices.c file more closely.<br></blockquote><div>Yes, I just went through again, two points:<br><br>1 ) get_pendown_state is not set for OMAP3 boards, and the state<br> will be get by gpio_get_value(gpio-omap.c)<br>
The second path will be available in the ads7846_setup_pendown<br> if (pdata->get_pendown_state) {<br> ts->get_pendown_state = pdata->get_pendown_state;<br> } else if (gpio_is_valid(pdata->gpio_pendown)) {<br>
<br>2 ) All omap3 boards set gpio_pendown for pdata.<br> So it had better we set_debounce in driver level after gpio_request_one<br> having done<br> I'll remove DEBOUNCE_TIME in V2 and change into like following:<br>
<br>+#ifdef CONFIG_MACH_OMAP3EVM<br>+ /* 310 means 10 microsecond for omap3 */<br>+ gpio_set_debounce(pdata->gpio_pendown, 310);<br>+#endif<br><br></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div class="im"><br>
><br>
> This patch has been validated on 3530evm.<br>
><br>
> Signed-off-by: Zumeng Chen <<a href="mailto:zumeng.chen@gmail.com">zumeng.chen@gmail.com</a>><br>
> Signed-off-by: Syed Mohammed Khasim <<a href="mailto:khasim@ti.com">khasim@ti.com</a>><br>
> Signed-off-by: Tony Lindgren <<a href="mailto:tony@atomide.com">tony@atomide.com</a>><br>
> ---<br>
> drivers/input/touchscreen/ads7846.c | 2 ++<br>
> 1 files changed, 2 insertions(+), 0 deletions(-)<br>
><br>
> diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c<br>
> index f02028e..a82a5fb 100644<br>
> --- a/drivers/input/touchscreen/ads7846.c<br>
> +++ b/drivers/input/touchscreen/ads7846.c<br>
> @@ -61,6 +61,7 @@<br>
><br>
> /* this driver doesn't aim at the peak continuous sample rate */<br>
> #define SAMPLE_BITS (8 /*cmd*/ + 16 /*sample*/ + 2 /* before, after */)<br>
> +#define DEBOUNCE_TIME 310 /* About 10 ms */<br>
<br>
</div>I think hard coding this value is wrong.<br></blockquote><div>Yes, me too. <br></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Can't it be derived from the pdata->debounce_* fields?<br></blockquote><div>Yes, I agreed this way, and to be honest, my first choice<br>is to find if there is a member for debounce, but no. And<br>there is no more sense to derive it from debounce_max,<br>
although which is the right value for us.<br><br>So I have to use the hardcode here.<br><br>Regards,<br>Zumeng<br><br></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div class="im"><br>
><br>
> struct ts_event {<br>
> /*<br>
> @@ -980,6 +981,7 @@ static int __devinit ads7846_setup_pendown(struct spi_device *spi, struct ads784<br>
> }<br>
><br>
> ts->gpio_pendown = pdata->gpio_pendown;<br>
> + gpio_set_debounce(pdata->gpio_pendown, DEBOUNCE_TIME);<br>
><br>
> } else {<br>
> dev_err(&spi->dev, "no get_pendown_state nor gpio_pendown?\n");<br>
<br>
--<br>
</div>Regards,<br>
Igor.<br>
</blockquote></div><br>