All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/4] arm64: qcom: sm8550: enable PMIC devices
@ 2023-05-31 12:22 Neil Armstrong
  2023-05-31 12:22 ` [PATCH v2 1/4] arm64: dts: qcom: pm8550: add PWM controller Neil Armstrong
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Neil Armstrong @ 2023-05-31 12: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.

Depends on:
- [1] PWM bindings, merged by Lee
- [2] functional fix
- [3] & [4] QRD flash DT changes merged by Bjorn

[1] https://lore.kernel.org/all/20230522-topic-sm8550-upstream-pm8550-lpg-v2-1-c5117f1d41f9@linaro.org/
[2] https://lore.kernel.org/r/20230515162604.649203-1-quic_bjorande@quicinc.com
[3] https://lore.kernel.org/r/20230516150202.188655-3-krzysztof.kozlowski@linaro.org
[4] https://lore.kernel.org/r/20230516150202.188655-2-krzysztof.kozlowski@linaro.org

Signed-off-by: Neil Armstrong <neil.armstrong@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: 388a38fadd00565867bda40c3b87c3a983bfb83d
change-id: 20230525-topic-sm8550-upstream-pm8550-lpg-dt-c31455d22f26

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


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

* [PATCH v2 1/4] arm64: dts: qcom: pm8550: add PWM controller
  2023-05-31 12:22 [PATCH v2 0/4] arm64: qcom: sm8550: enable PMIC devices Neil Armstrong
@ 2023-05-31 12:22 ` Neil Armstrong
  2023-05-31 12:22 ` [PATCH v2 2/4] arm64: dts: qcom: sm8550-qrd: add notification RGB LED Neil Armstrong
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Neil Armstrong @ 2023-05-31 12: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] 7+ messages in thread

* [PATCH v2 2/4] arm64: dts: qcom: sm8550-qrd: add notification RGB LED
  2023-05-31 12:22 [PATCH v2 0/4] arm64: qcom: sm8550: enable PMIC devices Neil Armstrong
  2023-05-31 12:22 ` [PATCH v2 1/4] arm64: dts: qcom: pm8550: add PWM controller Neil Armstrong
@ 2023-05-31 12:22 ` Neil Armstrong
  2023-05-31 12:22 ` [PATCH v2 3/4] arm64: dts: qcom: pmk8550: always enable RTC PMIC device Neil Armstrong
  2023-05-31 12:22 ` [PATCH v2 4/4] arm64: dts: qcom: sm8550-qrd: enable PMIC Volume and Power buttons Neil Armstrong
  3 siblings, 0 replies; 7+ messages in thread
From: Neil Armstrong @ 2023-05-31 12: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] 7+ messages in thread

* [PATCH v2 3/4] arm64: dts: qcom: pmk8550: always enable RTC PMIC device
  2023-05-31 12:22 [PATCH v2 0/4] arm64: qcom: sm8550: enable PMIC devices Neil Armstrong
  2023-05-31 12:22 ` [PATCH v2 1/4] arm64: dts: qcom: pm8550: add PWM controller Neil Armstrong
  2023-05-31 12:22 ` [PATCH v2 2/4] arm64: dts: qcom: sm8550-qrd: add notification RGB LED Neil Armstrong
@ 2023-05-31 12:22 ` Neil Armstrong
  2023-05-31 14:26   ` Konrad Dybcio
  2023-05-31 12:22 ` [PATCH v2 4/4] arm64: dts: qcom: sm8550-qrd: enable PMIC Volume and Power buttons Neil Armstrong
  3 siblings, 1 reply; 7+ messages in thread
From: Neil Armstrong @ 2023-05-31 12: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.

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] 7+ messages in thread

* [PATCH v2 4/4] arm64: dts: qcom: sm8550-qrd: enable PMIC Volume and Power buttons
  2023-05-31 12:22 [PATCH v2 0/4] arm64: qcom: sm8550: enable PMIC devices Neil Armstrong
                   ` (2 preceding siblings ...)
  2023-05-31 12:22 ` [PATCH v2 3/4] arm64: dts: qcom: pmk8550: always enable RTC PMIC device Neil Armstrong
@ 2023-05-31 12:22 ` Neil Armstrong
  2023-05-31 14:27   ` Konrad Dybcio
  3 siblings, 1 reply; 7+ messages in thread
From: Neil Armstrong @ 2023-05-31 12: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.

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..24fc368de97b 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-names = "default";
+		pinctrl-0 = <&volume_up_n>;
+
+		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] 7+ messages in thread

* Re: [PATCH v2 3/4] arm64: dts: qcom: pmk8550: always enable RTC PMIC device
  2023-05-31 12:22 ` [PATCH v2 3/4] arm64: dts: qcom: pmk8550: always enable RTC PMIC device Neil Armstrong
@ 2023-05-31 14:26   ` Konrad Dybcio
  0 siblings, 0 replies; 7+ messages in thread
From: Konrad Dybcio @ 2023-05-31 14:26 UTC (permalink / raw)
  To: Neil Armstrong, Andy Gross, Bjorn Andersson, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: linux-arm-msm, devicetree, linux-kernel



On 31.05.2023 14:22, Neil Armstrong wrote:
> There's no reason to keep the RTC disabled, it has been tested
> and is functional on the SM8550 QRD and MTP boards.
> 
> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
> ---
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>

Konrad
>  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 {
> 

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

* Re: [PATCH v2 4/4] arm64: dts: qcom: sm8550-qrd: enable PMIC Volume and Power buttons
  2023-05-31 12:22 ` [PATCH v2 4/4] arm64: dts: qcom: sm8550-qrd: enable PMIC Volume and Power buttons Neil Armstrong
@ 2023-05-31 14:27   ` Konrad Dybcio
  0 siblings, 0 replies; 7+ messages in thread
From: Konrad Dybcio @ 2023-05-31 14:27 UTC (permalink / raw)
  To: Neil Armstrong, Andy Gross, Bjorn Andersson, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: linux-arm-msm, devicetree, linux-kernel



On 31.05.2023 14:22, Neil Armstrong wrote:
> 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.
> 
> 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..24fc368de97b 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-names = "default";
> +		pinctrl-0 = <&volume_up_n>;
property-n
property-names

Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>

Konrad
> +
> +		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>;
>  };
> 

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

end of thread, other threads:[~2023-05-31 14:27 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-31 12:22 [PATCH v2 0/4] arm64: qcom: sm8550: enable PMIC devices Neil Armstrong
2023-05-31 12:22 ` [PATCH v2 1/4] arm64: dts: qcom: pm8550: add PWM controller Neil Armstrong
2023-05-31 12:22 ` [PATCH v2 2/4] arm64: dts: qcom: sm8550-qrd: add notification RGB LED Neil Armstrong
2023-05-31 12:22 ` [PATCH v2 3/4] arm64: dts: qcom: pmk8550: always enable RTC PMIC device Neil Armstrong
2023-05-31 14:26   ` Konrad Dybcio
2023-05-31 12:22 ` [PATCH v2 4/4] arm64: dts: qcom: sm8550-qrd: enable PMIC Volume and Power buttons Neil Armstrong
2023-05-31 14:27   ` Konrad Dybcio

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.