Commit f2b5d43c authored by Adrian Hunter's avatar Adrian Hunter Committed by Alexandre Belloni
Browse files

i3c: mipi-i3c-hci: Allow core re-initialization for Runtime PM support



Prepare i3c_hci_reset_and_init() to support runtime resume.  Update it to
handle the case where the I/O mode has already been selected.

Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
Reviewed-by: default avatarFrank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260113072702.16268-18-adrian.hunter@intel.com


Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
parent 7f91e0e6
Loading
Loading
Loading
Loading
+21 −17
Original line number Diff line number Diff line
@@ -681,6 +681,9 @@ static int i3c_hci_reset_and_init(struct i3c_hci *hci)
		}
	}

	if (hci->io) {
		ret = i3c_hci_set_io_mode(hci, hci->io == &mipi_i3c_hci_dma);
	} else {
		/* Try activating DMA operations first */
		if (hci->RHS_regs) {
			ret = i3c_hci_set_io_mode(hci, true);
@@ -703,6 +706,7 @@ static int i3c_hci_reset_and_init(struct i3c_hci *hci)
			dev_err(&hci->master.dev, "neither DMA nor PIO can be used\n");
			ret = ret ?: -EINVAL;
		}
	}
	if (ret)
		return ret;