linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 0/4] arm64: qcom: sm8550: enable PMIC devices
@ 2023-06-12 15:22 Neil Armstrong
  2023-06-12 15:22 ` [PATCH v4 1/4] arm64: dts: qcom: pm8550: add PWM controller Neil Armstrong
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Neil Armstrong @ 2023-06-12 15:22 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: linux-arm-msm, devicetree, linux-kernel, Neil Armstrong

This enables the following PMIC devices:
- PWM RGB LED
- RTC
- Volume and Power buttons

on the SM8550 boards.

No dependencies when applied on next-20230609

Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
---
Changes in v4:
- rebased on next-20230609
- Link to v3: https://lore.kernel.org/r/20230525-topic-sm8550-upstream-pm8550-lpg-dt-v3-0-8823ee43f3fc@linaro.org

Changes in v3:
- Added all review tags
- Fixed pinctrl-names/-0 order in last patch
- Link to v2: https://lore.kernel.org/r/20230525-topic-sm8550-upstream-pm8550-lpg-dt-v2-0-a3b890604c49@linaro.org

Changes in v2:
- Always enable RTC in a new patch
- Drop patch enabling RTC on boards
- Move PON names to meet alphabetical order
- Link to v1: https://lore.kernel.org/r/20230525-topic-sm8550-upstream-pm8550-lpg-dt-v1-0-4d5d7602f290@linaro.org

---
Neil Armstrong (4):
      arm64: dts: qcom: pm8550: add PWM controller
      arm64: dts: qcom: sm8550-qrd: add notification RGB LED
      arm64: dts: qcom: pmk8550: always enable RTC PMIC device
      arm64: dts: qcom: sm8550-qrd: enable PMIC Volume and Power buttons

 arch/arm64/boot/dts/qcom/pm8550.dtsi    | 10 ++++++
 arch/arm64/boot/dts/qcom/pmk8550.dtsi   |  1 -
 arch/arm64/boot/dts/qcom/sm8550-qrd.dts | 63 +++++++++++++++++++++++++++++++++
 3 files changed, 73 insertions(+), 1 deletion(-)
---
base-commit: 53ab6975c12d1ad86c599a8927e8c698b144d669
change-id: 20230525-topic-sm8550-upstream-pm8550-lpg-dt-c31455d22f26

Best regards,
-- 
Neil Armstrong <neil.armstrong@linaro.org>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v4 1/4] arm64: dts: qcom: pm8550: add PWM controller
  2023-06-12 15:22 [PATCH v4 0/4] arm64: qcom: sm8550: enable PMIC devices Neil Armstrong
@ 2023-06-12 15:22 ` Neil Armstrong
  2023-06-12 15:22 ` [PATCH v4 2/4] arm64: dts: qcom: sm8550-qrd: add notification RGB LED Neil Armstrong
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Neil Armstrong @ 2023-06-12 15:22 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: linux-arm-msm, devicetree, linux-kernel, Neil Armstrong

Add the PWM function to the pm8550 dtsi, this is usually used
to drive RGB leds on platforms using this PMIC.

Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
---
 arch/arm64/boot/dts/qcom/pm8550.dtsi | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/pm8550.dtsi b/arch/arm64/boot/dts/qcom/pm8550.dtsi
index 33f357a80636..db3d5c17a77d 100644
--- a/arch/arm64/boot/dts/qcom/pm8550.dtsi
+++ b/arch/arm64/boot/dts/qcom/pm8550.dtsi
@@ -61,5 +61,15 @@ pm8550_flash: led-controller@ee00 {
 			reg = <0xee00>;
 			status = "disabled";
 		};
+
+		pm8550_pwm: pwm {
+			compatible = "qcom,pm8550-pwm", "qcom,pm8350c-pwm";
+
+			#address-cells = <1>;
+			#size-cells = <0>;
+			#pwm-cells = <2>;
+
+			status = "disabled";
+		};
 	};
 };

-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v4 2/4] arm64: dts: qcom: sm8550-qrd: add notification RGB LED
  2023-06-12 15:22 [PATCH v4 0/4] arm64: qcom: sm8550: enable PMIC devices Neil Armstrong
  2023-06-12 15:22 ` [PATCH v4 1/4] arm64: dts: qcom: pm8550: add PWM controller Neil Armstrong
@ 2023-06-12 15:22 ` Neil Armstrong
  2023-06-12 15:22 ` [PATCH v4 3/4] arm64: dts: qcom: pmk8550: always enable RTC PMIC device Neil Armstrong
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Neil Armstrong @ 2023-06-12 15:22 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: linux-arm-msm, devicetree, linux-kernel, Neil Armstrong

