Skip to content

Commit

Permalink
SM8550: Odin 2 Pro LED support & bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
r3claimer committed Feb 26, 2025
1 parent d9be0b6 commit cf8bcfe
Show file tree
Hide file tree
Showing 6 changed files with 522 additions and 5 deletions.
3 changes: 2 additions & 1 deletion projects/Qualcomm/devices/SM8550/linux/linux.aarch64.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5474,7 +5474,7 @@ CONFIG_LEDS_PWM=y
# CONFIG_LEDS_GROUP_MULTICOLOR is not set
# CONFIG_LEDS_KTD202X is not set
# CONFIG_LEDS_NCP5623 is not set
# CONFIG_LEDS_PWM_MULTICOLOR is not set
CONFIG_LEDS_PWM_MULTICOLOR=y
CONFIG_LEDS_QCOM_LPG=y

#
Expand Down Expand Up @@ -6798,6 +6798,7 @@ CONFIG_QCOM_SPMI_ADC5=y

# CONFIG_NTB is not set
CONFIG_PWM=y
CONFIG_PWM_SN3112=y
# CONFIG_PWM_DEBUG is not set
# CONFIG_PWM_ATMEL_TCB is not set
# CONFIG_PWM_CLK is not set
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
diff -rupbN linux.orig/arch/arm64/boot/dts/qcom/qcs8550-ayn-odin2pro.dts linux/arch/arm64/boot/dts/qcom/qcs8550-ayn-odin2pro.dts
--- linux.orig/arch/arm64/boot/dts/qcom/qcs8550-ayn-odin2pro.dts 1970-01-01 00:00:00.000000000 +0000
+++ linux/arch/arm64/boot/dts/qcom/qcs8550-ayn-odin2pro.dts 2025-02-26 02:32:30.675906248 +0000
@@ -0,0 +1,237 @@
+++ linux/arch/arm64/boot/dts/qcom/qcs8550-ayn-odin2pro.dts 2025-02-26 13:52:56.398992835 +0000
@@ -0,0 +1,363 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/*
+ * Copyright (c) 2025, Teguh Sobirin.
Expand Down Expand Up @@ -40,6 +40,106 @@ diff -rupbN linux.orig/arch/arm64/boot/dts/qcom/qcs8550-ayn-odin2pro.dts linux/a
+ gpio = <&tlmm 142 GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+ };
+
+ led_left_side: led-controller-1 {
+ compatible = "pwm-leds-multicolor";
+
+ multi-led {
+ label = "left-side";
+ color = <LED_COLOR_ID_RGB>;
+ max-brightness = <255>;
+
+ led-red {
+ color = <LED_COLOR_ID_RED>;
+ pwms = <&pwm_rgb_left 0>;
+ };
+
+ led-green {
+ color = <LED_COLOR_ID_GREEN>;
+ pwms = <&pwm_rgb_left 1>;
+ };
+
+ led-blue {
+ color = <LED_COLOR_ID_BLUE>;
+ pwms = <&pwm_rgb_left 2>;
+ };
+ };
+ };
+
+ led_left_joystick: led-controller-2 {
+ compatible = "pwm-leds-multicolor";
+
+ multi-led {
+ label = "left-joystick";
+ color = <LED_COLOR_ID_RGB>;
+ max-brightness = <255>;
+
+ led-red {
+ color = <LED_COLOR_ID_RED>;
+ pwms = <&pwm_rgb_left 6>;
+ };
+
+ led-green {
+ color = <LED_COLOR_ID_GREEN>;
+ pwms = <&pwm_rgb_left 7>;
+ };
+
+ led-blue {
+ color = <LED_COLOR_ID_BLUE>;
+ pwms = <&pwm_rgb_left 8>;
+ };
+ };
+ };
+
+ led_right_side: led-controller-3 {
+ compatible = "pwm-leds-multicolor";
+
+ multi-led {
+ label = "right-side";
+ color = <LED_COLOR_ID_RGB>;
+ max-brightness = <255>;
+
+ led-red {
+ color = <LED_COLOR_ID_RED>;
+ pwms = <&pwm_rgb_right 0>;
+ };
+
+ led-green {
+ color = <LED_COLOR_ID_GREEN>;
+ pwms = <&pwm_rgb_right 1>;
+ };
+
+ led-blue {
+ color = <LED_COLOR_ID_BLUE>;
+ pwms = <&pwm_rgb_right 2>;
+ };
+ };
+ };
+
+ led_right_joystick: led-controller-4 {
+ compatible = "pwm-leds-multicolor";
+
+ multi-led {
+ label = "right-joystick";
+ color = <LED_COLOR_ID_RGB>;
+ max-brightness = <255>;
+
+ led-red {
+ color = <LED_COLOR_ID_RED>;
+ pwms = <&pwm_rgb_right 6>;
+ };
+
+ led-green {
+ color = <LED_COLOR_ID_GREEN>;
+ pwms = <&pwm_rgb_right 7>;
+ };
+
+ led-blue {
+ color = <LED_COLOR_ID_BLUE>;
+ pwms = <&pwm_rgb_right 8>;
+ };
+ };
+ };
+};
+
+&display_panel {
Expand Down Expand Up @@ -86,6 +186,19 @@ diff -rupbN linux.orig/arch/arm64/boot/dts/qcom/qcs8550-ayn-odin2pro.dts linux/a
+ status = "okay";
+};
+
+&i2c0 {
+ clock-frequency = <400000>;
+ status = "okay";
+
+ pwm_rgb_left: sn3112@54 {
+ compatible = "si-en,sn3112-pwm";
+ reg = <0x54>;
+ sdb-gpios = <&tlmm 55 GPIO_ACTIVE_LOW>;
+ vdd-supply = <&vdd_mcu_3v3>;
+ #pwm-cells = <1>;
+ };
+};
+
+&i2c4 {
+ clock-frequency = <400000>;
+ status = "okay";
Expand Down Expand Up @@ -124,6 +237,19 @@ diff -rupbN linux.orig/arch/arm64/boot/dts/qcom/qcs8550-ayn-odin2pro.dts linux/a
+ };
+};
+
+&i2c12 {
+ clock-frequency = <400000>;
+ status = "okay";
+
+ pwm_rgb_right: sn3112@54 {
+ compatible = "si-en,sn3112-pwm";
+ reg = <0x54>;
+ sdb-gpios = <&tlmm 56 GPIO_ACTIVE_LOW>;
+ vdd-supply = <&vdd_mcu_3v3>;
+ #pwm-cells = <1>;
+ };
+};
+
+&remoteproc_adsp {
+ firmware-name = "qcom/sm8550/ayn/odin2portal/adsp.mbn",
+ "qcom/sm8550/ayn/odin2portal/adsp_dtb.mbn";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4861,8 +4861,8 @@ diff -rupbN linux.orig/drivers/mmc/host/sdhci-msm-downstream.c linux/drivers/mmc
+ for_each_available_child_of_node(np, group_node) {
+ err = of_property_read_u32(group_node, "mask", &mask);
+ if (err) {
+ dev_info(&pdev->dev, "Error reading group mask: %d\n",
+ err);
+ //dev_info(&pdev->dev, "Error reading group mask: %d\n",
+ // err);
+ continue;
+ }
+ qcg->mask.bits[0] = mask;
Expand Down
Loading

0 comments on commit cf8bcfe

Please # to comment.