Skip to contentSkip to conversation

Initial support for LG Nexus 5 phone (hammerhead)

PATCH Superseded Bhushan Shah 5 participants 13 messages Jul 17, 2016 – Jul 18, 2016 2 messages not in the archive

Subsystems (3)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

cover Initial support for LG Nexus 5 phone (hammerhead)

This patchset adds support for LG Nexus 5 phone, codenamed hammerhead.

Initial version have following supported,

- Serial console over headphone jack
- pm8841 and pm8941 regulator nodes
- Hardware keys (volume_up and volume_down)

Values for the regulator nodes are taken from following files in downstream msm kernel tree, branch android-msm-hammerhead-3.4-marshmallow-mr2

- arch/arm/boot/dts/msm8974-regulator.dtsi
- arch/arm/boot/dts/msm8974-hammerhead/msm8974-hammerhead.dtsi

Values are verified against kmsg from downstream kernel as well.

However, it seems regulator-max-microvolt settings are not respected, for example,

l19{
	regulator-min-microvolt = <3000000>;
	regulator-max-microvolt = <3300000>;
};

but in kmsg, it says,

[    1.753401] l19: supplied by vph-pwr                
[    1.757418] l19: Bringing 0uV into 3000000-3000000uV

Relavant line from kmsg of downstream kernel says,

[    0.255590] 8941_l19: 3000 <--> 3300 mV at 3300 mV normal idle

Is there anything wrong with dts?

Cc Andy Gross <[email protected]>
Cc Bjorn Andersson <[email protected]>
Cc David Brown <[email protected]>
Cc Mark Rutland <[email protected]>
Cc Rob Herring <[email protected]>
Cc Russell King <[email protected]>
Cc devicetree at vger.kernel.org
Cc linux-arm-kernel at lists.infradead.org
Cc linux-arm-msm at vger.kernel.org

Bhushan Shah (3):
ARM: dts: qcom: Add initial DTS for LG Nexus 5 Phone
ARM: dts: msm8974-hammerhead: Add regulator nodes for hammerhead
ARM: dts: msm8974-hammerhead: Introduce gpio-keys nodes

 arch/arm/boot/dts/Makefile                         |   1 +
 .../dts/qcom-msm8974-lge-nexus5-hammerhead.dts     | 296 +++++++++++++++++++++
 2 files changed, 297 insertions(+)
 create mode 100644 arch/arm/boot/dts/qcom-msm8974-lge-nexus5-hammerhead.dts
Signature · 1 line
2.9.0
#1 lore raw

PATCH 1/3 ARM: dts: qcom: Add initial DTS for LG Nexus 5 Phone

This DTS file have support LG Nexus 5 (codenamed hammerhead). Initial version have support for just serial console over headphone jack.

Cc Andy Gross <[email protected]>
Cc Bjorn Andersson <[email protected]>
Cc David Brown <[email protected]>
Cc Mark Rutland <[email protected]>
Cc Rob Herring <[email protected]>
Cc Russell King <[email protected]>
Cc devicetree at vger.kernel.org
Cc linux-arm-kernel at lists.infradead.org
Cc linux-arm-msm at vger.kernel.org
---
 arch/arm/boot/dts/Makefile                         |  1 +
 .../dts/qcom-msm8974-lge-nexus5-hammerhead.dts     | 25 ++++++++++++++++++++++
 2 files changed, 26 insertions(+)
 create mode 100644 arch/arm/boot/dts/qcom-msm8974-lge-nexus5-hammerhead.dts
arch/arm/boot/dts/Makefile +1 -0
index 414b427..13947ec 100644
@@ -584,6 +584,7 @@ dtb-$(CONFIG_ARCH_QCOM) += \
 	qcom-ipq8064-ap148.dtb \
 	qcom-msm8660-surf.dtb \
 	qcom-msm8960-cdp.dtb \
+	qcom-msm8974-lge-nexus5-hammerhead.dtb \
 	qcom-msm8974-sony-xperia-honami.dtb
 dtb-$(CONFIG_ARCH_REALVIEW) += \
 	arm-realview-pb1176.dtb \
