Commit 7ccd40ed authored by Jarkko Nikula's avatar Jarkko Nikula Committed by Alexandre Belloni
Browse files

i3c: mipi-i3c-hci: Set number of SW enabled Ring Bundles earlier



Number of software enabled Ring Bundles must be set before using them.
Otherwise Ring will not start and may be power-gated by the Host
Controller.

Signed-off-by: default avatarJarkko Nikula <jarkko.nikula@linux.intel.com>
Link: https://lore.kernel.org/r/20230921055704.1087277-9-jarkko.nikula@linux.intel.com


Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
parent 4e40642c
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -229,6 +229,9 @@ static int hci_dma_init(struct i3c_hci *hci)
	hci->io_data = rings;
	rings->total = nr_rings;

	regval = FIELD_PREP(MAX_HEADER_COUNT, rings->total);
	rhs_reg_write(CONTROL, regval);

	for (i = 0; i < rings->total; i++) {
		u32 offset = rhs_reg_read(RHn_OFFSET(i));

@@ -329,8 +332,6 @@ static int hci_dma_init(struct i3c_hci *hci)
					   RING_CTRL_RUN_STOP);
	}

	regval = FIELD_PREP(MAX_HEADER_COUNT, rings->total);
	rhs_reg_write(CONTROL, regval);
	return 0;

err_out: