| From be0cc22890e5273683664c5c786bf05416f60a8a Mon Sep 17 00:00:00 2001 |
| From: Wolfram Sang <wsa+renesas@sang-engineering.com> |
| Date: Sat, 16 Jun 2018 21:56:36 +0900 |
| Subject: [PATCH 0658/1795] i2c: gpio: initialize SCL to HIGH again |
| |
| It seems that during the conversion from gpio* to gpiod*, the initial |
| state of SCL was wrongly switched to LOW. Fix it to be HIGH again. |
| |
| Fixes: 7bb75029ef34 ("i2c: gpio: Enforce open drain through gpiolib") |
| Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> |
| Tested-by: Geert Uytterhoeven <geert+renesas@glider.be> |
| Reviewed-by: Linus Walleij <linus.walleij@linaro.org> |
| Signed-off-by: Wolfram Sang <wsa@the-dreams.de> |
| Cc: stable@kernel.org |
| (cherry picked from commit 12b731dd46d9ee646318e6e9dc587314a3908a46) |
| Signed-off-by: Simon Horman <horms+renesas@verge.net.au> |
| Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> |
| --- |
| drivers/i2c/busses/i2c-gpio.c | 4 ++-- |
| 1 file changed, 2 insertions(+), 2 deletions(-) |
| |
| diff --git a/drivers/i2c/busses/i2c-gpio.c b/drivers/i2c/busses/i2c-gpio.c |
| index d80ea6ce91bb..6b75e591a6c7 100644 |
| --- a/drivers/i2c/busses/i2c-gpio.c |
| +++ b/drivers/i2c/busses/i2c-gpio.c |
| @@ -172,9 +172,9 @@ static int i2c_gpio_probe(struct platform_device *pdev) |
| * required for an I2C bus. |
| */ |
| if (pdata->scl_is_open_drain) |
| - gflags = GPIOD_OUT_LOW; |
| + gflags = GPIOD_OUT_HIGH; |
| else |
| - gflags = GPIOD_OUT_LOW_OPEN_DRAIN; |
| + gflags = GPIOD_OUT_HIGH_OPEN_DRAIN; |
| priv->scl = i2c_gpio_get_desc(dev, "scl", 1, gflags); |
| if (IS_ERR(priv->scl)) |
| return PTR_ERR(priv->scl); |
| -- |
| 2.19.0 |
| |