* [PATCH] arm64: dts: qcom: msm8996-xiaomi-*: Add LEDs
@ 2022-07-28 18:01 Yassine Oudjana
2022-08-29 23:46 ` Bjorn Andersson
0 siblings, 1 reply; 2+ messages in thread
From: Yassine Oudjana @ 2022-07-28 18:01 UTC (permalink / raw)
To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Rob Herring,
Krzysztof Kozlowski
Cc: Yassine Oudjana, Yassine Oudjana, linux-arm-msm, devicetree,
phone-devel, linux-kernel
From: Yassine Oudjana <y.oudjana@protonmail.com>
Add LEDs found on the Xiaomi MSM8996 devices. The devices share
a status RGB LED mounted on the front, as well as a PWM-driven
IR LED for remote control (sometimes known as an IR blaster).
The Mi Note 2 has an additional pair of white LEDs used as backlights
for the touchkeys driven by the PM8994 LPG block.
Signed-off-by: Yassine Oudjana <y.oudjana@protonmail.com>
---
.../boot/dts/qcom/msm8996-xiaomi-common.dtsi | 54 +++++++++++++++++++
.../boot/dts/qcom/msm8996-xiaomi-scorpio.dts | 30 +++++++++++
2 files changed, 84 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/msm8996-xiaomi-common.dtsi b/arch/arm64/boot/dts/qcom/msm8996-xiaomi-common.dtsi
index 627649979891..ef9a8aa9c2b9 100644
--- a/arch/arm64/boot/dts/qcom/msm8996-xiaomi-common.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8996-xiaomi-common.dtsi
@@ -58,6 +58,14 @@ key-dome {
};
};
+ irled {
+ compatible = "pwm-ir-tx";
+ pwms = <&pm8994_lpg 1 1000000>;
+
+ pinctrl-names = "default";
+ pinctrl-0 = <&irled_default>;
+ };
+
reserved-memory {
memory@88800000 {
reg = <0x0 0x88800000 0x0 0x1400000>;
@@ -297,6 +305,41 @@ &pm8994_resin {
linux,code = <KEY_VOLUMEDOWN>;
};
+&pm8994_lpg {
+ status = "okay";
+
+ qcom,power-source = <1>;
+};
+
+&pmi8994_lpg {
+ status = "okay";
+
+ qcom,power-source = <1>;
+
+ 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_BLUE>;
+ };
+
+ led@2 {
+ reg = <2>;
+ color = <LED_COLOR_ID_GREEN>;
+ };
+
+ led@3 {
+ reg = <3>;
+ color = <LED_COLOR_ID_RED>;
+ };
+ };
+};
+
&slpi_pil {
status = "okay";
@@ -608,6 +651,17 @@ vdd_gfx: s2 {
};
&pm8994_gpios {
+ irled_default: irled-default {
+ pinconf {
+ pins = "gpio5";
+ function = PMIC_GPIO_FUNC_FUNC1;
+ output-low;
+ qcom,drive-strength = <PMIC_GPIO_STRENGTH_HIGH>;
+ power-source = <PM8994_GPIO_S4>;
+ bias-disable;
+ };
+ };
+
wlan_en_default: wlan-en-state {
pins = "gpio8";
function = PMIC_GPIO_FUNC_NORMAL;
diff --git a/arch/arm64/boot/dts/qcom/msm8996-xiaomi-scorpio.dts b/arch/arm64/boot/dts/qcom/msm8996-xiaomi-scorpio.dts
index 30a9e4bed4af..0b47a659cc38 100644
--- a/arch/arm64/boot/dts/qcom/msm8996-xiaomi-scorpio.dts
+++ b/arch/arm64/boot/dts/qcom/msm8996-xiaomi-scorpio.dts
@@ -116,6 +116,25 @@ &mss_pil {
"qcom/msm8996/scorpio/modem.mbn";
};
+&pm8994_lpg {
+ pinctrl-names = "default";
+ pinctrl-0 = <&keypad_default>;
+
+ led@3 {
+ reg = <3>;
+ color = <LED_COLOR_ID_WHITE>;
+ function = LED_FUNCTION_KBD_BACKLIGHT;
+ function-enumerator = <1>;
+ };
+
+ led@6 {
+ reg = <6>;
+ color = <LED_COLOR_ID_WHITE>;
+ function = LED_FUNCTION_KBD_BACKLIGHT;
+ function-enumerator = <0>;
+ };
+};
+
&q6asmdai {
dai@0 {
reg = <0>;
@@ -258,6 +277,17 @@ &pm8994_gpios {
"PMIC_SLB", /* GPIO_20 */
"UIM_BATT_ALARM", /* GPIO_21 */
"NC"; /* GPIO_22 */
+
+ keypad_default: keypad-default {
+ pinconf {
+ pins = "gpio7", "gpio10";
+ function = PMIC_GPIO_FUNC_FUNC1;
+ output-low;
+ qcom,drive-strength = <PMIC_GPIO_STRENGTH_LOW>;
+ power-source = <PM8994_GPIO_S4>;
+ bias-disable;
+ };
+ };
};
&pm8994_mpps {
--
2.37.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] arm64: dts: qcom: msm8996-xiaomi-*: Add LEDs
2022-07-28 18:01 [PATCH] arm64: dts: qcom: msm8996-xiaomi-*: Add LEDs Yassine Oudjana
@ 2022-08-29 23:46 ` Bjorn Andersson
0 siblings, 0 replies; 2+ messages in thread
From: Bjorn Andersson @ 2022-08-29 23:46 UTC (permalink / raw)
To: robh+dt, Bjorn Andersson, yassine.oudjana, konrad.dybcio,
krzysztof.kozlowski+dt, agross
Cc: linux-arm-msm, y.oudjana, linux-kernel, phone-devel, devicetree
On Thu, 28 Jul 2022 19:01:20 +0100, Yassine Oudjana wrote:
> From: Yassine Oudjana <y.oudjana@protonmail.com>
>
> Add LEDs found on the Xiaomi MSM8996 devices. The devices share
> a status RGB LED mounted on the front, as well as a PWM-driven
> IR LED for remote control (sometimes known as an IR blaster).
> The Mi Note 2 has an additional pair of white LEDs used as backlights
> for the touchkeys driven by the PM8994 LPG block.
>
> [...]
Applied, thanks!
[1/1] arm64: dts: qcom: msm8996-xiaomi-*: Add LEDs
commit: d710fdfe484491679209ae0e11ac118da02f5d82
Best regards,
--
Bjorn Andersson <andersson@kernel.org>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-08-29 23:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-28 18:01 [PATCH] arm64: dts: qcom: msm8996-xiaomi-*: Add LEDs Yassine Oudjana
2022-08-29 23:46 ` 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).