Skip to contentSkip to conversation

Initial support for LG Nexus 5 phone (hammerhead)

PATCH New Bhushan Shah 3 participants 7 messages Jul 29, 2016 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

v3 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.

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

Changes since v2:

- rename vph-pwr-reg node to vreg-vph-pwr
- also move pinctrl stuff to msm8974.dtsi

Changes since v1:

- Remove qcom,msm-id from dts file
- Add "lge,hammerhead" to compatible
- move vreg_boost node from honami.dts file to msm8974.dtsi
- move vph-pwr-reg node to msm8974.dtsi

Bhushan Shah (5):
ARM: dts: qcom: Add initial DTS for LG Nexus 5 Phone
ARM: dts: msm8974: Move vreg_boost node from the honami to msm8974
ARM: dts: qcom: msm8974: Add fixed regulator node for vph-pwr-reg
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     | 262 +++++++++++++++++++++
 .../boot/dts/qcom-msm8974-sony-xperia-honami.dts   |  21 --
 arch/arm/boot/dts/qcom-msm8974.dtsi                |  28 +++
 arch/arm/boot/dts/qcom-pm8941.dtsi                 |   6 +
 5 files changed, 297 insertions(+), 21 deletions(-)
 create mode 100644 arch/arm/boot/dts/qcom-msm8974-lge-nexus5-hammerhead.dts
Signature · 1 line
2.9.0
#1 lore raw

PATCH v3 1/5 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     | 23 ++++++++++++++++++++++
 2 files changed, 24 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 +23 -0
new file mode 100644
index 0000000..68f3a8a
@@ -0,0 +1,23 @@
+#include "qcom-msm8974.dtsi"
+#include "qcom-pm8841.dtsi"
+#include "qcom-pm8941.dtsi"
+
+/ {
+	model = "LGE MSM 8974 HAMMERHEAD";
+	compatible = "lge,hammerhead", "qcom,msm8974";
+
+	aliases {
+		serial0 = &blsp1_uart1;
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+	};
+};
+
+&soc {
+	serial at f991d000 {
+		status = "ok";
+	};
+
+};
Signature · 1 line
2.9.0

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

#3 lore raw

PATCH v3 2/5 ARM: dts: msm8974: Move vreg_boost node from the honami to msm8974

vreg_boost is Qualcomm platform specific and is also used in hammerhead device.

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]>

---

Changes since v2:
- Move vreg-boost node completely, along with pinctrl stuff

 .../boot/dts/qcom-msm8974-sony-xperia-honami.dts    | 21 ---------------------
 arch/arm/boot/dts/qcom-msm8974.dtsi                 | 18 ++++++++++++++++++
 arch/arm/boot/dts/qcom-pm8941.dtsi                  |  6 ++++++
 3 files changed, 24 insertions(+), 21 deletions(-)
arch/arm/boot/dts/qcom-msm8974-sony-xperia-honami.dts +0 -21
index a0398b6..a90e34c 100644
@@ -258,22 +258,6 @@
 		};
 	};
 
-	vreg_boost: vreg-boost {
-		compatible = "regulator-fixed";
-
-		regulator-name = "vreg-boost";
-		regulator-min-microvolt = <3150000>;
-		regulator-max-microvolt = <3150000>;
-
-		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>;
-     };
 };
 
 &soc {
@@ -383,11 +367,6 @@
 		};
 
 		gpios@c000 {
-			boost_bypass_n_pin: boost-bypass {
-				pins = "gpio21";
-				function = "normal";
-			};
-
 			gpio_keys_pin_a: gpio-keys-active {
 				pins = "gpio2", "gpio3", "gpio4", "gpio5";
 				function = "normal";
arch/arm/boot/dts/qcom-msm8974.dtsi +18 -0
index dc2ce00..1f9b649 100644
@@ -2,6 +2,7 @@
 
 #include <dt-bindings/interrupt-controller/irq.h>
 #include <dt-bindings/clock/qcom,gcc-msm8974.h>
+#include <dt-bindings/gpio/gpio.h>
 #include "skeleton.dtsi"
 
 / {
@@ -604,4 +605,21 @@
 			};
 		};
 	};
+
+	vreg_boost: vreg-boost {
+		compatible = "regulator-fixed";
+
+		regulator-name = "vreg-boost";
+		regulator-min-microvolt = <3150000>;
+		regulator-max-microvolt = <3150000>;
+
+		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>;
+	};
 };
arch/arm/boot/dts/qcom-pm8941.dtsi +6 -0
index d95edb6..ae8e5cc 100644
@@ -88,6 +88,12 @@
 				     <0 0xe1 0 IRQ_TYPE_NONE>,
 				     <0 0xe2 0 IRQ_TYPE_NONE>,
 				     <0 0xe3 0 IRQ_TYPE_NONE>;
+
+			boost_bypass_n_pin: boost-bypass {
+				pins = "gpio21";
+				function = "normal";
+			};
+
 		};
 
 		pm8941_mpps: mpps@a000 {
Signature · 6 lines
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
Reviewed-by on v3 2/5
#4 lore raw

Re: [PATCH v3 2/5] ARM: dts: msm8974: Move vreg_boost node from the honami to msm8974

Quoted 13 lines · Bhushan Shah

vreg_boost is Qualcomm platform specific and is also used in hammerhead device.

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]>

