Linux USB
 help / color / mirror / Atom feed
* [PATCH 0/6] Add USB support for Exynos7885 and enable USB and FG on gta3xllte
@ 2026-11-19 19:49 Umer Uddin via B4 Relay
  2026-11-19 19:49 ` [PATCH 1/6] dt-bindings: phy: samsung,usb3-drd-phy: Add Exynos7885 support Umer Uddin via B4 Relay
                   ` (5 more replies)
  0 siblings, 6 replies; 13+ messages in thread
From: Umer Uddin via B4 Relay @ 2026-11-19 19:49 UTC (permalink / raw)
  To: Vinod Koul, Neil Armstrong, Manivannan Sadhasivam, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Marek Szyprowski,
	Sylwester Nawrocki, Greg Kroah-Hartman, Peter Griffin,
	Alim Akhtar
  Cc: Krzysztof Kozlowski, linux-phy, devicetree, linux-kernel,
	linux-usb, linux-arm-kernel, linux-samsung-soc, Umer Uddin,
	David Virag

Hi guys, this patch series adds support for USB on Exynos7885. This series
is based on David Virag's work[1] I had rebased it onto krzk's for-next
tree and tested it on gta3xllte. This series also enables S2MU005 FG
on gta3xllte, which is also tested.

Please note, I did drop enabling USB on jackpotlte, this is because I
don't have the device myself to test the changes personally and I didn't
want to risk a regression on jackpotlte.

DT changes were tested with make dtbs_check W=1, and the dt styling check
scripts with --mode strict flags, both of which returned no warnings.

Best regards,
Umer

[1] https://github.com/VDavid003/linux/commits/linux-6.11-rc2-7885/

Signed-off-by: Umer Uddin <umer.uddin@mentallysanemainliners.org>
---
David Virag (4):
      dt-bindings: phy: samsung,usb3-drd-phy: Add Exynos7885 support
      dt-bindings: usb: samsung,exynos-dwc3: Add Exynos7885 support
      phy: exynos5-usbdrd: support Exynos7885 USB PHY
      arm64: dts: exynos: Enable USB in Exynos7885

Umer Uddin (2):
      arm64: dts: exynos: exynos7885-gta3xllte: Enable USB support
      arm64: dts: exynos: exynos7885-gta3xllte: Enable FuelGauge support

 .../bindings/phy/samsung,usb3-drd-phy.yaml         |  2 +
 .../bindings/usb/samsung,exynos-dwc3.yaml          |  3 ++
 .../arm64/boot/dts/exynos/exynos7885-gta3xllte.dts | 50 ++++++++++++++++++++++
 arch/arm64/boot/dts/exynos/exynos7885.dtsi         | 43 +++++++++++++++++++
 drivers/phy/samsung/phy-exynos5-usbdrd.c           | 27 ++++++++++++
 include/linux/soc/samsung/exynos-regs-pmu.h        |  3 ++
 6 files changed, 128 insertions(+)
---
base-commit: 397f550f3c8551b3ffbf3f45a571b58448514988
change-id: 20261119-gta3xllte-usb-battery-b95e4d89ae85

Best regards,
--  
Umer Uddin <umer.uddin@mentallysanemainliners.org>



^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 1/6] dt-bindings: phy: samsung,usb3-drd-phy: Add Exynos7885 support
  2026-11-19 19:49 [PATCH 0/6] Add USB support for Exynos7885 and enable USB and FG on gta3xllte Umer Uddin via B4 Relay
