Re: [PATCH] gpio: shared: call gpio_chip::of_xlate() if set
From: Bartosz Golaszewski
Date: Tue Mar 17 2026 - 09:46:14 EST
On Tue, Mar 17, 2026 at 1:53 PM Jon Hunter <jonathanh@xxxxxxxxxx> wrote:
>
> >
> > I suppose this is not a reset-gpio-like use-case? Could you point me
> > to the DTS you're using? I've reproduced the bug with a dummy dts and
> > xlate function in gpio-sim and this patch fixes it but maybe I'm
> > missing something.
>
> So the board I originally observed this on is a farm board with camera
> hardware I don't have. So like you I started off reproducing locally
> with a dummy dts by making the following change ...
>
> diff --git a/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701.dtsi b/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701.dtsi
> index f6cad29355e6..5e62ffb425f4 100644
> --- a/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701.dtsi
> +++ b/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701.dtsi
> @@ -389,14 +389,14 @@ gpio-keys {
>
> key-force-recovery {
> label = "Force Recovery";
> - gpios = <&gpio TEGRA234_MAIN_GPIO(G, 0) GPIO_ACTIVE_LOW>;
> + gpios = <&gpio TEGRA234_MAIN_GPIO(AF, 2) GPIO_ACTIVE_LOW>;
The difference between my test and this is that I used foo-gpios vs
gpios here. I was thinking this would be the culprit but when I
changed my setup to replicate it, it works fine...
> linux,input-type = <EV_KEY>;
> linux,code = <BTN_1>;
> };
>
> key-power {
> label = "Power";
> - gpios = <&gpio_aon TEGRA234_AON_GPIO(EE, 4) GPIO_ACTIVE_LOW>;
> + gpios = <&gpio TEGRA234_MAIN_GPIO(AF, 2) GPIO_ACTIVE_LOW>;
> linux,input-type = <EV_KEY>;
> linux,code = <KEY_POWER>;
> wakeup-event-action = <EV_ACT_ASSERTED>;
>
>
> With this I see ...
>
> gpiolib_shared: GPIO 154 owned by tegra234-gpio is shared by multiple consumers
> gpiolib_shared: Setting up a shared GPIO entry for key-force-recovery (con_id: '(none)')
> gpiolib_shared: Created an auxiliary GPIO proxy gpiolib_shared.proxy.3 for GPIO device tegra234-gpio
> gpiolib_shared: Setting up a shared GPIO entry for key-power (con_id: '(none)')
> gpiolib_shared: Created an auxiliary GPIO proxy gpiolib_shared.proxy.4 for GPIO device tegra234-gpio
This looks correct.
> ...
> gpio-keys gpio-keys: error -ENXIO: Unable to determine IRQ# for button #0
>
Is the above error linked to the issue?
> I am not sure if this is because these are child nodes of gpio-keys?
> Obviously this is not a proper example, but something quick and dirty
> for local testing :-)
>
Let me create a setup with GPIO keys then.
Bart