Commit 01e10d0
pinctrl: sunxi: Implement gpiochip::get_direction()
After commit 471e998 ("gpiolib: remove redundant callback check"),
a warning will be printed if the gpio driver does not implement this
callback. The warning was added in commit e623c43 ("gpiolib:
sanitize the return value of gpio_chip::get_direction()"), but was
masked by the "redundant" check.
The warning can be triggered by any action that calls the callback,
such as dumping the GPIO state from /sys/kernel/debug/gpio.
Implement it for the sunxi driver. This is simply a matter of reading
out the mux value from the registers, then checking if it is one of
the GPIO functions and which direction it is.
Signed-off-by: Chen-Yu Tsai <[email protected]>
Reviewed-by: Jernej Skrabec <[email protected]>
Reviewed-by: Bartosz Golaszewski <[email protected]>
Reviewed-by: Andre Przywara <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>1 parent 45fe459 commit 01e10d0
1 file changed
Lines changed: 51 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
207 | 233 | | |
208 | 234 | | |
209 | 235 | | |
| |||
930 | 956 | | |
931 | 957 | | |
932 | 958 | | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
933 | 983 | | |
934 | 984 | | |
935 | 985 | | |
| |||
1599 | 1649 | | |
1600 | 1650 | | |
1601 | 1651 | | |
| 1652 | + | |
1602 | 1653 | | |
1603 | 1654 | | |
1604 | 1655 | | |
| |||
0 commit comments