@ 2026-11-19 19:49 ` Umer Uddin via B4 Relay
  2026-11-19 19:52   ` sashiko-bot
  2026-11-19 19:49 ` [PATCH 2/6] dt-bindings: usb: samsung,exynos-dwc3: " Umer Uddin via B4 Relay
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 13+ messages in thread
From: Umer Uddin via B4 Relay @ 2026-11-19 19:49 UTC (permalink / raw)
  To: Vinod Koul, Neil Armstrong, Manivannan Sadhasivam, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Marek Szyprowski,
	Sylwester Nawrocki, Greg Kroah-Hartman, Peter Griffin,
	Alim Akhtar
  Cc: Krzysztof Kozlowski, linux-phy, devicetree, linux-kernel,
	linux-usb, linux-arm-kernel, linux-samsung-soc, Umer Uddin,
	David Virag

From: David Virag <virag.david003@gmail.com>

Document Exynos7885 compatible.
Exynos7885 USB PHY has two clocks (ref and phy) like Exynos850, which
are already described in bindings.

Signed-off-by: David Virag <virag.david003@gmail.com>
Signed-off-by: Umer Uddin <umer.uddin@mentallysanemainliners.org>
---
 Documentation/devicetree/bindings/phy/samsung,usb3-drd-phy.yaml | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/phy/samsung,usb3-drd-phy.yaml b/Documentation/devicetree/bindings/phy/samsung,usb3-drd-phy.yaml
index a1b3d9e6a094..f644a4aa1e95 100644
--- a/Documentation/devicetree/bindings/phy/samsung,usb3-drd-phy.yaml
+++ b/Documentation/devicetree/bindings/phy/samsung,usb3-drd-phy.yaml
@@ -32,6 +32,7 @@ properties:
       - samsung,exynos5433-usbdrd-phy
       - samsung,exynos7-usbdrd-phy
       - samsung,exynos7870-usbdrd-phy
+      - samsung,exynos7885-usbdrd-phy
       - samsung,exynos850-usbdrd-phy
       - samsung,exynos990-usbdrd-phy
       - samsung,exynosautov920-usb31drd-combo-ssphy
@@ -234,6 +235,7 @@ allOf:
               - samsung,exynos5250-usbdrd-phy
               - samsung,exynos5420-usbdrd-phy
               - samsung,exynos7870-usbdrd-phy
+              - samsung,exynos7885-usbdrd-phy
               - samsung,exynos850-usbdrd-phy
               - samsung,exynos990-usbdrd-phy
               - samsung,exynosautov920-usb31drd-combo-ssphy

-- 
2.56.1



^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 2/6] dt-bindings: usb: samsung,exynos-dwc3: Add Exynos7885 support
  2026-11-19 19:49 [PATCH 0/6] Add USB support for Exynos7885 and enable USB and FG on gta3xllte Umer Uddin via B4 Relay
  2026-11-19 19:49 ` [PATCH 1/6] dt-bindings: phy: samsung,usb3-drd-phy: Add Exynos7885 support Umer Uddin via B4 Relay
@ 2026-11-19 19:49 ` Umer Uddin via B4 Relay
  2026-11-19 19:52   ` sashiko-bot
  2026-11-19 19:49 ` [PATCH 3/6] phy: exynos5-usbdrd: support Exynos7885 USB PHY Umer Uddin via B4 Relay
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 13+ messages in thread
From: Umer Uddin via B4 Relay @ 2026-11-19 19:49 UTC (permalink / raw)
  To: Vinod Koul, Neil Armstrong, Manivannan Sadhasivam, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Marek Szyprowski,
	Sylwester Nawrocki, Greg Kroah-Hartman, Peter Griffin,
	Alim Akhtar
  Cc: Krzysztof Kozlowski, linux-phy, devicetree, linux-kernel,
	linux-usb, linux-arm-kernel, linux-samsung-soc, Umer Uddin,
	David Virag

From: David Virag <virag.david003@gmail.com>

Exynos7885 SoC has a DWC3 compatible USB controller, so it can reuse the
existing Exynos glue layer. Clocks are the same as on Exynos850.

Signed-off-by: David Virag <virag.david003@gmail.com>
[Umer Uddin: use samsung,exynos850-dwusb3 as fallback compatible instead
of adding a separate match entry to the dwc3-exynos driver]
Signed-off-by: Umer Uddin <umer.uddin@mentallysanemainliners.org>
---
 Documentation/devicetree/bindings/usb/samsung,exynos-dwc3.yaml | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Documentation/devicetree/bindings/usb/samsung,exynos-dwc3.yaml b/Documentation/devicetree/bindings/usb/samsung,exynos-dwc3.yaml
index 8af0143c3e47..f62e3ed82257 100644
--- a/Documentation/devicetree/bindings/usb/samsung,exynos-dwc3.yaml
+++ b/Documentation/devicetree/bindings/usb/samsung,exynos-dwc3.yaml
@@ -24,6 +24,9 @@ properties:
       - items:
           - const: samsung,exynos8890-dwusb3
           - const: samsung,exynos7-dwusb3
+      - items:
+          - const: samsung,exynos7885-dwusb3
+          - const: samsung,exynos850-dwusb3
       - items:
           - const: samsung,exynos990-dwusb3
           - const: samsung,exynos850-dwusb3

-- 
2.56.1



^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 3/6] phy: exynos5-usbdrd: support Exynos7885 USB PHY
  2026-11-19 19:49 [PATCH 0/6] Add USB support for Exynos7885 and enable USB and FG on gta3xllte Umer Uddin via B4 Relay
  2026-11-19 19:49 ` [PATCH 1/6] dt-bindings: phy: samsung,usb3-drd-phy: Add Exynos7885 support Umer Uddin via B4 Relay
  2026-11-19 19:49 ` [PATCH 2/6] dt-bindings: usb: samsung,exynos-dwc3: " Umer Uddin via B4 Relay
@ 2026-11-19 19:49 ` Umer Uddin via B4 Relay
  2026-11-19 19:55   ` sashiko-bot
  2026-11-19 19:49 ` [PATCH 4/6] arm64: dts: exynos: Enable USB in Exynos7885 Umer Uddin via B4 Relay
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 13+ messages in thread
From: Umer Uddin via B4 Relay @ 2026-11-19 19:49 UTC (permalink / raw)
  To: Vinod Koul, Neil Armstrong, Manivannan Sadhasivam, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Marek Szyprowski,
	Sylwester Nawrocki, Greg Kroah-Hartman, Peter Griffin,
	Alim Akhtar
  Cc: Krzysztof Kozlowski, linux-phy, devicetree, linux-kernel,
	linux-usb, linux-arm-kernel, linux-samsung-soc, Umer Uddin,
	David Virag

From: David Virag <virag.david003@gmail.com>

The Exynos7885 SoC has an Exynos USB PHY that theoretically supports
USB3 SuperSpeed, but all known devices using it only have USB2 and the
vendor driver has USB3 function stubbed out, so we'll only support USB2.

Apart from this mysterious USB3 capability, it's the closest to Exynos850
out of those supported. Unlike other SoCs though, this one doesn't set
the reference clock by default, so we have to set it manually.

For this, create a set_ref_clk_rate property in drvdata that can be set
to a predefined value to set the clockrate to.

Signed-off-by: David Virag <virag.david003@gmail.com>
[Umer Uddin: Rebased onto krzk for-next branch]
Signed-off-by: Umer Uddin <umer.uddin@mentallysanemainliners.org>
---
 drivers/phy/samsung/phy-exynos5-usbdrd.c    | 27 +++++++++++++++++++++++++++
 include/linux/soc/samsung/exynos-regs-pmu.h |  3 +++
 2 files changed, 30 insertions(+)

diff --git a/drivers/phy/samsung/phy-exynos5-usbdrd.c b/drivers/phy/samsung/phy-exynos5-usbdrd.c
index 087d552eb511..8f00586f11a6 100644
--- a/drivers/phy/samsung/phy-exynos5-usbdrd.c
+++ b/drivers/phy/samsung/phy-exynos5-usbdrd.c
@@ -23,6 +23,7 @@
 #include <linux/regmap.h>
 #include <linux/regulator/consumer.h>
 #include <linux/soc/samsung/exynos-regs-pmu.h>
+#include <linux/units.h>
 #include <linux/usb/typec.h>
 #include <linux/usb/typec_mux.h>
 
@@ -483,6 +484,7 @@ struct exynos5_usbdrd_phy_drvdata {
 	int n_clks;
 	const char * const *core_clk_names;
 	int n_core_clks;
+	u32 set_ref_clk_rate;
 	const char * const *regulator_names;
 	int n_regulators;
 	u32 pmu_offset_usbdrd0_phy;
@@ -1847,6 +1849,15 @@ static int exynos5_usbdrd_phy_clk_handle(struct exynos5_usbdrd_phy *phy_drd)
 			return dev_err_probe(phy_drd->dev, -ENODEV,
 					     "failed to find phy reference clock\n");
 
+		/* Some SoCs (e.g. Exynos7885) leave the reference clock unset */
+		if (phy_drd->drv_data->set_ref_clk_rate) {
+			ret = clk_set_rate(ref_clk,
+					   phy_drd->drv_data->set_ref_clk_rate);
+			if (ret)
+				return dev_err_probe(phy_drd->dev, ret,
+						     "failed to set ref clock rate\n");
+		}
+
 		ref_rate = clk_get_rate(ref_clk);
 		ret = exynos5_rate_to_clk(ref_rate, &phy_drd->extrefclk);
 		if (ret)
@@ -2107,6 +2118,19 @@ static const struct exynos5_usbdrd_phy_drvdata exynos850_usbdrd_phy = {
 	.n_regulators		= ARRAY_SIZE(exynos5_regulator_names),
 };
 
+static const struct exynos5_usbdrd_phy_drvdata exynos7885_usbdrd_phy = {
+	.phy_cfg		= phy_cfg_exynos850,
+	.phy_ops		= &exynos850_usbdrd_phy_ops,
+	.pmu_offset_usbdrd0_phy	= EXYNOS7885_PHY_CTRL_USB20,
+	.clk_names		= exynos5_clk_names,
+	.n_clks			= ARRAY_SIZE(exynos5_clk_names),
+	.core_clk_names		= exynos5_core_clk_names,
+	.n_core_clks		= ARRAY_SIZE(exynos5_core_clk_names),
+	.regulator_names	= exynos5_regulator_names,
+	.n_regulators		= ARRAY_SIZE(exynos5_regulator_names),
+	.set_ref_clk_rate	= 50 * HZ_PER_MHZ,
+};
+
 static const struct exynos5_usbdrd_phy_tuning exynos990_tunes_utmi_postinit[] = {
 	PHY_TUNING_ENTRY_PHY(EXYNOS850_DRD_HSPPARACON,
 			     (HSPPARACON_TXVREF |
@@ -2929,6 +2953,9 @@ static const struct of_device_id exynos5_usbdrd_phy_of_match[] = {
 	}, {
 		.compatible = "samsung,exynos7870-usbdrd-phy",
 		.data = &exynos7870_usbdrd_phy
+	}, {
+		.compatible = "samsung,exynos7885-usbdrd-phy",
+		.data = &exynos7885_usbdrd_phy
 	}, {
 		.compatible = "samsung,exynos850-usbdrd-phy",
 		.data = &exynos850_usbdrd_phy
diff --git a/include/linux/soc/samsung/exynos-regs-pmu.h b/include/linux/soc/samsung/exynos-regs-pmu.h
index db8a7ca81080..73d9c509dae6 100644
--- a/include/linux/soc/samsung/exynos-regs-pmu.h
+++ b/include/linux/soc/samsung/exynos-regs-pmu.h
@@ -665,6 +665,9 @@
 /* For Exynos990 */
 #define EXYNOS990_PHY_CTRL_USB20				(0x72C)
 
+/* For Exynos7885 */
+#define EXYNOS7885_PHY_CTRL_USB20				(0x674)
+
 /* For Exynos7870 */
 #define EXYNOS7870_MIPI_PHY_CONTROL0				(0x070c)
 #define EXYNOS7870_MIPI_PHY_CONTROL1				(0x0714)

-- 
2.56.1



^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 4/6] arm64: dts: exynos: Enable USB in Exynos7885
  2026-11-19 19:49 [PATCH 0/6] Add USB support for Exynos7885 and enable USB and FG on gta3xllte Umer Uddin via B4 Relay
                   ` (2 preceding siblings ...)
  2026-11-19 19:49 ` [PATCH 3/6] phy: exynos5-usbdrd: support Exynos7885 USB PHY Umer Uddin via B4 Relay
@ 2026-11-19 19:49 ` Umer Uddin via B4 Relay
  2026-11-19 19:53   ` sashiko-bot
  2026-11-19 19:49 ` [PATCH 5/6] arm64: dts: exynos: exynos7885-gta3xllte: Enable USB support Umer Uddin via B4 Relay
  2026-11-19 19:49 ` [PATCH 6/6] arm64: dts: exynos: exynos7885-gta3xllte: Enable FuelGauge support Umer Uddin via B4 Relay
  5 siblings, 1 reply; 13+ messages in thread
From: Umer Uddin via B4 Relay @ 2026-11-19 19:49 UTC (permalink / raw)
  To: Vinod Koul, Neil Armstrong, Manivannan Sadhasivam, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Marek Szyprowski,
	Sylwester Nawrocki, Greg Kroah-Hartman, Peter Griffin,
	Alim Akhtar
  Cc: Krzysztof Kozlowski, linux-phy, devicetree, linux-kernel,
	linux-usb, linux-arm-kernel, linux-samsung-soc, Umer Uddin,
	David Virag

From: David Virag <virag.david003@gmail.com>

Add USB controller and USB PHY controller nodes to Exynos7885 SoC DTSI.

The SoC theoretically supports USB3 SuperSpeed, but is not implemented
in any known device. The vendor kernel also stubs out USB3 functions, so
we do not support it.

It is though, perfectly capable of USB 2.0 high-speed mode, both as host
and device.

Signed-off-by: David Virag <virag.david003@gmail.com>
[Umer Uddin: Rebased onto krzk for-next branch]
Signed-off-by: Umer Uddin <umer.uddin@mentallysanemainliners.org>
---
 arch/arm64/boot/dts/exynos/exynos7885.dtsi | 43 ++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)

diff --git a/arch/arm64/boot/dts/exynos/exynos7885.dtsi b/arch/arm64/boot/dts/exynos/exynos7885.dtsi
index 6b994b487107..142542245cb1 100644
--- a/arch/arm64/boot/dts/exynos/exynos7885.dtsi
+++ b/arch/arm64/boot/dts/exynos/exynos7885.dtsi
@@ -480,6 +480,49 @@ i2c_7: i2c@11cd0000 {
 
 			status = "disabled";
 		};
+
+		usbdrd: usb@13600000 {
+			compatible = "samsung,exynos7885-dwusb3",
+				     "samsung,exynos850-dwusb3";
+			ranges = <0x0 0x13600000 0x10000>;
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			clocks = <&cmu_fsys CLK_FSYS_USB30DRD_BUS_CLK_EARLY>,
+				 <&cmu_fsys CLK_FSYS_USB30DRD_REF_CLK>;
+			clock-names = "bus_early", "ref";
+
+			status = "disabled";
+
+			usbdrd_dwc3: usb@0 {
+				compatible = "snps,dwc3";
+				reg = <0x0 0x10000>;
+				interrupts = <GIC_SPI 135 IRQ_TYPE_LEVEL_HIGH>;
+
+				phys = <&usbdrd_phy 0>;
+				phy-names = "usb2-phy";
+
+				/*
+				 * SoC in theory supports SS but no device has it.
+				 * Actual capabilities unknown.
+				 */
+				maximum-speed = "high-speed";
+			};
+		};
+
+		usbdrd_phy: phy@135d0000 {
+			compatible = "samsung,exynos7885-usbdrd-phy";
+			reg = <0x135d0000 0x100>;
+			#phy-cells = <1>;
+
+			clocks = <&cmu_fsys CLK_FSYS_USB30DRD_ACLK_20PHYCTRL>,
+				 <&cmu_fsys CLK_FSYS_USB20PHY_CLKCORE>;
+			clock-names = "phy", "ref";
+
+			samsung,pmu-syscon = <&pmu_system_controller>;
+
+			status = "disabled";
+		};
 	};
 };
 

-- 
2.56.1



^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 5/6] arm64: dts: exynos: exynos7885-gta3xllte: Enable USB support
  2026-11-19 19:49 [PATCH 0/6] Add USB support for Exynos7885 and enable USB and FG on gta3xllte Umer Uddin via B4 Relay
                   ` (3 preceding siblings ...)
  2026-11-19 19:49 ` [PATCH 4/6] arm64: dts: exynos: Enable USB in Exynos7885 Umer Uddin via B4 Relay
@ 2026-11-19 19:49 ` Umer Uddin via B4 Relay
  2026-11-19 19:53   ` sashiko-bot
  2026-11-19 19:49 ` [PATCH 6/6] arm64: dts: exynos: exynos7885-gta3xllte: Enable FuelGauge support Umer Uddin via B4 Relay
  5 siblings, 1 reply; 13+ messages in thread
From: Umer Uddin via B4 Relay @ 2026-11-19 19:49 UTC (permalink / raw)
  To: Vinod Koul, Neil Armstrong, Manivannan Sadhasivam, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Marek Szyprowski,
	Sylwester Nawrocki, Greg Kroah-Hartman, Peter Griffin,
	Alim Akhtar
  Cc: Krzysztof Kozlowski, linux-phy, devicetree, linux-kernel,
	linux-usb, linux-arm-kernel, linux-samsung-soc, Umer Uddin

From: Umer Uddin <umer.uddin@mentallysanemainliners.org>

The Samsung Galaxy Tab A 10.1 (2019) has a USB-C port capable of USB 2.0
speeds, used both as host and device, and is used for charging the
tablet.

The port is controlled by an S2MU005 IC. Until support for it is
added, only USB device functionality is available, so enable the USB
controller and PHY in peripheral mode.

Signed-off-by: Umer Uddin <umer.uddin@mentallysanemainliners.org>
---
 .../arm64/boot/dts/exynos/exynos7885-gta3xllte.dts | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/arch/arm64/boot/dts/exynos/exynos7885-gta3xllte.dts b/arch/arm64/boot/dts/exynos/exynos7885-gta3xllte.dts
index 03476f8b1200..57df878cb563 100644
--- a/arch/arm64/boot/dts/exynos/exynos7885-gta3xllte.dts
+++ b/arch/arm64/boot/dts/exynos/exynos7885-gta3xllte.dts
@@ -68,6 +68,12 @@ memory@80000000 {
 		      <0x0 0xc0000000 0x40000000>;
 	};
 
+	/* TODO: Remove this once PMIC is implemented */
+	reg_dummy: regulator-0 {
+		compatible = "regulator-fixed";
+		regulator-name = "dummy_reg";
+	};
+
 	reserved-memory {
 		ranges;
 		#address-cells = <2>;
@@ -127,3 +133,19 @@ key_volup: key-volup-pins {
 		samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
 	};
 };
+
+&usbdrd {
+	vdd10-supply = <&reg_dummy>;
+	vdd33-supply = <&reg_dummy>;
+
+	status = "okay";
+};
+
+&usbdrd_dwc3 {
+	/* Force to peripheral until we have Type-C working */
+	dr_mode = "peripheral";
+};
+
+&usbdrd_phy {
+	status = "okay";
+};

-- 
2.56.1



^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 6/6] arm64: dts: exynos: exynos7885-gta3xllte: Enable FuelGauge support
  2026-11-19 19:49 [PATCH 0/6] Add USB support for Exynos7885 and enable USB and FG on gta3xllte Umer Uddin via B4 Relay
                   ` (4 preceding siblings ...)
  2026-11-19 19:49 ` [PATCH 5/6] arm64: dts: exynos: exynos7885-gta3xllte: Enable USB support Umer Uddin via B4 Relay
@ 2026-11-19 19:49 ` Umer Uddin via B4 Relay
  2026-11-19 19:56   ` sashiko-bot
  5 siblings, 1 reply; 13+ messages in thread
From: Umer Uddin via B4 Relay @ 2026-11-19 19:49 UTC (permalink / raw)
  To: Vinod Koul, Neil Armstrong, Manivannan Sadhasivam, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Marek Szyprowski,
	Sylwester Nawrocki, Greg Kroah-Hartman, Peter Griffin,
	Alim Akhtar
  Cc: Krzysztof Kozlowski, linux-phy, devicetree, linux-kernel,
	linux-usb, linux-arm-kernel, linux-samsung-soc, Umer Uddin

From: Umer Uddin <umer.uddin@mentallysanemainliners.org>

The Samsung Galaxy Tab A 10.1 (2019) has a S2MU005 Multi Function Device
(MFD). It contains PMIC, FG and EXTCON. This commit enables the FG, to be
used with a simple battery device to allow for battery percentages to be
reported.

Signed-off-by: Umer Uddin <umer.uddin@mentallysanemainliners.org>
---
 .../arm64/boot/dts/exynos/exynos7885-gta3xllte.dts | 28 ++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/arch/arm64/boot/dts/exynos/exynos7885-gta3xllte.dts b/arch/arm64/boot/dts/exynos/exynos7885-gta3xllte.dts
index 57df878cb563..1c0af6f89396 100644
--- a/arch/arm64/boot/dts/exynos/exynos7885-gta3xllte.dts
+++ b/arch/arm64/boot/dts/exynos/exynos7885-gta3xllte.dts
@@ -22,6 +22,13 @@ aliases {
 		serial2 = &serial_2;
 	};
 
+	battery: battery {
+		compatible = "simple-battery";
+		charge-full-design-microamp-hours = <6000000>;
+		voltage-min-design-microvolt = <3300000>;
+		voltage-max-design-microvolt = <4350000>;
+	};
+
 	chosen {
 		ranges;
 		#address-cells = <2>;
@@ -86,6 +93,20 @@ cont_splash_mem: framebuffer@ec000000 {
 	};
 };
 
+&i2c_0 {
+	status = "okay";
+
+	fuel-gauge@3b {
+		compatible = "samsung,s2mu005-fuel-gauge";
+		reg = <0x3b>;
+		interrupt-parent = <&gpa2>;
+		interrupts = <4 IRQ_TYPE_EDGE_BOTH>;
+		pinctrl-0 = <&fuel_irq>;
+		pinctrl-names = "default";
+		monitored-battery = <&battery>;
+	};
+};
+
 &mmc_0 {
 	bus-width = <8>;
 	cap-mmc-highspeed;
@@ -112,6 +133,13 @@ &oscclk {
 };
 
 &pinctrl_alive {
+	fuel_irq: fuel-irq-pins {
+		samsung,pins = "gpa2-4";
+		samsung,pin-function = <EXYNOS_PIN_FUNC_EINT>;
+		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+		samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
+	};
+
 	key_power: key-power-pins {
 		samsung,pins = "gpa1-7";
 		samsung,pin-function = <EXYNOS_PIN_FUNC_F>;

-- 
2.56.1



^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH 2/6] dt-bindings: usb: samsung,exynos-dwc3: Add Exynos7885 support
  2026-11-19 19:49 ` [PATCH 2/6] dt-bindings: usb: samsung,exynos-dwc3: " Umer Uddin via B4 Relay
@ 2026-11-19 19:52   ` sashiko-bot
  0 siblings, 0 replies; 13+ messages in thread
From: sashiko-bot @ 2026-11-19 19:52 UTC (permalink / raw)
  To: Umer Uddin; +Cc: linux-usb

> From: David Virag <virag.david003@gmail.com>
> 
> Exynos7885 SoC has a DWC3 compatible USB controller, so it can reuse the
> existing Exynos glue layer. Clocks are the same as on Exynos850.
> 
> Signed-off-by: David Virag <virag.david003@gmail.com>
> [Umer Uddin: use samsung,exynos850-dwusb3 as fallback compatible instead
> of adding a separate match entry to the dwc3-exynos driver]
> Signed-off-by: Umer Uddin <umer.uddin@mentallysanemainliners.org>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261119-gta3xllte-usb-battery-v1-0-0cf5f763522e@mentallysanemainliners.org?part=2


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 1/6] dt-bindings: phy: samsung,usb3-drd-phy: Add Exynos7885 support
  2026-11-19 19:49 ` [PATCH 1/6] dt-bindings: phy: samsung,usb3-drd-phy: Add Exynos7885 support Umer Uddin via B4 Relay
@ 2026-11-19 19:52   ` sashiko-bot
  0 siblings, 0 replies; 13+ messages in thread
From: sashiko-bot @ 2026-11-19 19:52 UTC (permalink / raw)
  To: Umer Uddin; +Cc: linux-usb

> From: David Virag <virag.david003@gmail.com>
> 
> Document Exynos7885 compatible.
> Exynos7885 USB PHY has two clocks (ref and phy) like Exynos850, which
> are already described in bindings.
> 
> Signed-off-by: David Virag <virag.david003@gmail.com>
> Signed-off-by: Umer Uddin <umer.uddin@mentallysanemainliners.org>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261119-gta3xllte-usb-battery-v1-0-0cf5f763522e@mentallysanemainliners.org?part=1


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 5/6] arm64: dts: exynos: exynos7885-gta3xllte: Enable USB support
  2026-11-19 19:49 ` [PATCH 5/6] arm64: dts: exynos: exynos7885-gta3xllte: Enable USB support Umer Uddin via B4 Relay
