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:Doug Berger <opendmb@gmail.com> Acked-by:
Florian Fainelli <florian.fainelli@broadcom.com> Link: https://lore.kernel.org/r/20240424185039.1707812-3-opendmb@gmail.com Signed-off-by:
Bartosz Golaszewski <bartosz.golaszewski@linaro.org> (cherry picked from commit e818cd3c) [danesh: Resolved minor conflict in drivers/gpio/gpiolib-of.c] Signed-off-by:
Danesh Petigara <danesh.petigara@broadcom.com> Signed-off-by:
Pierre Couillaud <pierre@broadcom.com>
Loading
Please sign in to comment