[PATCH] gpio: rockchip: convert to dynamic GPIO base allocation
Jonas Karlman
jonas at kwiboo.se
Thu Apr 9 12:09:06 PDT 2026
Hi,
On 4/7/2026 11:59 AM, Shawn Lin wrote:
> Hi Bartosz,
>
> 在 2026/03/31 星期二 16:05, Bartosz Golaszewski 写道:
>> On Mon, Mar 30, 2026 at 11:53 AM Shawn Lin <shawn.lin at rock-chips.com> wrote:
>>>
>>> This driver is used on device tree based platform. Use dynamic
>>> GPIO numberspace base to suppress the warning:
>>>
>>> gpio gpiochip0: Static allocation of GPIO base is deprecated, use dynamic allocation.
>>> gpio gpiochip1: Static allocation of GPIO base is deprecated, use dynamic allocation.
>>> gpio gpiochip2: Static allocation of GPIO base is deprecated, use dynamic allocation.
>>> gpio gpiochip3: Static allocation of GPIO base is deprecated, use dynamic allocation.
>>> gpio gpiochip4: Static allocation of GPIO base is deprecated, use dynamic allocation.
>>>
>>> Signed-off-by: Shawn Lin <shawn.lin at rock-chips.com>
>>> ---
>>>
>>> drivers/gpio/gpio-rockchip.c | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/gpio/gpio-rockchip.c b/drivers/gpio/gpio-rockchip.c
>>> index ac1b939..08ea644 100644
>>> --- a/drivers/gpio/gpio-rockchip.c
>>> +++ b/drivers/gpio/gpio-rockchip.c
>>> @@ -582,7 +582,7 @@ static int rockchip_gpiolib_register(struct rockchip_pin_bank *bank)
>>> bank->gpio_chip = rockchip_gpiolib_chip;
>>>
>>> gc = &bank->gpio_chip;
>>> - gc->base = bank->pin_base;
>>> + gc->base = -1;
>>> gc->ngpio = bank->nr_pins;
>>> gc->label = bank->name;
>>> gc->parent = bank->dev;
>>> --
>>> 2.7.4
>>>
>>
>> I take it you know first-hand that nobody depends on the predefined
>> GPIO numbering for this driver? If so, I can queue it for v7.1.
>>
>
> I have confirmed internally that nobody depends on the pre-defined
> GPIO numbering.
This patch is causing boot issues on my Rock Pi 4 (RK3399) board using
next-20260409 kernel where this patch has been applied as c8079f83e0bf.
[ 0.082771] rockchip-gpio ff720000.gpio: probed /pinctrl/gpio at ff720000
[ 0.083531] rockchip-gpio ff730000.gpio: probed /pinctrl/gpio at ff730000
[ 0.084110] rockchip-gpio ff780000.gpio: probed /pinctrl/gpio at ff780000
[ 0.084746] rockchip-gpio ff788000.gpio: probed /pinctrl/gpio at ff788000
[ 0.085389] rockchip-gpio ff790000.gpio: probed /pinctrl/gpio at ff790000
--
[ 0.212208] rockchip-pinctrl pinctrl: pin 637 is not registered so it cannot be requested
[ 0.212271] rockchip-pinctrl pinctrl: error -EINVAL: pin-637 (gpio3:637)
[ 0.212344] leds-gpio leds: error -EINVAL: Failed to get GPIO '/leds/led-0'
[ 0.212389] leds-gpio leds: probe with driver leds-gpio failed with error -22
--
[ 0.607545] rockchip-pinctrl pinctrl: pin 519 is not registered so it cannot be requested
[ 0.608775] rockchip-pinctrl pinctrl: error -EINVAL: pin-519 (gpio0:519)
[ 0.610003] dwmmc_rockchip fe320000.mmc: probe with driver dwmmc_rockchip failed with error -22
--
[ 0.805882] rockchip-pinctrl pinctrl: pin 547 is not registered so it cannot be requested
[ 0.806672] rockchip-pinctrl pinctrl: error -EINVAL: pin-547 (gpio1:547)
[ 0.807301] reg-fixed-voltage regulator-vbus-typec: error -EINVAL: can't get GPIO
[ 0.807307] rockchip-pinctrl pinctrl: pin 602 is not registered so it cannot be requested
[ 0.807970] reg-fixed-voltage regulator-vbus-typec: probe with driver reg-fixed-voltage failed with error -22
[ 0.808692] rockchip-pinctrl pinctrl: error -EINVAL: pin-602 (gpio2:602)
[ 0.810279] reg-fixed-voltage regulator-vcc3v3-pcie: error -EINVAL: can't get GPIO
[ 0.810284] rockchip-pinctrl pinctrl: pin 665 is not registered so it cannot be requested
[ 0.810299] rockchip-pinctrl pinctrl: error -EINVAL: pin-665 (gpio4:665)
[ 0.810960] reg-fixed-voltage regulator-vcc3v3-pcie: probe with driver reg-fixed-voltage failed with error -22
[ 0.811679] reg-fixed-voltage regulator-vcc5v0-host: error -EINVAL: can't get GPIO
[ 0.813943] reg-fixed-voltage regulator-vcc5v0-host: probe with driver reg-fixed-voltage failed with error -22
--
[ 0.867788] rockchip-pinctrl pinctrl: pin 522 is not registered so it cannot be requested
[ 0.868537] rockchip-pinctrl pinctrl: error -EINVAL: pin-522 (gpio0:522)
[ 0.869166] pwrseq_simple sdio-pwrseq: error -EINVAL: reset GPIOs not ready
[ 0.869798] pwrseq_simple sdio-pwrseq: probe with driver pwrseq_simple failed with error -22
--
[ 0.940365] rockchip-pinctrl pinctrl: pin 623 is not registered so it cannot be requested
[ 0.941084] rockchip-pinctrl pinctrl: error -EINVAL: pin-623 (gpio3:623)
[ 0.941823] rk_gmac-dwmac fe300000.ethernet: error -EINVAL: Cannot register the MDIO bus
[ 0.942542] rk_gmac-dwmac fe300000.ethernet: error -EINVAL: MDIO bus (id: 0) registration failed
[ 0.943772] rk_gmac-dwmac fe300000.ethernet: probe with driver rk_gmac-dwmac failed with error -22
With c8079f83e0bf ("gpio: rockchip: convert to dynamic GPIO base
allocation") reverted everything goes back to normal and gpio/pinctrl
and all devices depending on gpio works again.
Regards,
Jonas
>
> Thanks.
>
>> Bart
>>
More information about the Linux-rockchip
mailing list