diff mbox series

[2/2] arm64: dts: qcom: pm8994: Add PON and resin binding

Message ID 20180731063239.32373-2-vkoul@kernel.org (mailing list archive)
State New, archived
Delegated to: Andy Gross
Headers show
Series [1/2] arm64: dts: qcom: pm8916: Add PON and resin binding | expand

Commit Message

Vinod Koul July 31, 2018, 6:32 a.m. UTC
Add PON binding and pwrkey and resin as child nodes for PON driver. Also
add additional properties for pwrkey i.e., linux,code and pon_child

Signed-off-by: Vinod Koul <vkoul@kernel.org>
---
 arch/arm64/boot/dts/qcom/pm8994.dtsi | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

Comments

Bjorn Andersson July 31, 2018, 7:01 a.m. UTC | #1
On Mon 30 Jul 23:32 PDT 2018, Vinod Koul wrote:

> Add PON binding and pwrkey and resin as child nodes for PON driver. Also
> add additional properties for pwrkey i.e., linux,code and pon_child
> 
> Signed-off-by: Vinod Koul <vkoul@kernel.org>
> ---
>  arch/arm64/boot/dts/qcom/pm8994.dtsi | 26 ++++++++++++++++++++++++++
>  1 file changed, 26 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/qcom/pm8994.dtsi b/arch/arm64/boot/dts/qcom/pm8994.dtsi
> index 80024c0b1c7c..bf41cae5b554 100644
> --- a/arch/arm64/boot/dts/qcom/pm8994.dtsi
> +++ b/arch/arm64/boot/dts/qcom/pm8994.dtsi
> @@ -1,6 +1,7 @@
>  // SPDX-License-Identifier: GPL-2.0
>  #include <dt-bindings/interrupt-controller/irq.h>
>  #include <dt-bindings/spmi/spmi.h>
> +#include <dt-bindings/input/linux-event-codes.h>
>  
>  &spmi_bus {
>  
> @@ -17,6 +18,31 @@
>  			interrupts = <0x0 0x61 0x1 IRQ_TYPE_EDGE_RISING>;
>  		};
>  
> +		pon@800 {
> +			compatible = "qcom,pm8916-pon";
> +
> +			reg = <0x800>;
> +			mode-bootloader = <0x2>;
> +			mode-recovery = <0x1>;
> +
> +			pwrkey {
> +				compatible = "qcom,pm8941-pwrkey";
> +				interrupts = <0x0 0x8 0 IRQ_TYPE_EDGE_BOTH>;
> +				debounce = <15625>;
> +				bias-pull-up;
> +				linux,code = <KEY_POWER>;
> +			};
> +

Didn't think of this in the 8916 patch, but while the reboot reasons and
power key is pretty generic the mapping of RESIN to volume down isn't.

So while we should specify the pwrkey here in the pmic dtsi, I think we
should move the resin to the device dtsi.


Content of the change looks good though.

Regards,
Bjorn

> +			resin {
> +				compatible = "qcom,pm8941-resin";
> +				interrupts = <0x0 0x8 1 IRQ_TYPE_EDGE_BOTH>;
> +				debounce = <15625>;
> +				bias-pull-up;
> +				linux,code = <KEY_VOLUMEDOWN>;
> +			};
> +
> +		};
> +
>  		pm8994_gpios: gpios@c000 {
>  			compatible = "qcom,pm8994-gpio";
>  			reg = <0xc000>;
> -- 
> 2.14.4
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Vinod Koul July 31, 2018, 7:24 a.m. UTC | #2
On 31-07-18, 00:01, Bjorn Andersson wrote:
> On Mon 30 Jul 23:32 PDT 2018, Vinod Koul wrote:
> > +		pon@800 {
> > +			compatible = "qcom,pm8916-pon";
> > +
> > +			reg = <0x800>;
> > +			mode-bootloader = <0x2>;
> > +			mode-recovery = <0x1>;
> > +
> > +			pwrkey {
> > +				compatible = "qcom,pm8941-pwrkey";
> > +				interrupts = <0x0 0x8 0 IRQ_TYPE_EDGE_BOTH>;
> > +				debounce = <15625>;
> > +				bias-pull-up;
> > +				linux,code = <KEY_POWER>;
> > +			};
> > +
> 
> Didn't think of this in the 8916 patch, but while the reboot reasons and
> power key is pretty generic the mapping of RESIN to volume down isn't.
> 
> So while we should specify the pwrkey here in the pmic dtsi, I think we
> should move the resin to the device dtsi.

I agree with you on that, how does this work wrt DT semantics:

I should do:

           pon@800 {
                   compatible = "qcom,pm8916-pon";

                   reg = <0x800>;
                   mode-bootloader = <0x2>;
                   mode-recovery = <0x1>;

                   pwrkey {
                           compatible = "qcom,pm8941-pwrkey";
                           interrupts = <0x0 0x8 0 IRQ_TYPE_EDGE_BOTH>;
                           debounce = <15625>;
                           bias-pull-up;
                           linux,code = <KEY_POWER>;
                   };

for soc DT and add below for device DT..

           pon@800 {
			resin {
				compatible = "qcom,pm8941-resin";
				interrupts = <0x0 0x8 1 IRQ_TYPE_EDGE_BOTH>;
				debounce = <15625>;
				bias-pull-up;
				linux,code = <KEY_VOLUMEDOWN>;
			};
        };
Vinod Koul July 31, 2018, 12:58 p.m. UTC | #3
On 31-07-18, 12:54, Vinod wrote:
> On 31-07-18, 00:01, Bjorn Andersson wrote:
> > On Mon 30 Jul 23:32 PDT 2018, Vinod Koul wrote:
> > > +		pon@800 {
> > > +			compatible = "qcom,pm8916-pon";
> > > +
> > > +			reg = <0x800>;
> > > +			mode-bootloader = <0x2>;
> > > +			mode-recovery = <0x1>;
> > > +
> > > +			pwrkey {
> > > +				compatible = "qcom,pm8941-pwrkey";
> > > +				interrupts = <0x0 0x8 0 IRQ_TYPE_EDGE_BOTH>;
> > > +				debounce = <15625>;
> > > +				bias-pull-up;
> > > +				linux,code = <KEY_POWER>;
> > > +			};
> > > +
> > 
> > Didn't think of this in the 8916 patch, but while the reboot reasons and
> > power key is pretty generic the mapping of RESIN to volume down isn't.
> > 
> > So while we should specify the pwrkey here in the pmic dtsi, I think we
> > should move the resin to the device dtsi.
> 
> I agree with you on that, how does this work wrt DT semantics:
> 
> I should do:

yeah this seems to work with a bit of tweak, will send v2 shortly..

> 
>            pon@800 {
>                    compatible = "qcom,pm8916-pon";
> 
>                    reg = <0x800>;
>                    mode-bootloader = <0x2>;
>                    mode-recovery = <0x1>;
> 
>                    pwrkey {
>                            compatible = "qcom,pm8941-pwrkey";
>                            interrupts = <0x0 0x8 0 IRQ_TYPE_EDGE_BOTH>;
>                            debounce = <15625>;
>                            bias-pull-up;
>                            linux,code = <KEY_POWER>;
>                    };
> 
> for soc DT and add below for device DT..
> 
>            pon@800 {
> 			resin {
> 				compatible = "qcom,pm8941-resin";
> 				interrupts = <0x0 0x8 1 IRQ_TYPE_EDGE_BOTH>;
> 				debounce = <15625>;
> 				bias-pull-up;
> 				linux,code = <KEY_VOLUMEDOWN>;
> 			};
>         };
> 
> -- 
> ~Vinod
> --
> To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/qcom/pm8994.dtsi b/arch/arm64/boot/dts/qcom/pm8994.dtsi
index 80024c0b1c7c..bf41cae5b554 100644
--- a/arch/arm64/boot/dts/qcom/pm8994.dtsi
+++ b/arch/arm64/boot/dts/qcom/pm8994.dtsi
@@ -1,6 +1,7 @@ 
 // SPDX-License-Identifier: GPL-2.0
 #include <dt-bindings/interrupt-controller/irq.h>
 #include <dt-bindings/spmi/spmi.h>
+#include <dt-bindings/input/linux-event-codes.h>
 
 &spmi_bus {
 
@@ -17,6 +18,31 @@ 
 			interrupts = <0x0 0x61 0x1 IRQ_TYPE_EDGE_RISING>;
 		};
 
+		pon@800 {
+			compatible = "qcom,pm8916-pon";
+
+			reg = <0x800>;
+			mode-bootloader = <0x2>;
+			mode-recovery = <0x1>;
+
+			pwrkey {
+				compatible = "qcom,pm8941-pwrkey";
+				interrupts = <0x0 0x8 0 IRQ_TYPE_EDGE_BOTH>;
+				debounce = <15625>;
+				bias-pull-up;
+				linux,code = <KEY_POWER>;
+			};
+
+			resin {
+				compatible = "qcom,pm8941-resin";
+				interrupts = <0x0 0x8 1 IRQ_TYPE_EDGE_BOTH>;
+				debounce = <15625>;
+				bias-pull-up;
+				linux,code = <KEY_VOLUMEDOWN>;
+			};
+
+		};
+
 		pm8994_gpios: gpios@c000 {
 			compatible = "qcom,pm8994-gpio";
 			reg = <0xc000>;