]> asedeno.scripts.mit.edu Git - linux.git/commit
gpio: max77620: Fixup debounce delays
authorThierry Reding <treding@nvidia.com>
Fri, 8 Nov 2019 16:07:46 +0000 (17:07 +0100)
committerBartosz Golaszewski <bgolaszewski@baylibre.com>
Tue, 12 Nov 2019 10:13:54 +0000 (11:13 +0100)
commitb0391479ae04dfcbd208b9571c375064caad9a57
treeeaf7e6cb7a31f167b57c37dc66b73ab921a07e3e
parent31f4f5b495a62c9a8b15b1c3581acd5efeb9af8c
gpio: max77620: Fixup debounce delays

When converting milliseconds to microseconds in commit fffa6af94894
("gpio: max77620: Use correct unit for debounce times") some ~1 ms gaps
were introduced between the various ranges supported by the controller.
Fix this by changing the start of each range to the value immediately
following the end of the previous range. This way a debounce time of,
say 8250 us will translate into 16 ms instead of returning an -EINVAL
error.

Typically the debounce delay is only ever set through device tree and
specified in milliseconds, so we can never really hit this issue because
debounce times are always a multiple of 1000 us.

The only notable exception for this is drivers/mmc/host/mmc-spi.c where
the CD GPIO is requested, which passes a 1 us debounce time. According
to a comment preceeding that code this should actually be 1 ms (i.e.
1000 us).

Reported-by: Pavel Machek <pavel@denx.de>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Acked-by: Pavel Machek <pavel@denx.de>
Cc: <stable@vger.kernel.org>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
drivers/gpio/gpio-max77620.c