]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
gpio: bd70528: Use correct unit for debounce times
authorThierry Reding <treding@nvidia.com>
Fri, 8 Nov 2019 16:07:47 +0000 (17:07 +0100)
committerBartosz Golaszewski <bgolaszewski@baylibre.com>
Tue, 12 Nov 2019 10:18:52 +0000 (11:18 +0100)
The debounce time passed to gpiod_set_debounce() is specified in
microseconds, so make sure to use the correct unit when computing the
register values, which denote delays in milliseconds.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Cc: <stable@vger.kernel.org>
Fixes: 18bc64b3aebf ("gpio: Initial support for ROHM bd70528 GPIO block")
[Bartosz: fixed a typo in commit message]
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
drivers/gpio/gpio-bd70528.c

index 0c1ead12d8839036382392a8d8f35c4131646fd2..4ba4d4a6788160b8eff54617352dd4127eb29420 100644 (file)
@@ -25,13 +25,13 @@ static int bd70528_set_debounce(struct bd70528_gpio *bdgpio,
        case 0:
                val = BD70528_DEBOUNCE_DISABLE;
                break;
-       case 1 ... 15:
+       case 1 ... 15000:
                val = BD70528_DEBOUNCE_15MS;
                break;
-       case 16 ... 30:
+       case 15001 ... 30000:
                val = BD70528_DEBOUNCE_30MS;
                break;
-       case 31 ... 50:
+       case 30001 ... 50000:
                val = BD70528_DEBOUNCE_50MS;
                break;
        default: