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, 0)? This should leave debounce enabled for
>> GPIO1, but you'll disable dbck on second call. GPIOs 0-31 share the
>> same bank.
>
> but why would you call _set_gpio_debounce(bank, 2 0); without setting a real
> debounce value before ?

ok then you could call
  _set_gpio_debounce(bank, 1, 310);
  _set_gpio_debounce(bank, 2, 310);
  _set_gpio_debounce(bank, 2, 0);

The problem here is that debounce is still active for GPIO1, but you
disable dbck for the whole bank.

>
>> 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 debounce setting of GPIO1 (as it's shared by the whole bank).
>> This might be not what the user intended, would be useful to detect
>> this and warn the user.
>
> good point. As this is RFC, I'll wait until everybody comments.
>
> --
> balbi
>
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to