Commit f07798d
gpio: mmio: do not calculate bgpio_bits via "ngpios"
bgpio_bits must be aligned with the data bus width. For example, on a
32 bit big endian system and we only have 16 GPIOs. If we only assume
bgpio_bits=16 we can never control the GPIO because the base address
is the lowest address.
low address high address
-------------------------------------------------
| byte3 | byte2 | byte1 | byte0 |
-------------------------------------------------
| NaN | NaN | gpio8-15 | gpio0-7 |
-------------------------------------------------
Fixes: 55b2395 ("gpio: mmio: handle "ngpios" properly in bgpio_init()")
Fixes: openwrt/openwrt#15739
Reported-by: Mark Mentovai <[email protected]>
Signed-off-by: Shiji Yang <[email protected]>
Suggested-By: Mark Mentovai <[email protected]>
Reviewed-by: Jonas Gorski <[email protected]>
Tested-by: Lóránd Horváth <[email protected]>
Reviewed-by: Linus Walleij <[email protected]>
Link: https://lore.kernel.org/r/TYCP286MB089577B47D70F0AB25ABA6F5BCD52@TYCP286MB0895.JPNP286.PROD.OUTLOOK.COM
Signed-off-by: Bartosz Golaszewski <[email protected]>1 parent 3645ffa commit f07798d
1 file changed
+0
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
619 | 619 | | |
620 | 620 | | |
621 | 621 | | |
622 | | - | |
623 | | - | |
624 | 622 | | |
625 | 623 | | |
626 | 624 | | |
| |||
0 commit comments