mbox series

[0/6] ARM: dts: qcom: apq8074-dragonboard: enable additional devices

Message ID 20230508003309.2363787-1-dmitry.baryshkov@linaro.org
Headers show
Series ARM: dts: qcom: apq8074-dragonboard: enable additional devices | expand

Message

Dmitry Baryshkov May 8, 2023, 12:33 a.m. UTC
Add support for buttons, LEDs and coincell charger found on the APQ8074
dragonboard device.

For PM8941 we don't have a defined field to store the reset reason.
Support wrapping pwrkey and resin, but without writing the reset
reason.

Dmitry Baryshkov (6):
  dt-bindings: power: reset: qcom-pon: define pm8941-pon
  power: reset: qcom-pon: add support for pm8941-pon
  ARM: dts: qcom-pm8941: add resin support
  ARM: dts: qcom: apq8074-dragonboard: add resin and gpio keys
  ARM: dts: qcom: apq8074-dragonboard: add onboard leds
  ARM: dts: qcom: apq8074-dragonboard: enable coincell charger

 .../bindings/power/reset/qcom,pon.yaml        |  2 +
 .../arm/boot/dts/qcom-apq8074-dragonboard.dts | 71 +++++++++++++++++++
 arch/arm/boot/dts/qcom-pm8941.dtsi            | 22 ++++--
 drivers/power/reset/qcom-pon.c                | 22 ++++--
 4 files changed, 105 insertions(+), 12 deletions(-)

Comments

Konrad Dybcio May 8, 2023, 9:01 a.m. UTC | #1
On 8.05.2023 02:33, Dmitry Baryshkov wrote:
> Wrap existing pwrkey and new resin nodes into the new pon node to enable
> volume-down key support on platforms using pm8941 PMIC.
> 
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---
>  arch/arm/boot/dts/qcom-pm8941.dtsi | 22 +++++++++++++++++-----
>  1 file changed, 17 insertions(+), 5 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/qcom-pm8941.dtsi b/arch/arm/boot/dts/qcom-pm8941.dtsi
> index a821f0368a28..ce30946ccf58 100644
> --- a/arch/arm/boot/dts/qcom-pm8941.dtsi
> +++ b/arch/arm/boot/dts/qcom-pm8941.dtsi
> @@ -19,12 +19,24 @@ rtc@6000 {
>  			interrupts = <0x0 0x61 0x1 IRQ_TYPE_EDGE_RISING>;
>  		};
>  
> -		pwrkey@800 {
> -			compatible = "qcom,pm8941-pwrkey";
> +		pon@800 {
> +			compatible = "qcom,pm8916-pon";
You just added a new one! :P

Konrad
>  			reg = <0x800>;
> -			interrupts = <0x0 0x8 0 IRQ_TYPE_EDGE_BOTH>;
> -			debounce = <15625>;
> -			bias-pull-up;
> +
> +			pwrkey {
> +				compatible = "qcom,pm8941-pwrkey";
> +				interrupts = <0x0 0x8 0 IRQ_TYPE_EDGE_BOTH>;
> +				debounce = <15625>;
> +				bias-pull-up;
> +			};
> +
> +			pm8941_resin: resin {
> +				compatible = "qcom,pm8941-resin";
> +				interrupts = <0x0 0x8 1 IRQ_TYPE_EDGE_BOTH>;
> +				debounce = <15625>;
> +				bias-pull-up;
> +				status = "disabled";
> +			};
>  		};
>  
>  		usb_id: usb-detect@900 {
Konrad Dybcio May 8, 2023, 9:02 a.m. UTC | #2
On 8.05.2023 02:33, Dmitry Baryshkov wrote:
> The dragonboard as three LEDs: red, green and blue. Add corresponding
> description.
> 
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---
>  .../arm/boot/dts/qcom-apq8074-dragonboard.dts | 24 +++++++++++++++++++
>  1 file changed, 24 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/qcom-apq8074-dragonboard.dts b/arch/arm/boot/dts/qcom-apq8074-dragonboard.dts
> index 2017bdf81677..16d609b85dfe 100644
> --- a/arch/arm/boot/dts/qcom-apq8074-dragonboard.dts
> +++ b/arch/arm/boot/dts/qcom-apq8074-dragonboard.dts
> @@ -1,6 +1,7 @@
>  // SPDX-License-Identifier: GPL-2.0
>  #include <dt-bindings/gpio/gpio.h>
>  #include <dt-bindings/input/input.h>
> +#include <dt-bindings/leds/common.h>
>  #include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
>  #include "qcom-msm8974.dtsi"
>  #include "qcom-pm8841.dtsi"
> @@ -126,6 +127,29 @@ pinconf {
>          };
>  };
>  
> +&pm8941_lpg {
> +        qcom,power-source = <1>;
> +	status = "okay";
> +
> +	led@5 {
> +		reg = <5>;
> +                color = <LED_COLOR_ID_BLUE>;
> +                function = LED_FUNCTION_INDICATOR;
> +	};
> +
> +	led@6 {
> +		reg = <6>;
> +                color = <LED_COLOR_ID_GREEN>;
> +                function = LED_FUNCTION_INDICATOR;
> +	};
> +
> +	led@7 {
> +		reg = <7>;
> +                color = <LED_COLOR_ID_RED>;
> +                function = LED_FUNCTION_INDICATOR;
> +	};
This introduces broken indentation

Konrad
> +};
> +
>  &pm8941_resin {
>  	status = "okay";
>  	linux,code = <KEY_VOLUMEDOWN>;