[2/2] gpio: bd70528: Use correct unit for debounce times
diff mbox series

Message ID 20191108160747.3274377-2-thierry.reding@gmail.com
State New
Headers show
Series
  • [1/2] gpio: max77620: Fixup debounce delays
Related show

Commit Message

Thierry Reding Nov. 8, 2019, 4:07 p.m. UTC
From: Thierry Reding <treding@nvidia.com>

The debounce time passed to gpiod_set_debounce() is specifid 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>
---
 drivers/gpio/gpio-bd70528.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Bartosz Golaszewski Nov. 12, 2019, 10:20 a.m. UTC | #1
pt., 8 lis 2019 o 17:07 Thierry Reding <thierry.reding@gmail.com> napisaƂ(a):
>
> From: Thierry Reding <treding@nvidia.com>
>
> The debounce time passed to gpiod_set_debounce() is specifid 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>
> ---
>  drivers/gpio/gpio-bd70528.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpio/gpio-bd70528.c b/drivers/gpio/gpio-bd70528.c
> index d934d23b77c6..d29cbd3c9e53 100644
> --- a/drivers/gpio/gpio-bd70528.c
> +++ b/drivers/gpio/gpio-bd70528.c
> @@ -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:
> --
> 2.23.0
>

This fixes commit 18bc64b3aebf ("gpio: Initial support for ROHM
bd70528 GPIO block") present in v5.3 so applied to fixes and marked
for stable.

Bart

Patch
diff mbox series

diff --git a/drivers/gpio/gpio-bd70528.c b/drivers/gpio/gpio-bd70528.c
index d934d23b77c6..d29cbd3c9e53 100644
--- a/drivers/gpio/gpio-bd70528.c
+++ b/drivers/gpio/gpio-bd70528.c
@@ -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: