public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/4] Add HUSB311 Type-C controller
@ 2026-03-18 14:32 Alexey Charkov
  2026-03-18 14:32 ` [PATCH v4 1/4] dt-bindings: vendor-prefixes: Add Hynetek Semiconductor Co., Ltd Alexey Charkov
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Alexey Charkov @ 2026-03-18 14:32 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Heikki Krogerus,
	Greg Kroah-Hartman, Gene Chen, Yuanshen Cao
  Cc: Sebastian Reichel, devicetree, linux-kernel, linux-usb,
	Krzysztof Kozlowski, Alexey Charkov, Conor Dooley

HUSB311 is a drop-in replacement for RT1711H, used in Rockchip RK3576 EVB1
board and some other boards closely following the reference schematic.

The existing RT1711H driver seems to work fine with HUSB311, and publicly
available documentation does not provide enough information for HUSB311 
to identify any meaningful differences, so this series wires up the
existing driver to treat HUSB311 in the same way it treats RT1711H, by the
way of introducing fallback compatibles in the binding and removing
unnecessary VID/PID/DID checks from the driver.

Note that patches 2 and 4 are on top of commits by Yanshen Cao which are
currently in next but not in master. Maybe they can be squashed in full
or in part to reduce churn, if we agree on using fallback compatibles.
From what I can tell, ET7304 can also be used with a fallback compatible
alone and without driver changes once VID/PID/DID checks are removed (I
don't see it used in any DTS in either mainline or next yet, though)

Signed-off-by: Alexey Charkov <alchark@flipper.net>

---
Changes in v4:
- Picked up the review tag from Heikki Krogerus (thanks!)
- Kept the format of "enum" for the single-value compatibles instead of converting
  them to "const" entries directly under "oneOf" (thanks Krzysztof)
- Clarify the commit message stating that ET7304 is identical to RT1715 except for
  its VID value (thanks Krzysztof)
- Adjusted the style of the "Link:" tag with [1] in it (thanks Krzysztof)
- Link to v3: https://lore.kernel.org/r/20260318-husb311-v3-0-2b32e6192b9c@flipper.net

Changes in v3:
- Dropped the DTS change from this USB-centric patch series (thanks Krzysztof)
- Dropped commit references for patches not yet in mainline to avoid confusion, as
  they will change upon merging
- Link to v2: https://lore.kernel.org/r/20260317-husb311-v2-0-03c17c986abe@flipper.net

Changes in v2:
- Changed the binding to use fallback compatibles (thanks Conor for the suggestion)
- Rebased on top of recent next, thus also adjusted the binding for ET7304 to fall
  back to RT1715. There are no in-tree DT users yet
- Removed the VID/PID/DID checks altogether instead of endlessly multiplying the
  list of matches for new clones (thanks Conor for the suggestion)
- Link to v1: https://lore.kernel.org/r/20260311-husb311-v1-0-f25bcb58cff7@flipper.net

---
Alexey Charkov (4):
      dt-bindings: vendor-prefixes: Add Hynetek Semiconductor Co., Ltd.
      dt-bindings: usb: richtek,rt1711h: Switch ETEK ET7304 to use a fallback compatible
      dt-bindings: usb: richtek,rt1711h: Add Hynetek HUSB311
      usb: typec: tcpci_rt1711h: Drop unnecessary VID/PID/DID checks

 .../devicetree/bindings/usb/richtek,rt1711h.yaml   | 17 +++++--
 .../devicetree/bindings/vendor-prefixes.yaml       |  2 +
 drivers/usb/typec/tcpm/tcpci_rt1711h.c             | 59 +---------------------
 3 files changed, 17 insertions(+), 61 deletions(-)
---
base-commit: 8e5a478b6d6a5bb0a3d52147862b15e4d826af19
change-id: 20260115-husb311-291bbb1a7776

Best regards,
-- 
Alexey Charkov <alchark@flipper.net>


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

* [PATCH v4 1/4] dt-bindings: vendor-prefixes: Add Hynetek Semiconductor Co., Ltd.
  2026-03-18 14:32 [PATCH v4 0/4] Add HUSB311 Type-C controller Alexey Charkov
@ 2026-03-18 14:32 ` Alexey Charkov
  2026-03-18 14:32 ` [PATCH v4 2/4] dt-bindings: usb: richtek,rt1711h: Switch ETEK ET7304 to use a fallback compatible Alexey Charkov
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Alexey Charkov @ 2026-03-18 14:32 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Heikki Krogerus,
	Greg Kroah-Hartman, Gene Chen, Yuanshen Cao
  Cc: Sebastian Reichel, devicetree, linux-kernel, linux-usb,
	Krzysztof Kozlowski, Alexey Charkov, Conor Dooley

Hynetek Semiconductor Co., Ltd. focuses on intelligent energy control
technology, mainly for the intelligent fast charging and digital energy
fields.

Link: https://en.hynetek.com/
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Alexey Charkov <alchark@flipper.net>
---
 Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml
index 5a806faf7170..3ffb1a8e24af 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.yaml
+++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml
@@ -747,6 +747,8 @@ patternProperties:
     description: Hycon Technology Corp.
   "^hydis,.*":
     description: Hydis Technologies
+  "^hynetek,.*":
+    description: Hynetek Semiconductor Co., Ltd.
   "^hynitron,.*":
     description: Shanghai Hynitron Microelectronics Co. Ltd.
   "^hynix,.*":

-- 
2.52.0


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

* [PATCH v4 2/4] dt-bindings: usb: richtek,rt1711h: Switch ETEK ET7304 to use a fallback compatible
  2026-03-18 14:32 [PATCH v4 0/4] Add HUSB311 Type-C controller Alexey Charkov
  2026-03-18 14:32 ` [PATCH v4 1/4] dt-bindings: vendor-prefixes: Add Hynetek Semiconductor Co., Ltd Alexey Charkov