arch/arm/boot/dts/qcom-msm8974-lge-nexus5-hammerhead.dts new file +25 -0
new file mode 100644
index 0000000..88d494f
@@ -0,0 +1,25 @@
+#include "qcom-msm8974.dtsi"
+#include "qcom-pm8841.dtsi"
+#include "qcom-pm8941.dtsi"
+
+/ {
+	model = "LGE MSM 8974 HAMMERHEAD";
+	compatible = "qcom,msm8974";
+	qcom,msm-id = <126 150 0x20002 0xB>;
+
+	aliases {
+		serial0 = &blsp1_uart1;
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+	};
+};
+
+&soc {
+
+	serial at f991d000 {
+		status = "ok";
+	};
+
+};
Signature · 1 line
2.9.0
#2 lore raw

PATCH 1/3 ARM: dts: qcom: Add initial DTS for LG Nexus 5 Phone

On Sun 17 Jul 03:52 PDT 2016, Bhushan Shah wrote:

[..]

arch/arm/boot/dts/qcom-msm8974-lge-nexus5-hammerhead.dts line 7

Quoted 13 lines
arch/arm/boot/dts/qcom-msm8974-lge-nexus5-hammerhead.dts new file +7 -0
new file mode 100644
index 0000000..88d494f
@@ -0,0 +1,25 @@
+#include "qcom-msm8974.dtsi"
+#include "qcom-pm8841.dtsi"
+#include "qcom-pm8941.dtsi"
+
+/ {
+	model = "LGE MSM 8974 HAMMERHEAD";
+	compatible = "qcom,msm8974";

We should have a "lg,hammerhead" here as well, prior to "qcom,msm8974". Preferably some sort of "product family" definition, if we know of any to reduce the risk of conflicts with any other hammerheads from LGE.

arch/arm/boot/dts/qcom-msm8974-lge-nexus5-hammerhead.dts line 8

Quoted 1 line
arch/arm/boot/dts/qcom-msm8974-lge-nexus5-hammerhead.dts new file +1 -0
+	qcom,msm-id = <126 150 0x20002 0xB>;

We've decided against defining qcom,msm-id in the dts files, so please drop this.

Instead use dtbTool from git://codeaurora.org/quic/kernel/skales which should inject the correct information based on the compatible.

arch/arm/boot/dts/qcom-msm8974-lge-nexus5-hammerhead.dts line 20

Quoted 12 lines
arch/arm/boot/dts/qcom-msm8974-lge-nexus5-hammerhead.dts new file +12 -0
+
+	aliases {
+		serial0 = &blsp1_uart1;
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+	};
+};
+
+&soc {
+

As you're dropping msm-id, please also drop this empty line.

arch/arm/boot/dts/qcom-msm8974-lge-nexus5-hammerhead.dts line 24

Quoted 4 lines
arch/arm/boot/dts/qcom-msm8974-lge-nexus5-hammerhead.dts new file +4 -0
+	serial at f991d000 {
+		status = "ok";
+	};
+

Dito.

arch/arm/boot/dts/qcom-msm8974-lge-nexus5-hammerhead.dts line 25

Quoted 1 line
arch/arm/boot/dts/qcom-msm8974-lge-nexus5-hammerhead.dts new file +1 -0
+};

Regards,
Bjorn

#3 lore raw

PATCH 2/3 ARM: dts: msm8974-hammerhead: Add regulator nodes for hammerhead

In reply to Bhushan Shah
Cc Andy Gross <[email protected]>
Cc Bjorn Andersson <[email protected]>
Cc David Brown <[email protected]>
Cc Rob Herring <[email protected]>
Cc Mark Rutland <[email protected]>
Cc Russell King <[email protected]>
---
 .../dts/qcom-msm8974-lge-nexus5-hammerhead.dts     | 241 +++++++++++++++++++++
 1 file changed, 241 insertions(+)
