]> asedeno.scripts.mit.edu Git - linux.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)
commit36f3f19a82152d558ee6846898b9480409b57e9d
tree6121f69a5add487a4356705cd66ad2442f9a0ac8
parentda02d79452ea34e7ab22bd97d2fc7383bc00e16b
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