@ 2026-11-19 19:53   ` sashiko-bot
  0 siblings, 0 replies; 13+ messages in thread
From: sashiko-bot @ 2026-11-19 19:53 UTC (permalink / raw)
  To: Umer Uddin; +Cc: linux-usb

> From: Umer Uddin <umer.uddin@mentallysanemainliners.org>
> 
> The Samsung Galaxy Tab A 10.1 (2019) has a USB-C port capable of USB 2.0
> speeds, used both as host and device, and is used for charging the
> tablet.
> 
> The port is controlled by an S2MU005 IC. Until support for it is
> added, only USB device functionality is available, so enable the USB
> controller and PHY in peripheral mode.
> 
> Signed-off-by: Umer Uddin <umer.uddin@mentallysanemainliners.org>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261119-gta3xllte-usb-battery-v1-0-0cf5f763522e@mentallysanemainliners.org?part=5


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 4/6] arm64: dts: exynos: Enable USB in Exynos7885
  2026-11-19 19:49 ` [PATCH 4/6] arm64: dts: exynos: Enable USB in Exynos7885 Umer Uddin via B4 Relay
@ 2026-11-19 19:53   ` sashiko-bot
  0 siblings, 0 replies; 13+ messages in thread
From: sashiko-bot @ 2026-11-19 19:53 UTC (permalink / raw)
  To: Umer Uddin; +Cc: linux-usb

> From: David Virag <virag.david003@gmail.com>
> 
> Add USB controller and USB PHY controller nodes to Exynos7885 SoC DTSI.
> 
> The SoC theoretically supports USB3 SuperSpeed, but is not implemented
> in any known device. The vendor kernel also stubs out USB3 functions, so
> we do not support it.
> 
> It is though, perfectly capable of USB 2.0 high-speed mode, both as host
> and device.
> 
> Signed-off-by: David Virag <virag.david003@gmail.com>
> [Umer Uddin: Rebased onto krzk for-next branch]
> Signed-off-by: Umer Uddin <umer.uddin@mentallysanemainliners.org>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261119-gta3xllte-usb-battery-v1-0-0cf5f763522e@mentallysanemainliners.org?part=4


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 3/6] phy: exynos5-usbdrd: support Exynos7885 USB PHY
  2026-11-19 19:49 ` [PATCH 3/6] phy: exynos5-usbdrd: support Exynos7885 USB PHY Umer Uddin via B4 Relay
