Skip to contentSkip to conversation

usb: typec: tipd: Disable mode control for CD321x

PATCH In review Sven Peter 2 participants 2 messages Sep 6 – Sep 7

Subsystems (2)
lore
Share & tools
lore

Sven Peter

author
#0 lore raw

PATCH 1/1 usb: typec: tipd: Disable mode control for CD321x

Apple's CD321X firmware controls which alternate mode is entered and cannot be influenced from Linux. Set the no_mode_control capability to accurately reflect this to the typec subsystem.

---
 drivers/usb/typec/tipd/core.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/usb/typec/tipd/core.c +3 -0
index 522f56742aa9..8fdb37e288b4 100644
@@ -151,6 +151,7 @@ struct tipd_data {
 	irq_handler_t irq_handler;
 	u64 irq_mask1;
 	size_t tps_struct_size;
+	bool no_mode_control;
 	void (*remove)(struct tps6598x *tps);
 	int (*register_port)(struct tps6598x *tps, struct fwnode_handle *node);
 	void (*unregister_port)(struct tps6598x *tps);
@@ -1242,6 +1243,7 @@ tps6598x_register_port(struct tps6598x *tps, struct fwnode_handle *fwnode)
 	typec_cap.driver_data = tps;
 	typec_cap.ops = &tps6598x_ops;
 	typec_cap.fwnode = fwnode;
+	typec_cap.no_mode_control = tps->data->no_mode_control;
 
 	switch (TPS_SYSCONF_PORTINFO(conf)) {
 	case TPS_PORTINFO_SINK_ACCESSORY:
@@ -2015,6 +2017,7 @@ static const struct tipd_data cd321x_data = {
 		     APPLE_CD_REG_INT_DATA_STATUS_UPDATE |
 		     APPLE_CD_REG_INT_PLUG_EVENT,
 	.tps_struct_size = sizeof(struct cd321x),
+	.no_mode_control = true,
 	.remove = cd321x_remove,
 	.register_port = cd321x_register_port,
 	.unregister_port = cd321x_unregister_port,

---
base-commit: cee9395acd8043be0644b25c34bfa86623f2b935
change-id: 20260906-b4-tipd-mode-ctrl-80835d9e3f72

Best regards,

Signature · 1 line
Sven Peter <[email protected]>
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Sven Peter

Apple's CD321X firmware controls which alternate mode is entered and cannot be influenced from Linux. Set the no_mode_control capability to accurately reflect this to the typec subsystem.

Quoted 41 lines
---
 drivers/usb/typec/tipd/core.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/usb/typec/tipd/core.c +3 -1
index 522f56742aa9..8fdb37e288b4 100644
@@ -151,6 +151,7 @@ struct tipd_data {
 	irq_handler_t irq_handler;
 	u64 irq_mask1;
 	size_t tps_struct_size;
+	bool no_mode_control;
 	void (*remove)(struct tps6598x *tps);
 	int (*register_port)(struct tps6598x *tps, struct fwnode_handle *node);
 	void (*unregister_port)(struct tps6598x *tps);
@@ -1242,6 +1243,7 @@ tps6598x_register_port(struct tps6598x *tps, struct fwnode_handle *fwnode)
 	typec_cap.driver_data = tps;
 	typec_cap.ops = &tps6598x_ops;
 	typec_cap.fwnode = fwnode;
+	typec_cap.no_mode_control = tps->data->no_mode_control;
 
 	switch (TPS_SYSCONF_PORTINFO(conf)) {
 	case TPS_PORTINFO_SINK_ACCESSORY:
@@ -2015,6 +2017,7 @@ static const struct tipd_data cd321x_data = {
 		     APPLE_CD_REG_INT_DATA_STATUS_UPDATE |
 		     APPLE_CD_REG_INT_PLUG_EVENT,
 	.tps_struct_size = sizeof(struct cd321x),
+	.no_mode_control = true,
 	.remove = cd321x_remove,
 	.register_port = cd321x_register_port,
 	.unregister_port = cd321x_unregister_port,
 
---

base-commit: cee9395acd8043be0644b25c34bfa86623f2b935
change-id: 20260906-b4-tipd-mode-ctrl-80835d9e3f72

Best regards,

Signature · 1 line
Sven Peter <[email protected]>
Signature · 1 line
heikki