Commit 8ea8aeba authored by Doug Berger's avatar Doug Berger Committed by Treehugger Robot
Browse files

BACKPORT: gpio: of: support gpio-ranges for multiple gpiochip devices



Some drivers (e.g. gpio-mt7621 and gpio-brcmstb) have multiple
gpiochip banks within a single device. Unfortunately, the
gpio-ranges property of the device node was being applied to
every gpiochip of the device with device relative GPIO offset
values rather than gpiochip relative GPIO offset values.

This commit makes use of the gpio_chip offset value which can be
non-zero for such devices to split the device node gpio-ranges
property into GPIO offset ranges that can be applied to each
of the relevant gpiochips of the device.

Bug: 353554778
Change-Id: I868f0cd8e4dc8003547a34f3cfd57eece731622f
Signed-off-by: default avatarDoug Berger <opendmb@gmail.com>
Acked-by: default avatarFlorian Fainelli <florian.fainelli@broadcom.com>
Link: https://lore.kernel.org/r/20240424185039.1707812-3-opendmb@gmail.com


Signed-off-by: default avatarBartosz Golaszewski <bartosz.golaszewski@linaro.org>
(cherry picked from commit e818cd3c)
[danesh: Resolved minor conflict in drivers/gpio/gpiolib-of.c]
Signed-off-by: default avatarDanesh Petigara <danesh.petigara@broadcom.com>
Signed-off-by: default avatarPierre Couillaud <pierre@broadcom.com>
parent 54edf65d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment