Skip to content

Commit 46a1db5

Browse files
committed
usb: skip usb_i2c_restore_irqs on models where i2c is not present
Signed-off-by: Yureka <yureka@cyberchaos.dev>
1 parent 0eeca15 commit 46a1db5

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/usb.c

Lines changed: 14 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,19 @@ 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+
return;
414+
402415
if (adt_is_compatible(adt, 0, "J180dAP"))
403416
usb_i2c_restore_irqs("/arm-io/i2c3", force);
404417
usb_i2c_restore_irqs("/arm-io/i2c0", force);

0 commit comments

Comments
 (0)