* [PATCH 0/2] Add PM8937 PWM and display backlight for Redmi 5A
@ 2025-02-12 22:21 Barnabás Czémán
2025-02-12 22:21 ` [PATCH 1/2] arm64: dts: qcom: pm8937: Add LPG PWM driver Barnabás Czémán
2025-02-12 22:21 ` [PATCH 2/2] arm64: dts: qcom: msm8917-xiaomi-riva: Add display backlight Barnabás Czémán
0 siblings, 2 replies; 6+ messages in thread
From: Barnabás Czémán @ 2025-02-12 22:21 UTC (permalink / raw)
To: Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
Conor Dooley
Cc: linux-arm-msm, devicetree, linux-kernel,
Barnabás Czémán, Daniil Titov
This patch series add pwm node for pm8937 and enables
pwm backlight for Redmi 5A.
Signed-off-by: Barnabás Czémán <barnabas.czeman@mainlining.org>
---
Barnabás Czémán (1):
arm64: dts: qcom: msm8917-xiaomi-riva: Add display backlight
Daniil Titov (1):
arm64: dts: qcom: pm8937: Add LPG PWM driver
arch/arm64/boot/dts/qcom/msm8917-xiaomi-riva.dts | 25 ++++++++++++++++++++++++
arch/arm64/boot/dts/qcom/pm8937.dtsi | 8 ++++++++
2 files changed, 33 insertions(+)
---
base-commit: c674aa7c289e51659e40dda0f954886ef7f80042
change-id: 20250212-pm8937-pwm-0f3bae4cd207
Best regards,
--
Barnabás Czémán <barnabas.czeman@mainlining.org>
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH 1/2] arm64: dts: qcom: pm8937: Add LPG PWM driver 2025-02-12 22:21 [PATCH 0/2] Add PM8937 PWM and display backlight for Redmi 5A Barnabás Czémán @ 2025-02-12 22:21 ` Barnabás Czémán 2025-02-12 22:27 ` Konrad Dybcio 2025-02-12 22:21 ` [PATCH 2/2] arm64: dts: qcom: msm8917-xiaomi-riva: Add display backlight Barnabás Czémán 1 sibling, 1 reply; 6+ messages in thread From: Barnabás Czémán @ 2025-02-12 22:21 UTC (permalink / raw) To: Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski, Conor Dooley Cc: linux-arm-msm, devicetree, linux-kernel, Barnabás Czémán, Daniil Titov From: Daniil Titov <daniilt971@gmail.com> Add PWM/LPG node to the PM8937 dtsi so devices which use this block can enable them. Signed-off-by: Daniil Titov <daniilt971@gmail.com> Signed-off-by: Barnabás Czémán <barnabas.czeman@mainlining.org> --- arch/arm64/boot/dts/qcom/pm8937.dtsi | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/pm8937.dtsi b/arch/arm64/boot/dts/qcom/pm8937.dtsi index 42b3575b36ff4d37df11ccb5ed68e965e3716300..d13f39d81386b9493e33411e7fa0fb69e94644f4 100644 --- a/arch/arm64/boot/dts/qcom/pm8937.dtsi +++ b/arch/arm64/boot/dts/qcom/pm8937.dtsi @@ -143,6 +143,14 @@ pmic@1 { #address-cells = <1>; #size-cells = <0>; + pm8937_pwm: pwm { + compatible = "qcom,pm8916-pwm"; + + #pwm-cells = <2>; + + status = "disabled"; + }; + pm8937_spmi_regulators: regulators { compatible = "qcom,pm8937-regulators"; }; -- 2.48.1 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] arm64: dts: qcom: pm8937: Add LPG PWM driver 2025-02-12 22:21 ` [PATCH 1/2] arm64: dts: qcom: pm8937: Add LPG PWM driver Barnabás Czémán @ 2025-02-12 22:27 ` Konrad Dybcio 0 siblings, 0 replies; 6+ messages in thread From: Konrad Dybcio @ 2025-02-12 22:27 UTC (permalink / raw) To: Barnabás Czémán, Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski, Conor Dooley Cc: linux-arm-msm, devicetree, linux-kernel, Daniil Titov On 12.02.2025 11:21 PM, Barnabás Czémán wrote: > From: Daniil Titov <daniilt971@gmail.com> > > Add PWM/LPG node to the PM8937 dtsi so devices > which use this block can enable them. > > Signed-off-by: Daniil Titov <daniilt971@gmail.com> > Signed-off-by: Barnabás Czémán <barnabas.czeman@mainlining.org> > --- > arch/arm64/boot/dts/qcom/pm8937.dtsi | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/arch/arm64/boot/dts/qcom/pm8937.dtsi b/arch/arm64/boot/dts/qcom/pm8937.dtsi > index 42b3575b36ff4d37df11ccb5ed68e965e3716300..d13f39d81386b9493e33411e7fa0fb69e94644f4 100644 > --- a/arch/arm64/boot/dts/qcom/pm8937.dtsi > +++ b/arch/arm64/boot/dts/qcom/pm8937.dtsi > @@ -143,6 +143,14 @@ pmic@1 { > #address-cells = <1>; > #size-cells = <0>; > > + pm8937_pwm: pwm { > + compatible = "qcom,pm8916-pwm"; Please add a new compatible with this one as fallback, i.e. compatible = "qcom,pm8937-pwm", "qcom,pm8916-pwm"; and add it in dt-bindings Konrad ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 2/2] arm64: dts: qcom: msm8917-xiaomi-riva: Add display backlight 2025-02-12 22:21 [PATCH 0/2] Add PM8937 PWM and display backlight for Redmi 5A Barnabás Czémán 2025-02-12 22:21 ` [PATCH 1/2] arm64: dts: qcom: pm8937: Add LPG PWM driver Barnabás Czémán @ 2025-02-12 22:21 ` Barnabás Czémán 2025-02-12 22:31 ` Konrad Dybcio 1 sibling, 1 reply; 6+ messages in thread From: Barnabás Czémán @ 2025-02-12 22:21 UTC (permalink / raw) To: Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski, Conor Dooley Cc: linux-arm-msm, devicetree, linux-kernel, Barnabás Czémán Redmi 5A display uses pwm backlight, add support for it. Signed-off-by: Barnabás Czémán <barnabas.czeman@mainlining.org> --- arch/arm64/boot/dts/qcom/msm8917-xiaomi-riva.dts | 25 ++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/msm8917-xiaomi-riva.dts b/arch/arm64/boot/dts/qcom/msm8917-xiaomi-riva.dts index f1d22535fedd94467ba3f0a88b2110ce5360e7e1..8808306c989f54116052667887f9bf36b63c4c64 100644 --- a/arch/arm64/boot/dts/qcom/msm8917-xiaomi-riva.dts +++ b/arch/arm64/boot/dts/qcom/msm8917-xiaomi-riva.dts @@ -20,6 +20,14 @@ / { qcom,msm-id = <QCOM_ID_MSM8917 0>; qcom,board-id = <0x1000b 2>, <0x2000b 2>; + pwm_backlight: backlight { + compatible = "pwm-backlight"; + pwms = <&pm8937_pwm 0 100000>; + brightness-levels = <0 255>; + num-interpolated-steps = <255>; + default-brightness-level = <128>; + }; + battery: battery { compatible = "simple-battery"; charge-full-design-microamp-hours = <3000000>; @@ -131,6 +139,23 @@ bq25601@6b{ }; }; +&pm8937_gpios { + pwm_enable_default: pwm-enable-default-state { + pins = "gpio8"; + function = "dtest2"; + output-low; + bias-disable; + qcom,drive-strength = <2>; + }; +}; + +&pm8937_pwm { + pinctrl-0 = <&pwm_enable_default>; + pinctrl-names = "default"; + + status = "okay"; +}; + &pm8937_resin { linux,code = <KEY_VOLUMEDOWN>; -- 2.48.1 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] arm64: dts: qcom: msm8917-xiaomi-riva: Add display backlight 2025-02-12 22:21 ` [PATCH 2/2] arm64: dts: qcom: msm8917-xiaomi-riva: Add display backlight Barnabás Czémán @ 2025-02-12 22:31 ` Konrad Dybcio 2025-02-12 22:36 ` barnabas.czeman 0 siblings, 1 reply; 6+ messages in thread From: Konrad Dybcio @ 2025-02-12 22:31 UTC (permalink / raw) To: Barnabás Czémán, Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski, Conor Dooley Cc: linux-arm-msm, devicetree, linux-kernel On 12.02.2025 11:21 PM, Barnabás Czémán wrote: > Redmi 5A display uses pwm backlight, add support for it. > > Signed-off-by: Barnabás Czémán <barnabas.czeman@mainlining.org> > --- > arch/arm64/boot/dts/qcom/msm8917-xiaomi-riva.dts | 25 ++++++++++++++++++++++++ > 1 file changed, 25 insertions(+) > > diff --git a/arch/arm64/boot/dts/qcom/msm8917-xiaomi-riva.dts b/arch/arm64/boot/dts/qcom/msm8917-xiaomi-riva.dts > index f1d22535fedd94467ba3f0a88b2110ce5360e7e1..8808306c989f54116052667887f9bf36b63c4c64 100644 > --- a/arch/arm64/boot/dts/qcom/msm8917-xiaomi-riva.dts > +++ b/arch/arm64/boot/dts/qcom/msm8917-xiaomi-riva.dts > @@ -20,6 +20,14 @@ / { > qcom,msm-id = <QCOM_ID_MSM8917 0>; > qcom,board-id = <0x1000b 2>, <0x2000b 2>; > > + pwm_backlight: backlight { > + compatible = "pwm-backlight"; > + pwms = <&pm8937_pwm 0 100000>; > + brightness-levels = <0 255>; > + num-interpolated-steps = <255>; > + default-brightness-level = <128>; > + }; > + > battery: battery { > compatible = "simple-battery"; > charge-full-design-microamp-hours = <3000000>; > @@ -131,6 +139,23 @@ bq25601@6b{ > }; > }; > > +&pm8937_gpios { > + pwm_enable_default: pwm-enable-default-state { > + pins = "gpio8"; > + function = "dtest2"; Are you sure? > + output-low; > + bias-disable; > + qcom,drive-strength = <2>; > + }; > +}; > + > +&pm8937_pwm { > + pinctrl-0 = <&pwm_enable_default>; > + pinctrl-names = "default"; We normally put this under the backlight node, but I'm not sure which one is more correct.. it may be that this one is, given we're controlling the pin that the PWM signal is sent through Konrad ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] arm64: dts: qcom: msm8917-xiaomi-riva: Add display backlight 2025-02-12 22:31 ` Konrad Dybcio @ 2025-02-12 22:36 ` barnabas.czeman 0 siblings, 0 replies; 6+ messages in thread From: barnabas.czeman @ 2025-02-12 22:36 UTC (permalink / raw) To: Konrad Dybcio Cc: Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski, Conor Dooley, linux-arm-msm, devicetree, linux-kernel On 2025-02-12 23:31, Konrad Dybcio wrote: > On 12.02.2025 11:21 PM, Barnabás Czémán wrote: >> Redmi 5A display uses pwm backlight, add support for it. >> >> Signed-off-by: Barnabás Czémán <barnabas.czeman@mainlining.org> >> --- >> arch/arm64/boot/dts/qcom/msm8917-xiaomi-riva.dts | 25 >> ++++++++++++++++++++++++ >> 1 file changed, 25 insertions(+) >> >> diff --git a/arch/arm64/boot/dts/qcom/msm8917-xiaomi-riva.dts >> b/arch/arm64/boot/dts/qcom/msm8917-xiaomi-riva.dts >> index >> f1d22535fedd94467ba3f0a88b2110ce5360e7e1..8808306c989f54116052667887f9bf36b63c4c64 >> 100644 >> --- a/arch/arm64/boot/dts/qcom/msm8917-xiaomi-riva.dts >> +++ b/arch/arm64/boot/dts/qcom/msm8917-xiaomi-riva.dts >> @@ -20,6 +20,14 @@ / { >> qcom,msm-id = <QCOM_ID_MSM8917 0>; >> qcom,board-id = <0x1000b 2>, <0x2000b 2>; >> >> + pwm_backlight: backlight { >> + compatible = "pwm-backlight"; >> + pwms = <&pm8937_pwm 0 100000>; >> + brightness-levels = <0 255>; >> + num-interpolated-steps = <255>; >> + default-brightness-level = <128>; >> + }; >> + >> battery: battery { >> compatible = "simple-battery"; >> charge-full-design-microamp-hours = <3000000>; >> @@ -131,6 +139,23 @@ bq25601@6b{ >> }; >> }; >> >> +&pm8937_gpios { >> + pwm_enable_default: pwm-enable-default-state { >> + pins = "gpio8"; >> + function = "dtest2"; > > Are you sure? Yes, https://github.com/Mi-Thorium/kernel_devicetree_xiaomi-msm8937/blob/dts/mi8937/4.9/master/wingtech/msm8917/common/pm8937.dtsi#L24-L31 >> + output-low; >> + bias-disable; >> + qcom,drive-strength = <2>; >> + }; >> +}; >> + >> +&pm8937_pwm { >> + pinctrl-0 = <&pwm_enable_default>; >> + pinctrl-names = "default"; > > We normally put this under the backlight node, but I'm not sure which > one is more correct.. it may be that this one is, given we're > controlling the pin that the PWM signal is sent through It is for enabling pwm and not backlight, it should be placed here otherwise backlight will not work correctly. > > Konrad ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2025-02-12 22:37 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2025-02-12 22:21 [PATCH 0/2] Add PM8937 PWM and display backlight for Redmi 5A Barnabás Czémán 2025-02-12 22:21 ` [PATCH 1/2] arm64: dts: qcom: pm8937: Add LPG PWM driver Barnabás Czémán 2025-02-12 22:27 ` Konrad Dybcio 2025-02-12 22:21 ` [PATCH 2/2] arm64: dts: qcom: msm8917-xiaomi-riva: Add display backlight Barnabás Czémán 2025-02-12 22:31 ` Konrad Dybcio 2025-02-12 22:36 ` barnabas.czeman
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox