]> git.baikalelectronics.ru Git - kernel.git/commit
gpio: ftgpio: Support debounce timer
authorLinus Walleij <linus.walleij@linaro.org>
Mon, 27 Aug 2018 20:15:51 +0000 (22:15 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Thu, 30 Aug 2018 07:14:54 +0000 (09:14 +0200)
commitf1904241ae4256962b7597fc887031f8c4747324
tree6121f69a5add487a4356705cd66ad2442f9a0ac8
parent7de3140780b6e3528664e5023dd5789e544df284
gpio: ftgpio: Support debounce timer

The FTGPIO010 has a debounce timer or rather prescaler that
will affect interrupts fireing off the block. We can support
this to get proper debounce on e.g. keypresses.

Since the same prescaler is used across all GPIO lines of
the silicon block, we need to bail out if the prescaler is
already set and in use by another line.

If the prescaler is already set to what we need, fine, we
reuse it. This happens more often than not when the same
debounce time is set for several GPIO keys, so we support
that usecase easily with this code.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpio-ftgpio010.c