The QRD features a notification LED connected to the pm8550.
Configure the RGB led controlled by the PMIC PWM controller.

Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
---
 arch/arm64/boot/dts/qcom/sm8550-qrd.dts | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sm8550-qrd.dts b/arch/arm64/boot/dts/qcom/sm8550-qrd.dts
index 8669d29144bb..efff15225e67 100644
--- a/arch/arm64/boot/dts/qcom/sm8550-qrd.dts
+++ b/arch/arm64/boot/dts/qcom/sm8550-qrd.dts
@@ -516,6 +516,33 @@ led-1 {
 	};
 };
 
+&pm8550_pwm {
+	status = "okay";
+
+	multi-led {
+		color = <LED_COLOR_ID_RGB>;
+		function = LED_FUNCTION_STATUS;
+
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		led@1 {
+			reg = <1>;
+			color = <LED_COLOR_ID_RED>;
+		};
+
+		led@2 {
+			reg = <2>;
+			color = <LED_COLOR_ID_GREEN>;
+		};
+
+		led@3 {
+			reg = <3>;
+			color = <LED_COLOR_ID_BLUE>;
+		};
+	};
+};
+
 &pm8550b_eusb2_repeater {
 	vdd18-supply = <&vreg_l15b_1p8>;
 	vdd3-supply = <&vreg_l5b_3p1>;

-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v4 3/4] arm64: dts: qcom: pmk8550: always enable RTC PMIC device
  2023-06-12 15:22 [PATCH v4 0/4] arm64: qcom: sm8550: enable PMIC devices Neil Armstrong
  2023-06-12 15:22 ` [PATCH v4 1/4] arm64: dts: qcom: pm8550: add PWM controller Neil Armstrong
  2023-06-12 15:22 ` [PATCH v4 2/4] arm64: dts: qcom: sm8550-qrd: add notification RGB LED Neil Armstrong
@ 2023-06-12 15:22 ` Neil Armstrong
  2023-06-12 15:22 ` [PATCH v4 4/4] arm64: dts: qcom: sm8550-qrd: enable PMIC Volume and Power buttons Neil Armstrong
  2023-06-13 22:30 ` [PATCH v4 0/4] arm64: qcom: sm8550: enable PMIC devices Bjorn Andersson
  4 siblings, 0 replies; 6+ messages in thread
From: Neil Armstrong @ 2023-06-12 15:22 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: linux-arm-msm, devicetree, linux-kernel, Neil Armstrong

There's no reason to keep the RTC disabled, it has been tested
and is functional on the SM8550 QRD and MTP boards.

Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
---
 arch/arm64/boot/dts/qcom/pmk8550.dtsi | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/arm64/boot/dts/qcom/pmk8550.dtsi b/arch/arm64/boot/dts/qcom/pmk8550.dtsi
index 8c897d4fee29..c7ac9b2eaacf 100644
--- a/arch/arm64/boot/dts/qcom/pmk8550.dtsi
+++ b/arch/arm64/boot/dts/qcom/pmk8550.dtsi
@@ -49,7 +49,6 @@ pmk8550_rtc: rtc@6100 {
 			reg = <0x6100>, <0x6200>;
 			reg-names = "rtc", "alarm";
 			interrupts = <0x0 0x62 0x1 IRQ_TYPE_EDGE_RISING>;
-			status = "disabled";
 		};
 
 		pmk8550_sdam_2: nvram@7100 {

-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v4 4/4] arm64: dts: qcom: sm8550-qrd: enable PMIC Volume and Power buttons
  2023-06-12 15:22 [PATCH v4 0/4] arm64: qcom: sm8550: enable PMIC devices Neil Armstrong
                   ` (2 preceding siblings ...)
  2023-06-12 15:22 ` [PATCH v4 3/4] arm64: dts: qcom: pmk8550: always enable RTC PMIC device Neil Armstrong
@ 2023-06-12 15:22 ` Neil Armstrong
  2023-06-13 22:30 ` [PATCH v4 0/4] arm64: qcom: sm8550: enable PMIC devices Bjorn Andersson
  4 siblings, 0 replies; 6+ messages in thread
From: Neil Armstrong @ 2023-06-12 15:22 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: linux-arm-msm, devicetree, linux-kernel, Neil Armstrong

The Volume Down & Power buttons are controlled by the PMIC via
the PON hardware, and the Volume Up is connected to a PMIC gpio.

Enable the necessary hardware and setup the GPIO state for the
Volume Up gpio key.

Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
---
 arch/arm64/boot/dts/qcom/sm8550-qrd.dts | 36 +++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sm8550-qrd.dts b/arch/arm64/boot/dts/qcom/sm8550-qrd.dts
index efff15225e67..cde2ab8b18a4 100644
--- a/arch/arm64/boot/dts/qcom/sm8550-qrd.dts
+++ b/arch/arm64/boot/dts/qcom/sm8550-qrd.dts
@@ -54,6 +54,22 @@ chosen {
 		stdout-path = "serial0:115200n8";
 	};
 
+	gpio-keys {
+		compatible = "gpio-keys";
+
+		pinctrl-0 = <&volume_up_n>;
+		pinctrl-names = "default";
+
+		key-volume-up {
+			label = "Volume Up";
+			linux,code = <KEY_VOLUMEUP>;
+			gpios = <&pm8550_gpios 6 GPIO_ACTIVE_LOW>;
+			debounce-interval = <15>;
+			linux,can-disable;
+			wakeup-source;
+		};
+	};
+
 	pmic-glink {
 		compatible = "qcom,sm8550-pmic-glink", "qcom,pmic-glink";
 		#address-cells = <1>;
@@ -516,6 +532,16 @@ led-1 {
 	};
 };
 
+&pm8550_gpios {
+	volume_up_n: volume-up-n-state {
+		pins = "gpio6";
+		function = "normal";
+		power-source = <1>;
+		bias-pull-up;
+		input-enable;
+	};
+};
+
 &pm8550_pwm {
 	status = "okay";
 
@@ -548,6 +574,16 @@ &pm8550b_eusb2_repeater {
 	vdd3-supply = <&vreg_l5b_3p1>;
 };
 
+&pon_pwrkey {
+	status = "okay";
+};
+
+&pon_resin {
+	linux,code = <KEY_VOLUMEDOWN>;
+
+	status = "okay";
+};
+
 &pcie_1_phy_aux_clk {
 	clock-frequency = <1000>;
 };

-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v4 0/4] arm64: qcom: sm8550: enable PMIC devices
  2023-06-12 15:22 [PATCH v4 0/4] arm64: qcom: sm8550: enable PMIC devices Neil Armstrong
                   ` (3 preceding siblings ...)
  2023-06-12 15:22 ` [PATCH v4 4/4] arm64: dts: qcom: sm8550-qrd: enable PMIC Volume and Power buttons Neil Armstrong
@ 2023-06-13 22:30 ` Bjorn Andersson
  4 siblings, 0 replies; 6+ messages in thread