Regards,
Bjorn

Quoted 103 lines

---

Changes since v2:
- Move vreg-boost node completely, along with pinctrl stuff

 .../boot/dts/qcom-msm8974-sony-xperia-honami.dts    | 21 ---------------------
 arch/arm/boot/dts/qcom-msm8974.dtsi                 | 18 ++++++++++++++++++
 arch/arm/boot/dts/qcom-pm8941.dtsi                  |  6 ++++++
 3 files changed, 24 insertions(+), 21 deletions(-)
arch/arm/boot/dts/qcom-msm8974-sony-xperia-honami.dts +0 -21
index a0398b6..a90e34c 100644
@@ -258,22 +258,6 @@
 		};
 	};
 
-	vreg_boost: vreg-boost {
-		compatible = "regulator-fixed";
-
-		regulator-name = "vreg-boost";
-		regulator-min-microvolt = <3150000>;
-		regulator-max-microvolt = <3150000>;
-
-		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>;
-     };
 };
 
 &soc {
@@ -383,11 +367,6 @@
 		};
 
 		gpios@c000 {
-			boost_bypass_n_pin: boost-bypass {
-				pins = "gpio21";
-				function = "normal";
-			};
-
 			gpio_keys_pin_a: gpio-keys-active {
 				pins = "gpio2", "gpio3", "gpio4", "gpio5";
 				function = "normal";
arch/arm/boot/dts/qcom-msm8974.dtsi +18 -0
index dc2ce00..1f9b649 100644
@@ -2,6 +2,7 @@
 
 #include <dt-bindings/interrupt-controller/irq.h>
 #include <dt-bindings/clock/qcom,gcc-msm8974.h>
+#include <dt-bindings/gpio/gpio.h>
 #include "skeleton.dtsi"
 
 / {
@@ -604,4 +605,21 @@
 			};
 		};
 	};
+
+	vreg_boost: vreg-boost {
+		compatible = "regulator-fixed";
+
+		regulator-name = "vreg-boost";
+		regulator-min-microvolt = <3150000>;
+		regulator-max-microvolt = <3150000>;
+
+		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>;
+	};
 };
arch/arm/boot/dts/qcom-pm8941.dtsi +6 -0
index d95edb6..ae8e5cc 100644
@@ -88,6 +88,12 @@
 				     <0 0xe1 0 IRQ_TYPE_NONE>,
 				     <0 0xe2 0 IRQ_TYPE_NONE>,
 				     <0 0xe3 0 IRQ_TYPE_NONE>;
+
+			boost_bypass_n_pin: boost-bypass {
+				pins = "gpio21";
+				function = "normal";
+			};
+
 		};
 
 		pm8941_mpps: mpps@a000 {
Signature · 1 line
2.9.0
#5 lore raw

PATCH v3 4/5 ARM: dts: msm8974-hammerhead: Add regulator nodes for hammerhead

In reply to a message not in the archive
---
 .../dts/qcom-msm8974-lge-nexus5-hammerhead.dts     | 203 +++++++++++++++++++++
 1 file changed, 203 insertions(+)
arch/arm/boot/dts/qcom-msm8974-lge-nexus5-hammerhead.dts +203 -0
index 68f3a8a..df957cb 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";
@@ -13,6 +15,207 @@
 	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 = <&vreg_vph_pwr>;
+					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;
+					};
+				};
+			};
+		};
+	};
 };
 
 &soc {
Signature · 6 lines
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
#6 lore raw

PATCH v3 3/5 ARM: dts: qcom: msm8974: Add fixed regulator node for vph-pwr-reg

In reply to Bhushan Shah

---

Changes since v2:
- Rename vph-pwr-reg to vreg_vph_pwr

 arch/arm/boot/dts/qcom-msm8974.dtsi | 10 ++++++++++
 1 file changed, 10 insertions(+)
arch/arm/boot/dts/qcom-msm8974.dtsi +10 -0
index 1f9b649..b2ee2f1 100644
@@ -622,4 +622,14 @@
 		pinctrl-names = "default";
 		pinctrl-0 = <&boost_bypass_n_pin>;
 	};
+
+	vreg_vph_pwr: vreg-vph-pwr {
+		compatible = "regulator-fixed";
+		regulator-name = "vph-pwr";
+
+		regulator-min-microvolt = <3600000>;
+		regulator-max-microvolt = <3600000>;
+
+		regulator-always-on;
+	};
 };
Signature · 1 line
2.9.0
#7 lore raw

PATCH v3 5/5 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.

---
 .../dts/qcom-msm8974-lge-nexus5-hammerhead.dts     | 36 ++++++++++++++++++++++
 1 file changed, 36 insertions(+)
arch/arm/boot/dts/qcom-msm8974-lge-nexus5-hammerhead.dts +36 -0
index df957cb..c0fb4a6 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>
 
 / {
@@ -223,4 +224,39 @@
 		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 {
+	pm8941@0 {
+		gpios@c000 {
+			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