Re: [RFC/PATCHv2 2/4] arm: omap: gpio: implement set_debounce method

2010-04-01 Thread Felipe Balbi
On Thu, Apr 01, 2010 at 11:29:16AM +0200, ext Grazvydas Ignotas wrote: Hmh, dbck is shared by the whole GPIO bank, so what happens if someone calls _set_gpio_debounce(bank, 1, 310) and then _set_gpio_debounce(bank, 2, 0)? This should leave debounce enabled for GPIO1, but you'll disable dbck on

Re: [RFC/PATCHv2 2/4] arm: omap: gpio: implement set_debounce method

2010-04-01 Thread Grazvydas Ignotas
On Thu, Apr 1, 2010 at 12:32 PM, Felipe Balbi felipe.ba...@nokia.com wrote: On Thu, Apr 01, 2010 at 11:29:16AM +0200, ext Grazvydas Ignotas wrote: Hmh, dbck is shared by the whole GPIO bank, so what happens if someone calls _set_gpio_debounce(bank, 1, 310) and then _set_gpio_debounce(bank, 2,

Re: [RFC/PATCHv2 2/4] arm: omap: gpio: implement set_debounce method

2010-04-01 Thread Felipe Balbi
On Thu, Apr 01, 2010 at 11:37:16AM +0200, ext Grazvydas Ignotas wrote: On Thu, Apr 1, 2010 at 12:32 PM, Felipe Balbi felipe.ba...@nokia.com wrote: On Thu, Apr 01, 2010 at 11:29:16AM +0200, ext Grazvydas Ignotas wrote: Hmh, dbck is shared by the whole GPIO bank, so what happens if someone

Re: [RFC/PATCHv2 2/4] arm: omap: gpio: implement set_debounce method

2010-04-01 Thread Grazvydas Ignotas
On Thu, Apr 1, 2010 at 1:10 PM, Felipe Balbi felipe.ba...@nokia.com wrote: On Thu, Apr 01, 2010 at 11:37:16AM +0200, ext Grazvydas Ignotas wrote: On Thu, Apr 1, 2010 at 12:32 PM, Felipe Balbi felipe.ba...@nokia.com wrote: On Thu, Apr 01, 2010 at 11:29:16AM +0200, ext Grazvydas Ignotas wrote:

Re: [RFC/PATCHv2 2/4] arm: omap: gpio: implement set_debounce method

2010-04-01 Thread Jani Nikula
On Thu, Apr 1, 2010 at 12:32, Felipe Balbi felipe.ba...@nokia.com wrote: On Thu, Apr 01, 2010 at 11:29:16AM +0200, ext Grazvydas Ignotas wrote: There is also an issue if somebody calls _set_gpio_debounce(bank, 1, 310) and _set_gpio_debounce(bank, 2, 620), the second call will override

Re: [RFC/PATCHv2 2/4] arm: omap: gpio: implement set_debounce method

2010-04-01 Thread Felipe Balbi
On Thu, Apr 01, 2010 at 04:11:27PM +0300, Jani Nikula wrote: On Thu, Apr 1, 2010 at 12:32, Felipe Balbi felipe.ba...@nokia.com wrote: On Thu, Apr 01, 2010 at 11:29:16AM +0200, ext Grazvydas Ignotas wrote: There is also an issue if somebody calls _set_gpio_debounce(bank, 1, 310) and

Re: [RFC/PATCHv2 2/4] arm: omap: gpio: implement set_debounce method

2010-04-01 Thread Mark Brown
On Thu, Apr 01, 2010 at 07:42:50PM +0300, Felipe Balbi wrote: On Thu, Apr 01, 2010 at 04:11:27PM +0300, Jani Nikula wrote: You might want to have a look at [1] on irq debouncing. The hardware support for debouncing varies (bank/gpio restrictions, debounce timeouts, no support at all, what

Re: [RFC/PATCHv2 2/4] arm: omap: gpio: implement set_debounce method

2010-04-01 Thread Felipe Balbi
On Thu, 1 Apr 2010 19:15:08 +0100, Mark Brown I tend to agree here, especially for GPIOs on slow buses like I2C or which may be used as wake sources. I guess ideally we want something like the LEDs do with blinking where we use the hardware feature if present and suitable but fall back on

[RFC/PATCHv2 2/4] arm: omap: gpio: implement set_debounce method

2010-03-31 Thread Felipe Balbi
OMAP support debouncing of gpio lines, implement the method using gpiolib. Signed-off-by: Felipe Balbi felipe.ba...@nokia.com --- arch/arm/plat-omap/gpio.c | 68 + 1 files changed, 68 insertions(+), 0 deletions(-) diff --git

Re: [RFC/PATCHv2 2/4] arm: omap: gpio: implement set_debounce method

2010-03-31 Thread Mark Brown
On Wed, Mar 31, 2010 at 06:35:10PM +0300, Felipe Balbi wrote: + if (debounce) { + val |= l; + if (cpu_is_omap34xx() || cpu_is_omap44xx()) + clk_enable(bank-dbck); + } else { + val = ~l; + if (cpu_is_omap34xx() ||

Re: [RFC/PATCHv2 2/4] arm: omap: gpio: implement set_debounce method

2010-03-31 Thread Felipe Balbi
Hi, On Wed, Mar 31, 2010 at 06:21:58PM +0200, ext Mark Brown wrote: On Wed, Mar 31, 2010 at 06:35:10PM +0300, Felipe Balbi wrote: + if (debounce) { + val |= l; + if (cpu_is_omap34xx() || cpu_is_omap44xx()) + clk_enable(bank-dbck); +

Re: [RFC/PATCHv2 2/4] arm: omap: gpio: implement set_debounce method

2010-03-31 Thread Felipe Balbi
Hi, On Wed, Mar 31, 2010 at 06:29:09PM +0200, Balbi Felipe (Nokia-D/Helsinki) wrote: On Wed, Mar 31, 2010 at 06:21:58PM +0200, ext Mark Brown wrote: On Wed, Mar 31, 2010 at 06:35:10PM +0300, Felipe Balbi wrote: + if (debounce) { + val |= l; + if