Skip to content

Commit b6a02e3

Browse files
committed
usb: skip usb_i2c_restore_irqs on models where i2c is not present
1 parent 0eeca15 commit b6a02e3

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/usb.c

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ void usb_init(void)
315315
return;
316316

317317
/*
318-
* M3 models do not use i2c, but instead SPMI with a new controller.
318+
* M3/M4 models do not use i2c, but instead SPMI with a new controller.
319319
* We can get USB going for now by just bringing up the phys.
320320
*/
321321
if (adt_path_offset(adt, "/arm-io/nub-spmi-a0/hpm0") > 0) {
@@ -399,6 +399,21 @@ void usb_i2c_restore_irqs(const char *i2c_path, bool force)
399399

400400
void usb_hpm_restore_irqs(bool force)
401401
{
402+
/*
403+
* Do not try to restore irqs on M3/M4 which don't use i2c
404+
*/
405+
if (adt_path_offset(adt, "/arm-io/nub-spmi-a0/hpm0") > 0)
406+
return;
407+
408+
/*
409+
* Do not try to restore irqs on A7-A11 which don't use i2c
410+
*/
411+
if (adt_path_offset(adt, "/arm-io/otgphyctrl") > 0 &&
412+
adt_path_offset(adt, "/arm-io/usb-complex") > 0) {
413+
/* We do not support the custom controller and dwc2 (yet). */
414+
return;
415+
}
416+
402417
if (adt_is_compatible(adt, 0, "J180dAP"))
403418
usb_i2c_restore_irqs("/arm-io/i2c3", force);
404419
usb_i2c_restore_irqs("/arm-io/i2c0", force);

0 commit comments

Comments
 (0)