@ 2026-03-18 14:32 ` Alexey Charkov
  2026-03-19  8:53   ` Krzysztof Kozlowski
  2026-03-18 14:32 ` [PATCH v4 3/4] dt-bindings: usb: richtek,rt1711h: Add Hynetek HUSB311 Alexey Charkov
  2026-03-18 14:32 ` [PATCH v4 4/4] usb: typec: tcpci_rt1711h: Drop unnecessary VID/PID/DID checks Alexey Charkov
  3 siblings, 1 reply; 7+ messages in thread
From: Alexey Charkov @ 2026-03-18 14:32 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Heikki Krogerus,
	Greg Kroah-Hartman, Gene Chen, Yuanshen Cao
  Cc: Sebastian Reichel, devicetree, linux-kernel, linux-usb,
	Krzysztof Kozlowski, Alexey Charkov

As stated in [1], ETEK ET7304 is identical to Richtek RT1715, except for
the VID value in its registers, so reflect it in the bindings via a
fallback compatible.

As there are various TCPCI chips by different vendors reimplementing the
registers and behavior of the RT1711H/RT1715, fallback compatibles will
scale better.

Link: https://lore.kernel.org/all/20260220-et7304-v3-2-ede2d9634957@gmail.com/ [1]
Signed-off-by: Alexey Charkov <alchark@flipper.net>
---
 Documentation/devicetree/bindings/usb/richtek,rt1711h.yaml | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/Documentation/devicetree/bindings/usb/richtek,rt1711h.yaml b/Documentation/devicetree/bindings/usb/richtek,rt1711h.yaml
index 1eb611f35998..210090308e7c 100644
--- a/Documentation/devicetree/bindings/usb/richtek,rt1711h.yaml
+++ b/Documentation/devicetree/bindings/usb/richtek,rt1711h.yaml
@@ -18,10 +18,14 @@ description: |
 
 properties:
   compatible:
-    enum:
-      - etekmicro,et7304
-      - richtek,rt1711h
-      - richtek,rt1715
+    oneOf:
+      - enum:
+          - richtek,rt1711h
+          - richtek,rt1715
+      - items:
+          - enum:
+              - etekmicro,et7304
+          - const: richtek,rt1715
     description:
       RT1711H support PD20, ET7304 and RT1715 support PD30 except Fast Role Swap.
 

-- 
2.52.0


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

* [PATCH v4 3/4] dt-bindings: usb: richtek,rt1711h: Add Hynetek HUSB311
  2026-03-18 14:32 [PATCH v4 0/4] Add HUSB311 Type-C controller Alexey Charkov
  2026-03-18 14:32 ` [PATCH v4 1/4] dt-bindings: vendor-prefixes: Add Hynetek Semiconductor Co., Ltd Alexey Charkov
  2026-03-18 14:32 ` [PATCH v4 2/4] dt-bindings: usb: richtek,rt1711h: Switch ETEK ET7304 to use a fallback compatible Alexey Charkov
