Skip to content

Commit 43720ef

Browse files
bjarki-andreasenfabiobaltieri
authored andcommitted
Revert "drivers: spi: nrfx_spim: prevent self suspend until spi_release()"
This reverts commit 937a44a. Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
1 parent 2c1b302 commit 43720ef

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

drivers/spi/spi_nrfx_spim.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -154,12 +154,7 @@ static inline void finalize_spi_transaction(const struct device *dev, bool deact
154154
void *reg = dev_config->spim.p_reg;
155155

156156
if (deactivate_cs) {
157-
/*
158-
* We may suspend SPI only if we don't have to keep CS asserted, as we
159-
* need to keep the CS GPIO port resumed until spi_release() in this case.
160-
*/
161157
spi_context_cs_control(&dev_data->ctx, false);
162-
pm_device_runtime_put_async(dev, K_NO_WAIT);
163158
}
164159

165160
if (NRF_SPIM_IS_320MHZ_SPIM(reg) && !(dev_data->ctx.config->operation & SPI_HOLD_ON_CS)) {
@@ -169,6 +164,8 @@ static inline void finalize_spi_transaction(const struct device *dev, bool deact
169164
if (!IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) {
170165
release_clock(dev);
171166
}
167+
168+
pm_device_runtime_put_async(dev, K_NO_WAIT);
172169
}
173170

174171
static inline uint32_t get_nrf_spim_frequency(uint32_t frequency)
@@ -406,7 +403,7 @@ static void finish_transaction(const struct device *dev, int error)
406403
spi_context_complete(ctx, dev, error);
407404
dev_data->busy = false;
408405

409-
finalize_spi_transaction(dev, (dev_data->ctx.config->operation & SPI_HOLD_ON_CS) > 0);
406+
finalize_spi_transaction(dev, true);
410407
}
411408

412409
static void transfer_next_chunk(const struct device *dev)

0 commit comments

Comments
 (0)