arch/arm/boot/dts/qcom-msm8974-lge-nexus5-hammerhead.dts +241 -0
index 88d494f..29fa0bb 100644
@@ -1,6 +1,8 @@
 #include "qcom-msm8974.dtsi"
 #include "qcom-pm8841.dtsi"
 #include "qcom-pm8941.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
 
 / {
 	model = "LGE MSM 8974 HAMMERHEAD";
@@ -14,6 +16,234 @@
 	chosen {
 		stdout-path = "serial0:115200n8";
 	};
+
+	smd {
+		rpm {
+			rpm_requests {
+				pm8841-regulators {
+					s1 {
+						regulator-min-microvolt = <675000>;
+						regulator-max-microvolt = <1050000>;
+					};
+
+					s2 {
+						regulator-min-microvolt = <500000>;
+						regulator-max-microvolt = <1050000>;
+					};
+
+					s3 {
+						regulator-min-microvolt = <1050000>;
+						regulator-max-microvolt = <1050000>;
+					};
+
+					s4 {
+						regulator-min-microvolt = <815000>;
+						regulator-max-microvolt = <900000>;
+					};
+				};
+
+				pm8941-regulators {
+					vdd_l1_l3-supply = <&pm8941_s1>;
+					vdd_l2_lvs1_2_3-supply = <&pm8941_s3>;
+					vdd_l4_l11-supply = <&pm8941_s1>;
+					vdd_l5_l7-supply = <&pm8941_s2>;
+					vdd_l6_l12_l14_l15-supply = <&pm8941_s2>;
+					vdd_l8_l16_l18_l19-supply = <&vph_pwr_reg>;
+					vdd_l9_l10_l17_l22-supply = <&vreg_boost>;
+					vdd_l13_l20_l23_l24-supply = <&vreg_boost>;
+					vdd_l21-supply = <&vreg_boost>;
+
+					s1 {
+						regulator-min-microvolt = <1300000>;
+						regulator-max-microvolt = <1300000>;
+
+						regulator-always-on;
+						regulator-boot-on;
+					};
+
+					s2 {
+						regulator-min-microvolt = <2150000>;
+						regulator-max-microvolt = <2150000>;
+
+						regulator-boot-on;
+					};
+
+					s3 {
+						regulator-min-microvolt = <1800000>;
+						regulator-max-microvolt = <1800000>;
+
+						regulator-always-on;
+						regulator-boot-on;
+					};
+
+					l1 {
+						regulator-min-microvolt = <1225000>;
+						regulator-max-microvolt = <1225000>;
+
+						regulator-always-on;
+						regulator-boot-on;
+					};
+
+					l2 {
+						regulator-min-microvolt = <1200000>;
+						regulator-max-microvolt = <1200000>;
+					};
+
+					l3 {
+						regulator-min-microvolt = <1225000>;
+						regulator-max-microvolt = <1225000>;
+					};
+
+					l4 {
+						regulator-min-microvolt = <1225000>;
+						regulator-max-microvolt = <1225000>;
+					};
+
+					l5 {
+						regulator-min-microvolt = <1800000>;
+						regulator-max-microvolt = <1800000>;
+					};
+
+					l6 {
+						regulator-min-microvolt = <1800000>;
+						regulator-max-microvolt = <1800000>;
+
+						regulator-boot-on;
+					};
+
+					l7 {
+						regulator-min-microvolt = <1800000>;
+						regulator-max-microvolt = <1800000>;
+
+						regulator-boot-on;
+					};
+
+					l8 {
+						regulator-min-microvolt = <1800000>;
+						regulator-max-microvolt = <1800000>;
+					};
+
+					l9 {
+						regulator-min-microvolt = <1800000>;
+						regulator-max-microvolt = <2950000>;
+					};
+
+					l10 {
+						regulator-min-microvolt = <1800000>;
+						regulator-max-microvolt = <2950000>;
+					};
+
+					l11 {
+						regulator-min-microvolt = <1300000>;
+						regulator-max-microvolt = <1300000>;
+					};
+
+					l12 {
+						regulator-min-microvolt = <1800000>;
+						regulator-max-microvolt = <1800000>;
+
+						regulator-always-on;
+						regulator-boot-on;
+					};
+
+					l13 {
+						regulator-min-microvolt = <1800000>;
+						regulator-max-microvolt = <2950000>;
+
+						regulator-boot-on;
+					};
+
+					l14 {
+						regulator-min-microvolt = <1800000>;
+						regulator-max-microvolt = <1800000>;
+					};
+
+					l15 {
+						regulator-min-microvolt = <2050000>;
+						regulator-max-microvolt = <2050000>;
+					};
+
+					l16 {
+						regulator-min-microvolt = <2700000>;
+						regulator-max-microvolt = <2700000>;
+					};
+
+					l17 {
+						regulator-min-microvolt = <2850000>;
+						regulator-max-microvolt = <2850000>;
+					};
+
+					l18 {
+						regulator-min-microvolt = <2850000>;
+						regulator-max-microvolt = <2850000>;
+					};
+
+					l19 {
+						regulator-min-microvolt = <3000000>;
+						regulator-max-microvolt = <3300000>;
+					};
+
+					l20 {
+						regulator-min-microvolt = <2950000>;
+						regulator-max-microvolt = <2950000>;
+
+						regulator-boot-on;
+					};
+
+					l21 {
+						regulator-min-microvolt = <2950000>;
+						regulator-max-microvolt = <2950000>;
+
+						regulator-boot-on;
+					};
+
+					l22 {
+						regulator-min-microvolt = <3000000>;
+						regulator-max-microvolt = <3300000>;
+					};
+
+					l23 {
+						regulator-min-microvolt = <3000000>;
+						regulator-max-microvolt = <3000000>;
+					};
+
+					l24 {
+						regulator-min-microvolt = <3075000>;
+						regulator-max-microvolt = <3075000>;
+
+						regulator-boot-on;
+					};
+				};
+			};
+		};
+	};
+
+	vreg_boost: vreg-boost {
+		compatible = "regulator-fixed";
+
+		regulator-name = "vreg-boost";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+
+		regulator-always-on;
+		regulator-boot-on;
+
+		gpio = <&pm8941_gpios 21 GPIO_ACTIVE_HIGH>;
+		enable-active-high;
+
+		pinctrl-names = "default";
+		pinctrl-0 = <&boost_bypass_n_pin>;
+	};
+
+	vph_pwr_reg: vph_pwr_reg {
+		compatible = "regulator-fixed";
+		regulator-name = "vph-pwr";
+
+		regulator-min-microvolt = <3600000>;
+		regulator-max-microvolt = <3600000>;
+
+		regulator-always-on;
+	};
 };
 
 &soc {
@@ -23,3 +253,14 @@
 	};
 
 };
