[PATCH] ipq40xx: google (gale) add reset button

Brian Norris computersforpeace at gmail.com
Sun Mar 26 11:03:28 PDT 2023


Hey,

On Sun, Mar 26, 2023 at 6:29 AM <openwrt at aiyionpri.me> wrote:
>
> From: Jan-Niklas Burfeind <git at aiyionpri.me>
>
> add the external button (GPIO 57) as reset button
>
> Signed-off-by: Jan-Niklas Burfeind <git at aiyionpri.me>
> ---
>
> Good afternoon everyone.
> This is just a minor addition to the google wifi router
> OpenWrt supports.
>
> I hope I didn't miss anything.
>
> Yours
> aiyion

Thanks for doing this! This looks pretty good, although I'd make a
small addition. See below:

>  .../files/arch/arm/boot/dts/qcom-ipq4019-wifi.dts      | 10 ++++++++++
>  1 file changed, 10 insertions(+)
>
> diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-wifi.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-wifi.dts
> index 65f5933305..85ce73afb3 100644
> --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-wifi.dts
> +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-wifi.dts
> @@ -49,6 +49,16 @@
>                         };
>                 };
>         };
> +
> +       keys {
> +               compatible = "gpio-keys";
> +
> +               reset {
> +                       label = "reset";
> +                       gpios = <&tlmm 57 GPIO_ACTIVE_LOW>;

Normally, you want a pinctrl setting too, to tell the pin controller
how to configure any biases, pull-ups/downs, etc. In this case, the
configuration is trivial, so it probably doesn't make much difference,
but for completeness, we should still add it. See how below we have
this pinmux definition already:

fw_pinmux {
  wp {
    pins = "gpio53";
    output-low;
  };
  recovery {
    pins = "gpio57";
    bias-none;
  };
  developer {
    pins = "gpio41";
    bias-none;
  };
};

So, you just need to add a phandle reference, and it'll look something like:

keys {
  compatible = "gpio-keys";
  pinctrl-0 = <&fw_pinmux>;
  pinctrl-names = "default";
  ...
};
...
fw_pinmux: fw_pinmux {
  recovery {
    ...
  };
};

You can see an approximately similar change I made recently here:

https://git.openwrt.org/?p=openwrt/openwrt.git;a=commitdiff;h=4c1d7787d460cd0798eb01a42c6a8a7fc96e2999

If you have trouble with that, I can play with it myself and send an
updated version 2.

Thanks,
Brian

> +                       linux,code = <KEY_RESTART>;
> +               };
> +       };
>  };
>
>  &tlmm {
> --
> 2.40.0
>



More information about the openwrt-devel mailing list