]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ARM: tegra: lg-x3: Add USB and power related nodes
authorSvyatoslav Ryhel <clamor95@gmail.com>
Mon, 26 Jan 2026 10:10:16 +0000 (12:10 +0200)
committerThierry Reding <treding@nvidia.com>
Fri, 27 Mar 2026 15:03:46 +0000 (16:03 +0100)
Add missing charger, MUIC and ADC sensor nodes. Reconfigure USB, set one
of the ADC channels as the fuel gauge temperature sensor and add a battery
thermal zone.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
arch/arm/boot/dts/nvidia/tegra30-lg-x3.dtsi

index 6eea8eacd7d55e41fc1c058b2b5308caed5dcf3d..768e201456d8afa6d02f24ed7f3e433c85790c31 100644 (file)
                                syna,clip-y-low = <0>;
                        };
                };
+
+               max14526: muic@44 {
+                       compatible = "maxim,max14526";
+                       reg = <0x44>;
+
+                       interrupt-parent = <&gpio>;
+                       interrupts = <TEGRA_GPIO(J, 0) IRQ_TYPE_EDGE_FALLING>;
+
+                       muic_con: connector {
+                               compatible = "usb-b-connector";
+                               label = "micro-USB";
+                               type = "micro";
+                       };
+
+                       port {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               muic_to_charger: endpoint@0 {
+                                       reg = <0>;
+                                       remote-endpoint = <&charger_input>;
+                               };
+                       };
+               };
+
+               tsc2007: adc@48 {
+                       compatible = "ti,tsc2007";
+                       reg = <0x48>;
+
+                       ti,x-plate-ohms = <1>;
+                       #io-channel-cells = <1>;
+               };
        };
 
        cam_i2c: i2c@7000c500 {
                        };
                };
 
+               max8971: charger@35 {
+                       compatible = "maxim,max8971";
+                       reg = <0x35>;
+
+                       interrupt-parent = <&gpio>;
+                       interrupts = <TEGRA_GPIO(J, 2) IRQ_TYPE_LEVEL_LOW>;
+
+                       monitored-battery = <&battery>;
+
+                       port {
+                               charger_input: endpoint {
+                                       remote-endpoint = <&muic_to_charger>;
+                               };
+                       };
+               };
+
                fuel-gauge@36 {
                        compatible = "maxim,max17043";
                        reg = <0x36>;
                        interrupts = <TEGRA_GPIO(S, 0) IRQ_TYPE_EDGE_FALLING>;
 
                        monitored-battery = <&battery>;
+                       power-supplies = <&max8971>;
+
+                       io-channels = <&tbattery 0>;
+                       io-channel-names = "temp";
 
                        maxim,alert-low-soc-level = <10>;
                        wakeup-source;
        usb@7d000000 {
                compatible = "nvidia,tegra30-udc";
                status = "okay";
-               dr_mode = "peripheral";
+               dr_mode = "otg";
+               extcon = <&max14526>, <&max14526>;
        };
 
        usb-phy@7d000000 {
                status = "okay";
-               dr_mode = "peripheral";
+               dr_mode = "otg";
                nvidia,hssync-start-delay = <0>;
                nvidia,xcvr-lsfslew = <2>;
                nvidia,xcvr-lsrslew = <2>;
                                         <&tegra_car TEGRA30_CLK_EXTERN1>;
        };
 
+       tbattery: thermal-sensor-battery {
+               compatible = "generic-adc-thermal";
+               #thermal-sensor-cells = <0>;
+
+               io-channels = <&tsc2007 4>;
+               io-channel-names = "sensor-channel";
+               #io-channel-cells = <1>;
+
+               temperature-lookup-table = <
+                       (-50000) 4100 (-40000) 3980 (-30000) 3815 (-20000) 3610
+                       (-10000) 3285        0 2880    10000 2445    20000 1955
+                          30000 1440    40000 1125    50000  840    60000  665
+                          70000  465    80000  350    90000  230   100000  185 >;
+       };
+
        thermal-zones {
+               battery-thermal {
+                       polling-delay-passive = <0>; /* milliseconds */
+                       polling-delay = <20000>; /* milliseconds */
+
+                       thermal-sensors = <&tbattery>;
+
+                       trips {
+                               battery-alert {
+                                       temperature = <55000>;
+                                       hysteresis = <2000>;
+                                       type = "hot";
+                               };
+
+                               battery-crit {
+                                       temperature = <60000>;
+                                       hysteresis = <2000>;
+                                       type = "critical";
+                               };
+                       };
+               };
+
                /*
                 * NCT72 has two sensors:
                 *