@ 2026-11-19 19:55   ` sashiko-bot
  0 siblings, 0 replies; 13+ messages in thread
From: sashiko-bot @ 2026-11-19 19:55 UTC (permalink / raw)
  To: Umer Uddin; +Cc: linux-usb

> From: David Virag <virag.david003@gmail.com>
> 
> The Exynos7885 SoC has an Exynos USB PHY that theoretically supports
> USB3 SuperSpeed, but all known devices using it only have USB2 and the
> vendor driver has USB3 function stubbed out, so we'll only support USB2.
> 
> Apart from this mysterious USB3 capability, it's the closest to Exynos850
> out of those supported. Unlike other SoCs though, this one doesn't set
> the reference clock by default, so we have to set it manually.
> 
> For this, create a set_ref_clk_rate property in drvdata that can be set
> to a predefined value to set the clockrate to.
> 
> Signed-off-by: David Virag <virag.david003@gmail.com>
> [Umer Uddin: Rebased onto krzk for-next branch]
> Signed-off-by: Umer Uddin <umer.uddin@mentallysanemainliners.org>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261119-gta3xllte-usb-battery-v1-0-0cf5f763522e@mentallysanemainliners.org?part=3


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 6/6] arm64: dts: exynos: exynos7885-gta3xllte: Enable FuelGauge support
  2026-11-19 19:49 ` [PATCH 6/6] arm64: dts: exynos: exynos7885-gta3xllte: Enable FuelGauge support Umer Uddin via B4 Relay
@ 2026-11-19 19:56   ` sashiko-bot
  0 siblings, 0 replies; 13+ messages in thread
From: sashiko-bot @ 2026-11-19 19:56 UTC (permalink / raw)
  To: Umer Uddin; +Cc: linux-usb

> From: Umer Uddin <umer.uddin@mentallysanemainliners.org>
> 
> The Samsung Galaxy Tab A 10.1 (2019) has a S2MU005 Multi Function Device
> (MFD). It contains PMIC, FG and EXTCON. This commit enables the FG, to be
> used with a simple battery device to allow for battery percentages to be
> reported.
> 
> Signed-off-by: Umer Uddin <umer.uddin@mentallysanemainliners.org>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261119-gta3xllte-usb-battery-v1-0-0cf5f763522e@mentallysanemainliners.org?part=6


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2026-11-19 19:56 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-19 19:49 [PATCH 0/6] Add USB support for Exynos7885 and enable USB and FG on gta3xllte Umer Uddin via B4 Relay
2026-11-19 19:49 ` [PATCH 1/6] dt-bindings: phy: samsung,usb3-drd-phy: Add Exynos7885 support Umer Uddin via B4 Relay
2026-11-19 19:52   ` sashiko-bot
2026-11-19 19:49 ` [PATCH 2/6] dt-bindings: usb: samsung,exynos-dwc3: " Umer Uddin via B4 Relay
2026-11-19 19:52   ` sashiko-bot
2026-11-19 19:49 ` [PATCH 3/6] phy: exynos5-usbdrd: support Exynos7885 USB PHY Umer Uddin via B4 Relay
2026-11-19 19:55   ` sashiko-bot
2026-11-19 19:49 ` [PATCH 4/6] arm64: dts: exynos: Enable USB in Exynos7885 Umer Uddin via B4 Relay
2026-11-19 19:53   ` sashiko-bot
2026-11-19 19:49 ` [PATCH 5/6] arm64: dts: exynos: exynos7885-gta3xllte: Enable USB support Umer Uddin via B4 Relay
2026-11-19 19:53   ` sashiko-bot
2026-11-19 19:49 ` [PATCH 6/6] arm64: dts: exynos: exynos7885-gta3xllte: Enable FuelGauge support Umer Uddin via B4 Relay
2026-11-19 19:56   ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox