Skip to content

Commit 8cf519d

Browse files
bjarki-andreasenfabiobaltieri
authored andcommitted
drivers: spi: nrfx_spim: self resume until spi_release()
The nrxf_spim driver currently resumes itself for the duration of a transfer, however, in case SPI_LOCK_ON is used, the driver needs to keep itself resumed until spi_release() is called. Currently, this results in unbalanced suspend as the bus puts itself both after transaction is done, and when spi_release() is called. This patch makes the driver check if SPI_LOCK_ON is set once transaction is complete, if yes, selv get one more time to account for the two puts which will follow. Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
1 parent 43720ef commit 8cf519d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/spi/spi_nrfx_spim.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,11 @@ static void finish_transaction(const struct device *dev, int error)
403403
spi_context_complete(ctx, dev, error);
404404
dev_data->busy = false;
405405

406+
if (dev_data->ctx.config->operation & SPI_LOCK_ON) {
407+
/* Keep device resumed until call to spi_release() */
408+
(void)pm_device_runtime_get(dev);
409+
}
410+
406411
finalize_spi_transaction(dev, true);
407412
}
408413

0 commit comments

Comments
 (0)