diff options
author | Geert Uytterhoeven <geert+renesas@glider.be> | 2018-01-09 19:08:21 +0100 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2018-01-10 14:17:17 +0100 |
commit | 1e77fc82110ac36febf46c1e2782f504f7d23099 (patch) | |
tree | f722590f4dfaabcf0ba0ebf3bce28e1259371ab0 /arch/sh | |
parent | b2cd1df66037e7c4697c7e40496bf7e4a5e16a2d (diff) | |
download | linux-1e77fc82110ac36febf46c1e2782f504f7d23099.tar.gz linux-1e77fc82110ac36febf46c1e2782f504f7d23099.tar.xz |
gpio: Add missing open drain/source handling to gpiod_set_value_cansleep()
Since commit f11a04464ae57e8d ("i2c: gpio: Enable working over slow
can_sleep GPIOs"), probing the i2c RTC connected to an i2c-gpio bus on
r8a7740/armadillo fails with:
rtc-s35390a 0-0030: error resetting chip
rtc-s35390a: probe of 0-0030 failed with error -5
More debug code reveals:
i2c i2c-0: master_xfer[0] R, addr=0x30, len=1
i2c i2c-0: NAK from device addr 0x30 msg #0
s35390a_get_reg: ret = -6
Commit 02e479808b5d62f8 ("gpio: Alter semantics of *raw* operations to
actually be raw") moved open drain/source handling from
gpiod_set_raw_value_commit() to gpiod_set_value(), but forgot to take
into account that gpiod_set_value_cansleep() also needs this handling.
The i2c protocol mandates that i2c signals are open drain, hence i2c
communication fails.
Fix this by adding the missing handling to gpiod_set_value_cansleep(),
using a new common helper gpiod_set_value_nocheck().
Fixes: 02e479808b5d62f8 ("gpio: Alter semantics of *raw* operations to actually be raw")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
[removed underscore syntax, added kerneldoc]
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'arch/sh')
0 files changed, 0 insertions, 0 deletions