Describe embedded controller, its interrupt and required thermal zones.
Add EC's reset GPIO to reserved range, as triggering it during device
operation leads to unrecoverable and unusable state.

Signed-off-by: Aleksandrs Vinarskis <[email protected]>
---
 .../boot/dts/qcom/x1e80100-dell-xps13-9345.dts     | 86 +++++++++++++++++++++-
 1 file changed, 84 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/x1e80100-dell-xps13-9345.dts 
b/arch/arm64/boot/dts/qcom/x1e80100-dell-xps13-9345.dts
index 2be5a37c00cc..2b5b9061c56f 100644
--- a/arch/arm64/boot/dts/qcom/x1e80100-dell-xps13-9345.dts
+++ b/arch/arm64/boot/dts/qcom/x1e80100-dell-xps13-9345.dts
@@ -759,8 +759,32 @@ retimer_ss0_con_sbu_out: endpoint {
 
 &i2c5 {
        clock-frequency = <100000>;
-       status = "disabled";
-       /* EC @0x3b */
+       status = "okay";
+
+       embedded-controller@3b {
+               compatible = "dell,xps13-9345-ec";
+               reg = <0x3b>;
+
+               interrupts-extended = <&tlmm 66 IRQ_TYPE_LEVEL_LOW>;
+
+               pinctrl-0 = <&ec_int_n_default>;
+               pinctrl-names = "default";
+
+               io-channels = <&pmk8550_vadc ADC5_GEN3_AMUX3_GPIO_100K_PU(1)>,
+                             <&pmk8550_vadc ADC5_GEN3_AMUX4_GPIO_100K_PU(1)>,
+                             <&pmk8550_vadc ADC5_GEN3_AMUX1_THM_100K_PU(1)>,
+                             <&pmk8550_vadc ADC5_GEN3_AMUX2_THM_100K_PU(1)>,
+                             <&pmk8550_vadc ADC5_GEN3_AMUX3_THM_100K_PU(1)>,
+                             <&pmk8550_vadc ADC5_GEN3_AMUX4_THM_100K_PU(1)>,
+                             <&pmk8550_vadc ADC5_GEN3_AMUX5_THM_100K_PU(1)>;
+               io-channel-names = "sys_therm0",
+                                  "sys_therm1",
+                                  "sys_therm2",
+                                  "sys_therm3",
+                                  "sys_therm4",
+                                  "sys_therm5",
+                                  "sys_therm6";
+       };
 };
 
 &i2c7 {
@@ -1025,6 +1049,57 @@ rtmr0_1p8_reg_en: rtmr0-1p8-reg-en-state {
        };
 };
 
+&pmk8550_vadc {
+       sys_therm0: channel@14c {
+               reg = <ADC5_GEN3_AMUX3_GPIO_100K_PU(1)>;
+               qcom,hw-settle-time = <200>;
+               qcom,ratiometric;
+               label = "lpddr5_therm";
+       };
+
+       sys_therm1: channel@14d {
+               reg = <ADC5_GEN3_AMUX4_GPIO_100K_PU(1)>;
+               qcom,hw-settle-time = <200>;
+               qcom,ratiometric;
+               label = "usb_charger_left_therm";
+       };
+
+       sys_therm2: channel@144 {
+               reg = <ADC5_GEN3_AMUX1_THM_100K_PU(1)>;
+               qcom,hw-settle-time = <200>;
+               qcom,ratiometric;
+               label = "vph_pwr_therm";
+       };
+
+       sys_therm3: channel@145 {
+               reg = <ADC5_GEN3_AMUX2_THM_100K_PU(1)>;
+               qcom,hw-settle-time = <200>;
+               qcom,ratiometric;
+               label = "usb_charger_right_therm";
+       };
+
+       sys_therm4: channel@146 {
+               reg = <ADC5_GEN3_AMUX3_THM_100K_PU(1)>;
+               qcom,hw-settle-time = <200>;
+               qcom,ratiometric;
+               label = "ssd_conn_therm";
+       };
+
+       sys_therm5: channel@147 {
+               reg = <ADC5_GEN3_AMUX4_THM_100K_PU(1)>;
+               qcom,hw-settle-time = <200>;
+               qcom,ratiometric;
+               label = "sys_therm5";
+       };
+
+       sys_therm6: channel@148 {
+               reg = <ADC5_GEN3_AMUX5_THM_100K_PU(1)>;
+               qcom,hw-settle-time = <200>;
+               qcom,ratiometric;
+               label = "keyboard_therm";
+       };
+};
+
 &qupv3_0 {
        status = "okay";
 };
@@ -1071,6 +1146,7 @@ &smb2360_1_eusb2_repeater {
 
 &tlmm {
        gpio-reserved-ranges = <44 4>,  /* SPI11 (TPM) */
+                              <65 1>,  /* EC Reset, accessible but yields 
system unusable */
                               <76 4>,  /* SPI19 (TZ Protected) */
                               <238 1>; /* UFS Reset */
 
@@ -1081,6 +1157,12 @@ cam_indicator_en: cam-indicator-en-state {
                bias-disable;
        };
 
+       ec_int_n_default: ec-int-n-state {
+               pins = "gpio66";
+               function = "gpio";
+               bias-disable;
+       };
+
        edp_bl_en: edp-bl-en-state {
                pins = "gpio74";
                function = "gpio";

-- 
2.54.0


Reply via email to