From: Bjorn Andersson @ 2023-06-13 22:30 UTC (permalink / raw)
  To: Rob Herring, Andy Gross, Conor Dooley, Krzysztof Kozlowski,
	Neil Armstrong, Konrad Dybcio
  Cc: devicetree, linux-arm-msm, linux-kernel

On Mon, 12 Jun 2023 17:22:48 +0200, Neil Armstrong wrote:
> This enables the following PMIC devices:
> - PWM RGB LED
> - RTC
> - Volume and Power buttons
> 
> on the SM8550 boards.
> 
> [...]

Applied, thanks!

[1/4] arm64: dts: qcom: pm8550: add PWM controller
      commit: 8889d13c2e758cff33fc85139c6d9288553e0e30
[2/4] arm64: dts: qcom: sm8550-qrd: add notification RGB LED
      commit: 3818165476d70b13cf3193e1b5e60b1af6689772
[3/4] arm64: dts: qcom: pmk8550: always enable RTC PMIC device
      commit: a791fc19965e52918bb70e2b764965083eaadbed
[4/4] arm64: dts: qcom: sm8550-qrd: enable PMIC Volume and Power buttons
      commit: bb47bfbd5aa89368c348d9828484f7201cef6cea

Best regards,
-- 
Bjorn Andersson <andersson@kernel.org>

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-06-13 22:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-12 15:22 [PATCH v4 0/4] arm64: qcom: sm8550: enable PMIC devices Neil Armstrong
2023-06-12 15:22 ` [PATCH v4 1/4] arm64: dts: qcom: pm8550: add PWM controller Neil Armstrong
2023-06-12 15:22 ` [PATCH v4 2/4] arm64: dts: qcom: sm8550-qrd: add notification RGB LED Neil Armstrong
2023-06-12 15:22 ` [PATCH v4 3/4] arm64: dts: qcom: pmk8550: always enable RTC PMIC device Neil Armstrong
2023-06-12 15:22 ` [PATCH v4 4/4] arm64: dts: qcom: sm8550-qrd: enable PMIC Volume and Power buttons Neil Armstrong
2023-06-13 22:30 ` [PATCH v4 0/4] arm64: qcom: sm8550: enable PMIC devices Bjorn Andersson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).