@ 2026-03-18 14:32 ` Alexey Charkov
  2026-03-19  8:54   ` Krzysztof Kozlowski
  2026-03-18 14:32 ` [PATCH v4 4/4] usb: typec: tcpci_rt1711h: Drop unnecessary VID/PID/DID checks Alexey Charkov
  3 siblings, 1 reply; 7+ messages in thread
From: Alexey Charkov @ 2026-03-18 14:32 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Heikki Krogerus,
	Greg Kroah-Hartman, Gene Chen, Yuanshen Cao
  Cc: Sebastian Reichel, devicetree, linux-kernel, linux-usb,
	Krzysztof Kozlowski, Alexey Charkov

HUSB311 is a pin-compatible and register-compatible drop-in replacement
for RT1711H, so add its compatible string to the existing binding.

Link: https://www.hynetek.com/uploadfiles/site/219/news/0863c0c7-f535-4f09-bacd-0440d2c21088.pdf
Link: https://dl.xkwy2018.com/downloads/RK3588S/03_Product%20Line%20Branch_Tablet/02_Key%20Device%20Specifications/HUSB311%20introduction%2020210526.pdf
Link: https://www.richtek.com/assets/product_file/RT1711H/DS1711H-04.pdf
Signed-off-by: Alexey Charkov <alchark@flipper.net>
---
 Documentation/devicetree/bindings/usb/richtek,rt1711h.yaml | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/Documentation/devicetree/bindings/usb/richtek,rt1711h.yaml b/Documentation/devicetree/bindings/usb/richtek,rt1711h.yaml
index 210090308e7c..7ded36384518 100644
--- a/Documentation/devicetree/bindings/usb/richtek,rt1711h.yaml
+++ b/Documentation/devicetree/bindings/usb/richtek,rt1711h.yaml
@@ -22,12 +22,17 @@ properties:
       - enum:
           - richtek,rt1711h
           - richtek,rt1715
+      - items:
+          - enum:
+              - hynetek,husb311
+          - const: richtek,rt1711h
       - items:
           - enum:
               - etekmicro,et7304
           - const: richtek,rt1715
     description:
       RT1711H support PD20, ET7304 and RT1715 support PD30 except Fast Role Swap.
+      HUSB311 is a rebrand of RT1711H which is pin and register compatible.
 
   reg:
     maxItems: 1

-- 
2.52.0


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

* [PATCH v4 4/4] usb: typec: tcpci_rt1711h: Drop unnecessary VID/PID/DID checks
  2026-03-18 14:32 [PATCH v4 0/4] Add HUSB311 Type-C controller Alexey Charkov
                   ` (2 preceding siblings ...)
  2026-03-18 14:32 ` [PATCH v4 3/4] dt-bindings: usb: richtek,rt1711h: Add Hynetek HUSB311 Alexey Charkov
@ 2026-03-18 14:32 ` Alexey Charkov
  3 siblings, 0 replies; 7+ messages in thread
From: Alexey Charkov @ 2026-03-18 14:32 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Heikki Krogerus,
	Greg Kroah-Hartman, Gene Chen, Yuanshen Cao
  Cc: Sebastian Reichel, devicetree, linux-kernel, linux-usb,
	Krzysztof Kozlowski, Alexey Charkov

Existing checks for VID/PID/DID in the driver are redundant since the
driver is already matched to the device via I2C device ID and OF
compatible strings, and they preclude the use of fallback compatibles.

Remove them to make the driver slimmer and adding new clones easier.

Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Alexey Charkov <alchark@flipper.net>
---
 drivers/usb/typec/tcpm/tcpci_rt1711h.c | 59 ++--------------------------------
 1 file changed, 2 insertions(+), 57 deletions(-)

diff --git a/drivers/usb/typec/tcpm/tcpci_rt1711h.c b/drivers/usb/typec/tcpm/tcpci_rt1711h.c
index 37cf55ad74f8..4b3e4e22a82e 100644
--- a/drivers/usb/typec/tcpm/tcpci_rt1711h.c
+++ b/drivers/usb/typec/tcpm/tcpci_rt1711h.c
@@ -18,13 +18,6 @@
 #include <linux/regmap.h>
 #include <linux/regulator/consumer.h>
 
-#define RT1711H_VID		0x29CF
-#define ET7304_VID		0x6DCF
-#define RT1711H_PID		0x1711
-#define RT1711H_DID		0x2171
-#define RT1715_DID		0x2173
-#define ET7304_DID		0x2173
-
 #define RT1711H_PHYCTRL1	0x80
 #define RT1711H_PHYCTRL2	0x81
 
@@ -57,8 +50,6 @@
 
 struct rt1711h_chip_info {
 	u32 rxdz_sel;
-	u16 vid;
-	u16 did;
 	bool enable_pd30_extended_message;
 };
 
@@ -304,35 +295,6 @@ static int rt1711h_sw_reset(struct rt1711h_chip *chip)
 	return 0;
 }
 
-static int rt1711h_check_revision(struct i2c_client *i2c, struct rt1711h_chip *chip)
-{
-	int ret;
-
-	ret = i2c_smbus_read_word_data(i2c, TCPC_VENDOR_ID);
-	if (ret < 0)
-		return ret;
-	if (ret != chip->info->vid) {
-		dev_err(&i2c->dev, "vid is not correct, 0x%04x\n", ret);
-		return -ENODEV;
-	}
-	ret = i2c_smbus_read_word_data(i2c, TCPC_PRODUCT_ID);
-	if (ret < 0)
-		return ret;
-	if (ret != RT1711H_PID) {
-		dev_err(&i2c->dev, "pid is not correct, 0x%04x\n", ret);
-		return -ENODEV;
-	}
-	ret = i2c_smbus_read_word_data(i2c, TCPC_BCD_DEV);
-	if (ret < 0)
-		return ret;
-	if (ret != chip->info->did) {
-		dev_err(&i2c->dev, "did is not correct, 0x%04x\n", ret);
-		return -ENODEV;
-	}
-	dev_dbg(&i2c->dev, "did is 0x%04x\n", ret);
-	return ret;
-}
-
 static int rt1711h_probe(struct i2c_client *client)
 {
 	int ret;
@@ -349,12 +311,6 @@ static int rt1711h_probe(struct i2c_client *client)
 
 	chip->info = i2c_get_match_data(client);
 
-	ret = rt1711h_check_revision(client, chip);
-	if (ret < 0) {
-		dev_err(&client->dev, "check vid/pid fail\n");
-		return ret;
-	}
-
 	chip->data.regmap = devm_regmap_init_i2c(client,
 						 &rt1711h_regmap_config);
 	if (IS_ERR(chip->data.regmap))
@@ -408,27 +364,16 @@ static void rt1711h_remove(struct i2c_client *client)
 	tcpci_unregister_port(chip->tcpci);
 }
 
-static const struct rt1711h_chip_info et7304 = {
-	.rxdz_sel = RT1711H_BMCIO_RXDZSEL,
-	.vid = ET7304_VID,
-	.did = ET7304_DID,
-	.enable_pd30_extended_message = true,
-};
-
 static const struct rt1711h_chip_info rt1711h = {
-	.vid = RT1711H_VID,
-	.did = RT1711H_DID,
 };
 
 static const struct rt1711h_chip_info rt1715 = {
 	.rxdz_sel = RT1711H_BMCIO_RXDZSEL,
-	.vid = RT1711H_VID,
-	.did = RT1715_DID,
 	.enable_pd30_extended_message = true,
 };
 
 static const struct i2c_device_id rt1711h_id[] = {
-	{ "et7304", (kernel_ulong_t)&et7304 },
+	{ "et7304", (kernel_ulong_t)&rt1715 },
 	{ "rt1711h", (kernel_ulong_t)&rt1711h },
 	{ "rt1715", (kernel_ulong_t)&rt1715 },
 	{}
@@ -436,7 +381,7 @@ static const struct i2c_device_id rt1711h_id[] = {
 MODULE_DEVICE_TABLE(i2c, rt1711h_id);
 
 static const struct of_device_id rt1711h_of_match[] = {
-	{ .compatible = "etekmicro,et7304", .data = &et7304 },
+	{ .compatible = "etekmicro,et7304", .data = &rt1715 },
 	{ .compatible = "richtek,rt1711h", .data = &rt1711h },
 	{ .compatible = "richtek,rt1715", .data = &rt1715 },
 	{}

-- 
2.52.0


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

* Re: [PATCH v4 2/4] dt-bindings: usb: richtek,rt1711h: Switch ETEK ET7304 to use a fallback compatible
  2026-03-18 14:32 ` [PATCH v4 2/4] dt-bindings: usb: richtek,rt1711h: Switch ETEK ET7304 to use a fallback compatible Alexey Charkov
@ 2026-03-19  8:53   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 7+ messages in thread
From: Krzysztof Kozlowski @ 2026-03-19  8:53 UTC (permalink / raw)
  To: Alexey Charkov
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Heikki Krogerus,
	Greg Kroah-Hartman, Gene Chen, Yuanshen Cao, Sebastian Reichel,
	devicetree, linux-kernel, linux-usb, Krzysztof Kozlowski

On Wed, Mar 18, 2026 at 06:32:54PM +0400, Alexey Charkov wrote:
> As stated in [1], ETEK ET7304 is identical to Richtek RT1715, except for
> the VID value in its registers, so reflect it in the bindings via a
> fallback compatible.
> 
> As there are various TCPCI chips by different vendors reimplementing the
> registers and behavior of the RT1711H/RT1715, fallback compatibles will
> scale better.
> 
> Link: https://lore.kernel.org/all/20260220-et7304-v3-2-ede2d9634957@gmail.com/ [1]
> Signed-off-by: Alexey Charkov <alchark@flipper.net>
> ---
>  Documentation/devicetree/bindings/usb/richtek,rt1711h.yaml | 12 ++++++++----
>  1 file changed, 8 insertions(+), 4 deletions(-)

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>

Best regards,
Krzysztof


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

* Re: [PATCH v4 3/4] dt-bindings: usb: richtek,rt1711h: Add Hynetek HUSB311
  2026-03-18 14:32 ` [PATCH v4 3/4] dt-bindings: usb: richtek,rt1711h: Add Hynetek HUSB311 Alexey Charkov
@ 2026-03-19  8:54   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 7+ messages in thread
From: Krzysztof Kozlowski @ 2026-03-19  8:54 UTC (permalink / raw)
  To: Alexey Charkov
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Heikki Krogerus,
	Greg Kroah-Hartman, Gene Chen, Yuanshen Cao, Sebastian Reichel,
	devicetree, linux-kernel, linux-usb, Krzysztof Kozlowski

On Wed, Mar 18, 2026 at 06:32:55PM +0400, Alexey Charkov wrote:
> HUSB311 is a pin-compatible and register-compatible drop-in replacement
> for RT1711H, so add its compatible string to the existing binding.
> 
> Link: https://www.hynetek.com/uploadfiles/site/219/news/0863c0c7-f535-4f09-bacd-0440d2c21088.pdf
> Link: https://dl.xkwy2018.com/downloads/RK3588S/03_Product%20Line%20Branch_Tablet/02_Key%20Device%20Specifications/HUSB311%20introduction%2020210526.pdf
> Link: https://www.richtek.com/assets/product_file/RT1711H/DS1711H-04.pdf
> Signed-off-by: Alexey Charkov <alchark@flipper.net>
> ---
>  Documentation/devicetree/bindings/usb/richtek,rt1711h.yaml | 5 +++++
>  1 file changed, 5 insertions(+)

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>

Best regards,
Krzysztof


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

end of thread, other threads:[~2026-03-19  8:54 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-18 14:32 [PATCH v4 0/4] Add HUSB311 Type-C controller Alexey Charkov
2026-03-18 14:32 ` [PATCH v4 1/4] dt-bindings: vendor-prefixes: Add Hynetek Semiconductor Co., Ltd Alexey Charkov
2026-03-18 14:32 ` [PATCH v4 2/4] dt-bindings: usb: richtek,rt1711h: Switch ETEK ET7304 to use a fallback compatible Alexey Charkov
2026-03-19  8:53   ` Krzysztof Kozlowski
2026-03-18 14:32 ` [PATCH v4 3/4] dt-bindings: usb: richtek,rt1711h: Add Hynetek HUSB311 Alexey Charkov
2026-03-19  8:54   ` Krzysztof Kozlowski
2026-03-18 14:32 ` [PATCH v4 4/4] usb: typec: tcpci_rt1711h: Drop unnecessary VID/PID/DID checks Alexey Charkov

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