Skip to content

Commit acbed8a

Browse files
bjarki-andreasenkartben
authored andcommitted
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 <bjarki.andreasen@nordicsemi.no>
1 parent 1cda0ee commit acbed8a

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
@@ -662,12 +662,17 @@ static DEVICE_API(spi, spi_nrfx_driver_api) = {
662662
static int spim_resume(const struct device *dev)
663663
{
664664
const struct spi_nrfx_config *dev_config = dev->config;
665+
struct spi_nrfx_data *dev_data = dev->data;
665666

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

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

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

0 commit comments

Comments
 (0)