+
+&spmi_bus {
+	pm8941@0 {
+		gpios@c000 {
+			boost_bypass_n_pin: boost-bypass {
+				pins = "gpio21";
+				function = "normal";
+			};
+		};
+	};
+};
Signature · 1 line
2.9.0
maintainer
#4 lore raw

Re: [PATCH 2/3] ARM: dts: msm8974-hammerhead: Add regulator nodes for hammerhead

arch/arm/boot/dts/qcom-msm8974-lge-nexus5-hammerhead.dts line 27

Quoted 9 lines · CEST Bhushan Shah
arch/arm/boot/dts/qcom-msm8974-lge-nexus5-hammerhead.dts +9 -0
+
+       smd {
+               rpm {
+                       rpm_requests {
+                               pm8841-regulators {
+                                       s1 {
+                                               regulator-min-microvolt = <675000>;
+                                               regulator-max-microvolt = <1050000>;
+                                       };

Maybe add a label at either the rpm_requests or the pm8841-regulators node so you can add properties in the leaf nodes withoutout having to specify the whole path?

Arnd

#5 lore raw

Re: [PATCH 2/3] ARM: dts: msm8974-hammerhead: Add regulator nodes for hammerhead

Quoted 11 lines · Arnd Bergmann

arch/arm/boot/dts/qcom-msm8974-lge-nexus5-hammerhead.dts line 27

Quoted 9 lines · CEST Bhushan Shah
arch/arm/boot/dts/qcom-msm8974-lge-nexus5-hammerhead.dts +9 -0
+
+       smd {
+               rpm {
+                       rpm_requests {
+                               pm8841-regulators {
+                                       s1 {
+                                               regulator-min-microvolt = <675000>;
+                                               regulator-max-microvolt = <1050000>;
+                                       };
Quoted 3 lines

Maybe add a label at either the rpm_requests or the pm8841-regulators node so you can add properties in the leaf nodes withoutout having to specify the whole path?

Sure, I will adjust patch.

Quoted 1 line

Arnd

#6 lore raw

Re: [PATCH 2/3] ARM: dts: msm8974-hammerhead: Add regulator nodes for hammerhead

Quoted 12 lines · Bhushan Shah
Quoted 11 lines · Arnd Bergmann
Quoted 9 lines · CEST Bhushan Shah
arch/arm/boot/dts/qcom-msm8974-lge-nexus5-hammerhead.dts +9 -0
+
+       smd {
+               rpm {
+                       rpm_requests {
+                               pm8841-regulators {
+                                       s1 {
+                                               regulator-min-microvolt = <675000>;
+                                               regulator-max-microvolt = <1050000>;
+                                       };
Quoted 5 lines
Quoted 3 lines

Maybe add a label at either the rpm_requests or the pm8841-regulators node so you can add properties in the leaf nodes withoutout having to specify the whole path?

Sure, I will adjust patch.

Please don't. After running into several cases where this would end us up in having a multitude of nodes each describing just a snippet of each level we decided not to do so in the general case for the Qualcomm boards.

There are a few where we apparently ended up doing so anyways, but for all other cases of regulators we express the full tree in the dts, so please follow that so we don't mix the styles too much.

Regards,
Bjorn
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): CAOCOHw5MNN9QAea1gJobpEHpn1S0=CTA3mEHzd+dVhv-GShYdg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#8 lore raw

Re: [PATCH 2/3] ARM: dts: msm8974-hammerhead: Add regulator nodes for hammerhead

Quoted 19 lines · CEST Bjorn Andersson
Quoted 12 lines · Bhushan Shah
Quoted 11 lines · Arnd Bergmann
Quoted 9 lines · CEST Bhushan Shah
arch/arm/boot/dts/qcom-msm8974-lge-nexus5-hammerhead.dts +9 -0
+
+       smd {
+               rpm {
+                       rpm_requests {
+                               pm8841-regulators {
+                                       s1 {
+                                               regulator-min-microvolt = <675000>;
+                                               regulator-max-microvolt = <1050000>;
+                                       };
Quoted 5 lines
Quoted 3 lines

Maybe add a label at either the rpm_requests or the pm8841-regulators node so you can add properties in the leaf nodes withoutout having to specify the whole path?

Sure, I will adjust patch.

Quoted 8 lines

Please don't. After running into several cases where this would end us up in having a multitude of nodes each describing just a snippet of each level we decided not to do so in the general case for the Qualcomm boards.

There are a few where we apparently ended up doing so anyways, but for all other cases of regulators we express the full tree in the dts, so please follow that so we don't mix the styles too much.

Ok, then how about this instead:

/smd/rpm/rpm_requests/pm8841-regulators {
	s1 {
		regulator-min-microvolt = <675000>;
		regulator-max-microvolt = <1050000>;
	};

	...
};

That avoids the ridiculous intendation level but uses no labels.

Arnd

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#9 lore raw

Re: [PATCH 2/3] ARM: dts: msm8974-hammerhead: Add regulator nodes for hammerhead

Quoted 25 lines · Arnd Bergmann
Quoted 24 lines · CEST Bjorn Andersson
Quoted 12 lines · Bhushan Shah
Quoted 11 lines · Arnd Bergmann
Quoted 9 lines · CEST Bhushan Shah
arch/arm/boot/dts/qcom-msm8974-lge-nexus5-hammerhead.dts +9 -0
+
+       smd {
+               rpm {
+                       rpm_requests {
+                               pm8841-regulators {
+                                       s1 {
+                                               regulator-min-microvolt = <675000>;
+                                               regulator-max-microvolt = <1050000>;
+                                       };
Quoted 5 lines
Quoted 3 lines

Maybe add a label at either the rpm_requests or the pm8841-regulators node so you can add properties in the leaf nodes withoutout having to specify the whole path?

Sure, I will adjust patch.

Please don't. After running into several cases where this would end us up in having a multitude of nodes each describing just a snippet of each level we decided not to do so in the general case for the Qualcomm boards.

Quoted 7 lines
Quoted 3 lines

There are a few where we apparently ended up doing so anyways, but for all other cases of regulators we express the full tree in the dts, so please follow that so we don't mix the styles too much.

Ok, then how about this instead:

/smd/rpm/rpm_requests/pm8841-regulators {

The problem I have with this is that in the dtsi we have properties and other nodes under each one of these, hence we end up with completely different overall structure depending on if I look in the dtsi or the dts.

The problem I have with it in the dts is that we have properties and nodes under "smd" and "rpm_requests". So siblings are no longer grouped together.

I have a hard time finding my way through flattened trees, often spread out over multiple files, that I need to puzzle together in my head. Perhaps there are better ways to keep this comprehensible, without maintaining the structure.

Quoted 10 lines
	s1 {
		regulator-min-microvolt = <675000>;
		regulator-max-microvolt = <1050000>;
	};

	...
};

That avoids the ridiculous intendation level but uses no labels.

I do share your dislike of the indentation level.

I do have a few other concerns about style and scalability in other places. How about we follow how I've done this in the other files for now (i.e. keep the structure of the patch as is) and sit down at LAS16 to discuss what to do about this?

Regards,
Bjorn

maintainer
#10 lore raw

Re: [PATCH 2/3] ARM: dts: msm8974-hammerhead: Add regulator nodes for hammerhead

Quoted 32 lines · CEST Bjorn Andersson
Quoted 4 lines · Arnd Bergmann

On Sunday, July 17, 2016 8:44:01 PM CEST Bjorn Andersson wrote:
Ok, then how about this instead:

/smd/rpm/rpm_requests/pm8841-regulators {

The problem I have with this is that in the dtsi we have properties and other nodes under each one of these, hence we end up with completely different overall structure depending on if I look in the dtsi or the dts.

The problem I have with it in the dts is that we have properties and nodes under "smd" and "rpm_requests". So siblings are no longer grouped together.

I have a hard time finding my way through flattened trees, often spread out over multiple files, that I need to puzzle together in my head. Perhaps there are better ways to keep this comprehensible, without maintaining the structure.

Quoted 10 lines
	s1 {
		regulator-min-microvolt = <675000>;
		regulator-max-microvolt = <1050000>;
	};

	...
};

That avoids the ridiculous intendation level but uses no labels.

Quoted 7 lines

I do share your dislike of the indentation level.

I do have a few other concerns about style and scalability in other places. How about we follow how I've done this in the other files for now (i.e. keep the structure of the patch as is) and sit down at LAS16 to discuss what to do about this?

Fair enough, let's do that for now.

Arnd

#11 lore raw

Re: [PATCH 2/3] ARM: dts: msm8974-hammerhead: Add regulator nodes for hammerhead

In reply to Bhushan Shah

On Sun 17 Jul 03:52 PDT 2016, Bhushan Shah wrote:

[..]

Quoted 22 lines
arch/arm/boot/dts/qcom-msm8974-lge-nexus5-hammerhead.dts +7 -0
index 88d494f..29fa0bb 100644
@@ -1,6 +1,8 @@
 #include "qcom-msm8974.dtsi"
 #include "qcom-pm8841.dtsi"
 #include "qcom-pm8941.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
 
 / {
 	model = "LGE MSM 8974 HAMMERHEAD";
@@ -14,6 +16,234 @@
 	chosen {
 		stdout-path = "serial0:115200n8";
 	};
+
+	smd {
+		rpm {
+			rpm_requests {
+				pm8841-regulators {

[..]

Quoted 13 lines
arch/arm/boot/dts/qcom-msm8974-lge-nexus5-hammerhead.dts +13 -0
+				};
+
+				pm8941-regulators {
+					vdd_l1_l3-supply = <&pm8941_s1>;
+					vdd_l2_lvs1_2_3-supply = <&pm8941_s3>;
+					vdd_l4_l11-supply = <&pm8941_s1>;
+					vdd_l5_l7-supply = <&pm8941_s2>;
+					vdd_l6_l12_l14_l15-supply = <&pm8941_s2>;
+					vdd_l8_l16_l18_l19-supply = <&vph_pwr_reg>;
+					vdd_l9_l10_l17_l22-supply = <&vreg_boost>;
+					vdd_l13_l20_l23_l24-supply = <&vreg_boost>;
+					vdd_l21-supply = <&vreg_boost>;
+

[..]

arch/arm/boot/dts/qcom-msm8974-lge-nexus5-hammerhead.dts line 226

Quoted 8 lines
arch/arm/boot/dts/qcom-msm8974-lge-nexus5-hammerhead.dts +8 -0
+	};
+
+	vreg_boost: vreg-boost {
+		compatible = "regulator-fixed";
+
+		regulator-name = "vreg-boost";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;

vreg_boost is not to be confused with the boost regulator (PM8941 S4), this boot regulator is responsible for keeping voltage high enough for e.g. eMMC operation during voltage drops of the battery during high current operations. I have it listed in the Sony file as 3.15V, which seems more reasonable (I can't find the number in the Qcom docs right now).

As this has turned out to be part of the Qualcomm platform rather than something Sony specific I believe you should add a patch before this one that moves the vreg-boost node from the honami.dts to the msm8974.dtsi.

arch/arm/boot/dts/qcom-msm8974-lge-nexus5-hammerhead.dts line 238

Quoted 12 lines
arch/arm/boot/dts/qcom-msm8974-lge-nexus5-hammerhead.dts +12 -0
+
+		regulator-always-on;
+		regulator-boot-on;
+
+		gpio = <&pm8941_gpios 21 GPIO_ACTIVE_HIGH>;
+		enable-active-high;
+
+		pinctrl-names = "default";
+		pinctrl-0 = <&boost_bypass_n_pin>;
+	};
+
+	vph_pwr_reg: vph_pwr_reg {

This is also Qualcomm generic, I just skipped it in the Honami case. But please add this to the msm8974.dtsi instead.

You are not allowed to use _ in node names (but should do so in label names), also just to follow naming please name this:

vreg_vph_pwr: vreg-vph-pwr { ... };

Quoted 14 lines
arch/arm/boot/dts/qcom-msm8974-lge-nexus5-hammerhead.dts +8 -0
+		compatible = "regulator-fixed";
+		regulator-name = "vph-pwr";
+
+		regulator-min-microvolt = <3600000>;
+		regulator-max-microvolt = <3600000>;
+
+		regulator-always-on;
+	};
 };
 
 &soc {
@@ -23,3 +253,14 @@
 	};
 

arch/arm/boot/dts/qcom-msm8974-lge-nexus5-hammerhead.dts line 264

Quoted 10 lines
arch/arm/boot/dts/qcom-msm8974-lge-nexus5-hammerhead.dts +9 -0
 };
+
+&spmi_bus {
+	pm8941@0 {
+		gpios@c000 {
+			boost_bypass_n_pin: boost-bypass {
+				pins = "gpio21";
+				function = "normal";
+			};
+		};

This is also part of the platform, so move it from honami.dts to qcom-pm8941.dtsi when you move the vreg above.

arch/arm/boot/dts/qcom-msm8974-lge-nexus5-hammerhead.dts line 266

Quoted 2 lines
arch/arm/boot/dts/qcom-msm8974-lge-nexus5-hammerhead.dts +2 -0
+	};
+};

Regards,
Bjorn

#12 lore raw

PATCH 3/3 ARM: dts: msm8974-hammerhead: Introduce gpio-keys nodes

In reply to Bhushan Shah

This introduces the gpio-keys node for keys of hammerhead and pinctrl state associated with it.

Cc Andy Gross <[email protected]>
Cc Bjorn Andersson <[email protected]>
Cc David Brown <[email protected]>
Cc Rob Herring <[email protected]>
Cc Mark Rutland <[email protected]>
Cc Russell King <[email protected]>
---
 .../dts/qcom-msm8974-lge-nexus5-hammerhead.dts     | 30 ++++++++++++++++++++++
 1 file changed, 30 insertions(+)
arch/arm/boot/dts/qcom-msm8974-lge-nexus5-hammerhead.dts +30 -0
index 29fa0bb..12b6a14 100644
@@ -2,6 +2,7 @@
 #include "qcom-pm8841.dtsi"
 #include "qcom-pm8941.dtsi"
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
 #include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
 
 / {
@@ -252,6 +253,27 @@
 		status = "ok";
 	};
 
+	gpio-keys {
+		compatible = "gpio-keys";
+		input-name = "gpio-keys";
+
+		pinctrl-names = "default";
+		pinctrl-0 = <&gpio_keys_pin_a>;
+
+		volume-up {
+			label = "volume_up";
+			gpios = <&pm8941_gpios 2 GPIO_ACTIVE_LOW>;
+			linux,input-type = <1>;
+			linux,code = <KEY_VOLUMEUP>;
+		};
+
+		volume-down {
+			label = "volume_down";
+			gpios = <&pm8941_gpios 3 GPIO_ACTIVE_LOW>;
+			linux,input-type = <1>;
+			linux,code = <KEY_VOLUMEDOWN>;
+		};
+	};
 };
 
 &spmi_bus {
@@ -261,6 +283,14 @@
 				pins = "gpio21";
 				function = "normal";
 			};
+
+			gpio_keys_pin_a: gpio-keys-active {
+				pins = "gpio2", "gpio3";
+				function = "normal";
+
+				bias-pull-up;
+				power-source = <PM8941_GPIO_S3>;
+			};
 		};
 	};
 };
Signature · 1 line
2.9.0

A message that is not in the archive (sent off-list or not yet received): [email protected]

Reviewed-by
#14 lore raw

Re: [PATCH 3/3] ARM: dts: msm8974-hammerhead: Introduce gpio-keys nodes

Quoted 5 lines · Bhushan Shah

This introduces the gpio-keys node for keys of hammerhead and pinctrl state associated with it.

Cc Andy Gross <[email protected]>
Cc Bjorn Andersson <[email protected]>

Regards,
Bjorn

Quoted 70 lines
---
 .../dts/qcom-msm8974-lge-nexus5-hammerhead.dts     | 30 ++++++++++++++++++++++
 1 file changed, 30 insertions(+)
arch/arm/boot/dts/qcom-msm8974-lge-nexus5-hammerhead.dts +30 -0
index 29fa0bb..12b6a14 100644
@@ -2,6 +2,7 @@
 #include "qcom-pm8841.dtsi"
 #include "qcom-pm8941.dtsi"
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
 #include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
 
 / {
@@ -252,6 +253,27 @@
 		status = "ok";
 	};
 
+	gpio-keys {
+		compatible = "gpio-keys";
+		input-name = "gpio-keys";
+
+		pinctrl-names = "default";
+		pinctrl-0 = <&gpio_keys_pin_a>;
+
+		volume-up {
+			label = "volume_up";
+			gpios = <&pm8941_gpios 2 GPIO_ACTIVE_LOW>;
+			linux,input-type = <1>;
+			linux,code = <KEY_VOLUMEUP>;
+		};
+
+		volume-down {
+			label = "volume_down";
+			gpios = <&pm8941_gpios 3 GPIO_ACTIVE_LOW>;
+			linux,input-type = <1>;
+			linux,code = <KEY_VOLUMEDOWN>;
+		};
+	};
 };
 
 &spmi_bus {
@@ -261,6 +283,14 @@
 				pins = "gpio21";
 				function = "normal";
 			};
+
+			gpio_keys_pin_a: gpio-keys-active {
+				pins = "gpio2", "gpio3";
+				function = "normal";
+
+				bias-pull-up;
+				power-source = <PM8941_GPIO_S3>;
+			};
 		};
 	};
 };
Signature · 1 line
2.9.0

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html