Skip to content

Commit 2ad915e

Browse files
committed
usb: typec: tipd: Do not request duplicate role switches
The cd321x on M2 and M1 and M2 Pro/Max/Ultra devices generate additional interrupts with data and power updates. Data and power status registers change but only in unknown bits. When connecting an USB3 device the bit 31 in TPS_REG_DATA_STATUS is set. The publically available TRMs for TPS65981, TPS65982, TPS65986, TPS65987DDH and TPS65988DH describe bit 31 as reserved. The updated power status has bits 8-11 set. The TPS65987DDH and TPS65988DH TRM specifies bits 8-9 but 0b11 is a reserved value. The power status update interrupt arrives 1 second after the initial plug status interrupt. This exceeds the debounce delay of 500 ms and results in a repeated USB role switch to host mode. The DWC3 apple glue driver disconnects the bus at this time. Signed-off-by: Janne Grunau <j@jannau.net>
1 parent 99231e1 commit 2ad915e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/usb/typec/tipd/core.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -841,7 +841,8 @@ static void cd321x_update_work(struct work_struct *work)
841841
cd321x_typec_update_mode(tps, &st);
842842

843843
/* Launch the USB role switch */
844-
usb_role_switch_set_role(tps->role_sw, new_role);
844+
if ((new_role != old_role) || was_disconnected)
845+
usb_role_switch_set_role(tps->role_sw, new_role);
845846

846847
power_supply_changed(tps->psy);
847848
}

0 commit comments

Comments
 (0)