summaryrefslogtreecommitdiffstats
path: root/meta-rcar-gen3-adas/recipes-kernel/linux/linux-renesas/0065-gpio-max732x-set-gpio-ouput-low-at-init.patch
blob: ff9661dcd862687d825fc09f40c16d6d5b34c79b (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
30
31
32
From 3c58ea643c31273b467400c04f3b1ed04fc0da2d Mon Sep 17 00:00:00 2001
From: Vladimir Barinov <vladimir.barinov@cogentembedded.com>
Date: Mon, 3 Jul 2017 02:43:21 +0300
Subject: [PATCH] gpio: max732x: set gpio ouput-low at init

Set all gpio output-low at init state instead
chip defaults.
This allows to avoid preserved values during resaet

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

diff --git a/drivers/gpio/gpio-max732x.c b/drivers/gpio/gpio-max732x.c
index b6fc8c5..4a2669f 100644
--- a/drivers/gpio/gpio-max732x.c
+++ b/drivers/gpio/gpio-max732x.c
@@ -680,6 +680,10 @@ static int max732x_probe(struct i2c_client *client,
 
 	mutex_init(&chip->lock);
 
+	/* set all ports output-low at init state */
+	max732x_writeb(chip, 0, 0);
+	max732x_writeb(chip, 1, 0);
+
 	ret = max732x_readb(chip, is_group_a(chip, 0), &chip->reg_out[0]);
 	if (ret)
 		goto out_failed;
-- 
1.9.1