[PATCH v1 06/18] ARM: tegra: tegratab: Configure USB and power supply
From: Svyatoslav Ryhel
Date: Sun Nov 22 2026 - 15:14:48 EST
Previously, USB was partially broken on the Tegra Note 7, as it supports
OTG and requires proper configuration of both the power supply and the
USB controller/PHY.
Configure the power supply by adding and linking the battery cell,
charger, and fuel gauge nodes. Configure the USB controller for OTG
support using the Palmas extcon for ID pin detection and the charger for
VBUS, and add the usb-connector node.
The device now works in both peripheral and host modes as expected.
Signed-off-by: Svyatoslav Ryhel <clamor95@xxxxxxxxx>
---
.../tegra114-nvidia-tegratab-common.dtsi | 98 ++++++++++++++++++-
1 file changed, 94 insertions(+), 4 deletions(-)
diff --git a/arch/arm/boot/dts/nvidia/tegra114-nvidia-tegratab-common.dtsi b/arch/arm/boot/dts/nvidia/tegra114-nvidia-tegratab-common.dtsi
index 26f1f7dbcc4c7..2ccee3b70aac9 100644
--- a/arch/arm/boot/dts/nvidia/tegra114-nvidia-tegratab-common.dtsi
+++ b/arch/arm/boot/dts/nvidia/tegra114-nvidia-tegratab-common.dtsi
@@ -940,6 +940,48 @@ pwm@7000a000 {
status = "okay";
};
+ gen1_i2c: i2c@7000c000 {
+ status = "okay";
+ clock-frequency = <100000>;
+
+ fuel-gauge@36 {
+ compatible = "maxim,max17048";
+ reg = <0x36>;
+
+ interrupt-parent = <&gpio>;
+ interrupts = <TEGRA_GPIO(Q, 5) IRQ_TYPE_EDGE_FALLING>;
+
+ monitored-battery = <&battery>;
+ power-supplies = <&bq24193>;
+
+ maxim,alert-low-soc-level = <10>;
+ maxim,double-soc;
+
+ wakeup-source;
+ };
+
+ bq24193: charger@6b {
+ compatible = "ti,bq24193";
+ reg = <0x6b>;
+
+ interrupt-parent = <&gpio>;
+ interrupts = <TEGRA_GPIO(J, 0) IRQ_TYPE_EDGE_FALLING>;
+
+ ce-gpios = <&gpio TEGRA_GPIO(I, 4) GPIO_ACTIVE_LOW>;
+
+ monitored-battery = <&battery>;
+
+ omit-battery-class;
+ ti,system-minimum-microvolt = <3100000>;
+
+ usb_otg_vbus: usb-otg-vbus {
+ regulator-name = "usb_otg_vbus";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ };
+ };
+ };
+
i2c@7000d000 {
status = "okay";
clock-frequency = <400000>;
@@ -954,6 +996,15 @@ palmas: pmic@58 {
ti,system-power-controller;
+ palmas_extcon: extcon {
+ compatible = "ti,palmas-usb-vid";
+
+ ti,enable-vbus-detection;
+ ti,enable-id-detection;
+
+ ti,wakeup;
+ };
+
palmas_gpio: gpio {
compatible = "ti,palmas-gpio";
gpio-controller;
@@ -1210,19 +1261,34 @@ mmc@78000600 {
non-removable;
};
+ /* Micro USB */
usb@7d000000 {
+ compatible = "nvidia,tegra114-udc";
status = "okay";
+ dr_mode = "otg";
+
+ hnp-disable;
+ srp-disable;
+ adp-disable;
+
+ usb-role-switch;
+ extcon = <&bq24193>, <&palmas_extcon>; /* vbus, id */
+ vbus-supply = <&usb_otg_vbus>;
+
+ port {
+ usb_in: endpoint {
+ remote-endpoint = <&usb_connector_out>;
+ };
+ };
};
usb-phy@7d000000 {
status = "okay";
+ dr_mode = "otg";
nvidia,xcvr-setup = <7>;
nvidia,xcvr-lsfslew = <2>;
nvidia,xcvr-lsrslew = <2>;
- interrupts = <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>;
- /* Should be changed to "otg" once we have vbus_supply */
- /* As of now, USB devices need to be powered externally */
- dr_mode = "host";
+ vbus-supply = <&avdd_usb>;
};
backlight: backlight {
@@ -1235,6 +1301,19 @@ backlight: backlight {
power-supply = <&vdd_3v7_bl>;
};
+ battery: battery-cell {
+ compatible = "simple-battery";
+ device-chemistry = "lithium-ion-polymer";
+
+ charge-full-design-microamp-hours = <4100000>;
+ energy-full-design-microwatt-hours = <15100000>;
+
+ precharge-current-microamp = <256000>;
+ charge-term-current-microamp = <256000>;
+
+ operating-range-celsius = <0 45>;
+ };
+
clk32k_in: clock-32k {
compatible = "fixed-clock";
clock-frequency = <32768>;
@@ -1242,6 +1321,17 @@ clk32k_in: clock-32k {
#clock-cells = <0>;
};
+ connector-usb {
+ compatible = "usb-b-connector";
+ type = "micro";
+
+ port {
+ usb_connector_out: endpoint {
+ remote-endpoint = <&usb_in>;
+ };
+ };
+ };
+
gpio-keys {
compatible = "gpio-keys";
--
2.53.0