Commit 39c8db9
[backport] gpio: core: Decouple open drain/source flag with active low/high
Note [Alexandru Ardelean]: the SidekiqZ2 reset pin is an open drain,
however it doesn't behave like one when the `ad9361_reset()` code runs.
Because the GPIO_OPEN_DRAIN OF property has the GPIO_ACTIVE_LOW flag, the
value is inverted. So, when doing `gpiod_set_value(0)` the final open-drain
code is `_gpio_set_open_drain_value(1)`, which is not what we want.
[ upstream commit 4c0facd ("gpio: core: Decouple open drain/source
flag with active low/high") ]
Currently, the GPIO interface is said to Open Drain if it is Single
Ended and active LOW. Similarly, it is said as Open Source if it is
Single Ended and active HIGH.
The active HIGH/LOW is used in the interface for setting the pin
state to HIGH or LOW when enabling/disabling the interface.
In Open Drain interface, pin is set to HIGH by putting pin in
high impedance and LOW by driving to the LOW.
In Open Source interface, pin is set to HIGH by driving pin to
HIGH and set to LOW by putting pin in high impedance.
With above, the Open Drain/Source is unrelated to the active LOW/HIGH
in interface. There is interface where the enable/disable of interface
is ether active LOW or HIGH but it is Open Drain type.
Hence decouple the Open Drain with Single Ended + Active LOW and
Open Source with Single Ended + Active HIGH.
Adding different flag for the Open Drain/Open Source which is valid
only when Single ended flag is enabled.
Signed-off-by: Laxman Dewangan <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>1 parent 5f79e44 commit 39c8db9
File tree
4 files changed
+13
-6
lines changed- drivers/gpio
- include
- dt-bindings/gpio
- linux
4 files changed
+13
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
150 | | - | |
| 150 | + | |
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3262 | 3262 | | |
3263 | 3263 | | |
3264 | 3264 | | |
| 3265 | + | |
3265 | 3266 | | |
3266 | 3267 | | |
3267 | 3268 | | |
| |||
3275 | 3276 | | |
3276 | 3277 | | |
3277 | 3278 | | |
| 3279 | + | |
3278 | 3280 | | |
3279 | 3281 | | |
3280 | 3282 | | |
| |||
3295 | 3297 | | |
3296 | 3298 | | |
3297 | 3299 | | |
3298 | | - | |
| 3300 | + | |
3299 | 3301 | | |
3300 | 3302 | | |
3301 | 3303 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
20 | 24 | | |
21 | | - | |
22 | | - | |
| 25 | + | |
| 26 | + | |
23 | 27 | | |
24 | | - | |
25 | | - | |
| 28 | + | |
| 29 | + | |
26 | 30 | | |
27 | 31 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
0 commit comments