aboutsummaryrefslogtreecommitdiffstats
path: root/meta-rcar-gen3-adas/recipes-kernel/linux/linux-renesas/0015-gpio-max732x-fix-gpio-set.patch
blob: c08c0ed6d90656399f3f1d0692bbf1326d550872 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
From 75b9bdbafde96b6af222f96e47d7a4a260ed32df Mon Sep 17 00:00:00 2001
From: Vladimir Barinov <vladimir.barinov@cogentembedded.com>
Date: Tue, 11 Apr 2017 20:12:56 +0300
Subject: [PATCH] gpio: max732x: fix gpio set

gpio set value/direction must 0 or 1, but
gpiolib sets it to not binary values

Signed-off-by: Vladimir Barinov <vladimir.barinov@cogentembedded.com>
---
 drivers/gpio/gpio-max732x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/gpio-max732x.c b/drivers/gpio/gpio-max732x.c
index a9aaf9d..b6fc8c5 100644
--- a/drivers/gpio/gpio-max732x.c
+++ b/drivers/gpio/gpio-max732x.c
@@ -237,7 +237,7 @@ static void max732x_gpio_set_value(struct gpio_chip *gc, unsigned off, int val)
 	unsigned base = off & ~0x7;
 	uint8_t mask = 1u << (off & 0x7);
 
-	max732x_gpio_set_mask(gc, base, mask, val << (off & 0x7));
+	max732x_gpio_set_mask(gc, base, mask, (!!val) << (off & 0x7));
 }
 
 static void max732x_gpio_set_multiple(struct gpio_chip *gc,
-- 
1.9.1