From: Alexey Charkov <alchark@flipper.net>
To: Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Heikki Krogerus <heikki.krogerus@linux.intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Gene Chen <gene_chen@richtek.com>,
Yuanshen Cao <alex.caoys@gmail.com>
Cc: Sebastian Reichel <sebastian.reichel@collabora.com>,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-usb@vger.kernel.org,
Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>,
Alexey Charkov <alchark@flipper.net>
Subject: [PATCH v4 4/4] usb: typec: tcpci_rt1711h: Drop unnecessary VID/PID/DID checks
Date: Wed, 18 Mar 2026 18:32:56 +0400 [thread overview]
Message-ID: <20260318-husb311-v4-4-69e029255430@flipper.net> (raw)
In-Reply-To: <20260318-husb311-v4-0-69e029255430@flipper.net>
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
prev parent reply other threads:[~2026-03-18 14:33 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` Alexey Charkov [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260318-husb311-v4-4-69e029255430@flipper.net \
--to=alchark@flipper.net \
--cc=alex.caoys@gmail.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=gene_chen@richtek.com \
--cc=gregkh@linuxfoundation.org \
--cc=heikki.krogerus@linux.intel.com \
--cc=krzk+dt@kernel.org \
--cc=krzysztof.kozlowski@oss.qualcomm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=robh@kernel.org \
--cc=sebastian.reichel@collabora.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.