diff mbox series

[4/4] usb: typec: tcpci_rt1711h: Add enable_pd30_extended_message feature bit to struct rt1711h_chip_info

Message ID 20230820184402.102486-5-biju.das.jz@bp.renesas.com
State Superseded
Headers show
Series onvert enum->pointer for data in the rt1711h match tables | expand

Commit Message

Biju Das Aug. 20, 2023, 6:44 p.m. UTC
The RT1715 has PD30 extended message compared to RT1711H. Add a feature bit
enable_pd30_extended_message to struct rt1711h_chip_info to enable this
feature only for RT1715.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
 drivers/usb/typec/tcpm/tcpci_rt1711h.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/usb/typec/tcpm/tcpci_rt1711h.c b/drivers/usb/typec/tcpm/tcpci_rt1711h.c
index 1b1753895ca5..e79cbb344c14 100644
--- a/drivers/usb/typec/tcpm/tcpci_rt1711h.c
+++ b/drivers/usb/typec/tcpm/tcpci_rt1711h.c
@@ -54,6 +54,7 @@ 
 struct rt1711h_chip_info {
 	u16 did;
 	u32 rxdz_sel;
+	unsigned enable_pd30_extended_message:1;
 };
 
 struct rt1711h_chip {
@@ -110,7 +111,7 @@  static int rt1711h_init(struct tcpci *tcpci, struct tcpci_data *tdata)
 		return ret;
 
 	/* Enable PD30 extended message for RT1715 */
-	if (chip->info->did == RT1715_DID) {
+	if (chip->info->enable_pd30_extended_message) {
 		ret = regmap_update_bits(regmap, RT1711H_RTCTRL8,
 					 RT1711H_ENEXTMSG, RT1711H_ENEXTMSG);
 		if (ret < 0)
@@ -401,6 +402,7 @@  static const struct rt1711h_chip_info rt1711h = {
 static const struct rt1711h_chip_info rt1715 = {
 	.did = RT1715_DID,
 	.rxdz_sel = RT1711H_BMCIO_RXDZSEL,
+	.enable_pd30_extended_message = 1,
 };
 
 static const struct i2c_device_id rt1711h_id[] = {