[PATCH v2 2/5] gpio: qcom_pmic: rework pwrkey driver into a button driver

Stephan Gerhold stephan at gerhold.net
Thu Nov 9 15:27:06 CET 2023


On Wed, Nov 08, 2023 at 04:20:54PM +0000, Caleb Connolly wrote:
> The power and resin keys were implemented as GPIOs here, but their only
> use would be as buttons. Avoid the additional layer of introspection and
> rework this driver into a button driver.
> 
> While we're here, replace the "qcom,pm8998-pwrkey" compatible with
> "qcom,pm8941-pwrkey" to match upstream (Linux).
> 
> The dragonboard410c and 820c boards are adjusted to benefit from this
> change too, simplify their custom board init code.
> 
> Signed-off-by: Caleb Connolly <caleb.connolly at linaro.org>
> ---
>  MAINTAINERS                                      |   1 +
>  arch/arm/dts/dragonboard410c-uboot.dtsi          |  14 +-
>  arch/arm/dts/dragonboard410c.dts                 |  22 ++-
>  arch/arm/dts/dragonboard820c-uboot.dtsi          |  15 +--
>  arch/arm/dts/dragonboard820c.dts                 |  23 +++-
>  arch/arm/dts/dragonboard845c-uboot.dtsi          |  11 --
>  arch/arm/dts/dragonboard845c.dts                 |   4 +
>  arch/arm/dts/sdm845.dtsi                         |  23 +++-
>  arch/arm/dts/starqltechn.dts                     |  20 +--
>  arch/arm/mach-snapdragon/Kconfig                 |   3 +
>  arch/arm/mach-snapdragon/init_sdm845.c           |  45 ++-----
>  board/qualcomm/dragonboard410c/dragonboard410c.c |  31 ++---
>  board/qualcomm/dragonboard820c/dragonboard820c.c |  29 ++--
>  drivers/button/Kconfig                           |   9 ++
>  drivers/button/Makefile                          |   1 +
>  drivers/button/button-qcom-pmic.c                | 165 +++++++++++++++++++++++
>  drivers/gpio/Kconfig                             |   3 +-
>  drivers/gpio/qcom_pmic_gpio.c                    | 104 --------------
>  18 files changed, 275 insertions(+), 248 deletions(-)
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index f6d63c8ab563..8cd102eaa070 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -572,6 +572,7 @@ M:	Neil Armstrong <neil.armstrong at linaro.org>
>  R:	Sumit Garg <sumit.garg at linaro.org>
>  S:	Maintained
>  F:	arch/arm/mach-snapdragon/
> +F:	drivers/button/button-qcom-pmic.c
>  F:	drivers/clk/qcom/
>  F:	drivers/gpio/msm_gpio.c
>  F:	drivers/mmc/msm_sdhci.c
> diff --git a/arch/arm/dts/dragonboard410c-uboot.dtsi b/arch/arm/dts/dragonboard410c-uboot.dtsi
> index 3b0bd0ed0a1b..39b03a30702c 100644
> --- a/arch/arm/dts/dragonboard410c-uboot.dtsi
> +++ b/arch/arm/dts/dragonboard410c-uboot.dtsi
> @@ -5,6 +5,9 @@
>   * (C) Copyright 2015 Mateusz Kulikowski <mateusz.kulikowski at gmail.com>
>   */
>  
> +#include <dt-bindings/input/linux-event-codes.h>
> +#include <dt-bindings/interrupt-controller/irq.h>
> +

You can drop this again now I guess?

>  / {
>  
>  	smem {
> @@ -42,14 +45,3 @@
>  		gpios = <&pm8916_gpios 3 0>;
>  	};
>  };
> -
> -
> -&pm8916_pon {
> -	key_vol_down {
> -		gpios = <&pm8916_pon 1 0>;
> -	};
> -
> -	key_power {
> -		gpios = <&pm8916_pon 0 0>;
> -	};
> -};
> [...]
> diff --git a/arch/arm/dts/dragonboard820c-uboot.dtsi b/arch/arm/dts/dragonboard820c-uboot.dtsi
> index 457728a43ecb..693c0e5efcc4 100644
> --- a/arch/arm/dts/dragonboard820c-uboot.dtsi
> +++ b/arch/arm/dts/dragonboard820c-uboot.dtsi
> @@ -5,6 +5,9 @@
>   * (C) Copyright 2017 Jorge Ramirez-Ortiz <jorge.ramirez-ortiz at linaro.org>
>   */
>  
> +#include <dt-bindings/input/linux-event-codes.h>
> +#include <dt-bindings/interrupt-controller/irq.h>
> +

Same here.

Thanks,
Stephan


More information about the U-Boot mailing list