Skip to content

Commit 532f189

Browse files
drivers: spi: nrfx_spim: impl spi_context_cs_get_all/put_all
Implement calling spi_context_cs_get_all() and spi_context_cs_put_all() in line with pm resume/suspend. Signed-off-by: Bjarki Arge Andreasen <[email protected]>
1 parent 6437292 commit 532f189

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/spi/spi_nrfx_spim.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -661,12 +661,17 @@ static DEVICE_API(spi, spi_nrfx_driver_api) = {
661661
static int spim_resume(const struct device *dev)
662662
{
663663
const struct spi_nrfx_config *dev_config = dev->config;
664+
struct spi_nrfx_data *dev_data = dev->data;
664665

665666
(void)pinctrl_apply_state(dev_config->pcfg, PINCTRL_STATE_DEFAULT);
666667
/* nrfx_spim_init() will be called at configuration before
667668
* the next transfer.
668669
*/
669670

671+
if (spi_context_cs_get_all(&dev_data->ctx)) {
672+
return -EAGAIN;
673+
}
674+
670675
#ifdef CONFIG_SOC_NRF54H20_GPD
671676
nrf_gpd_retain_pins_set(dev_config->pcfg, false);
672677
#endif
@@ -688,6 +693,8 @@ static void spim_suspend(const struct device *dev)
688693
release_clock(dev);
689694
}
690695

696+
spi_context_cs_put_all(&dev_data->ctx);
697+
691698
#ifdef CONFIG_SOC_NRF54H20_GPD
692699
nrf_gpd_retain_pins_set(dev_config->pcfg, true);
693700
#endif

0 commit comments

Comments
 (0)