Skip to content

Commit 1b0dc55

Browse files
nordic-krchnordicjm
authored andcommitted
[nrf fromtree] drivers: spi: nrfx_spim: Detect wrong configuration
Add compile time detection if fast SPIM instances are used and system managed device PM is enabled. This configuration is not supported. Signed-off-by: Krzysztof Chruściński <[email protected]> (cherry picked from commit d8dc241)
1 parent 8cb491d commit 1b0dc55

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/spi/spi_nrfx_spim.c

+5
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ LOG_MODULE_REGISTER(spi_nrfx_spim, CONFIG_SPI_LOG_LEVEL);
4949
#define SPIM_REQUESTS_CLOCK(idx) UTIL_OR(IS_EQ(idx, 120), \
5050
IS_EQ(idx, 121))
5151
#define USE_CLOCK_REQUESTS 1
52+
/* If fast instances are used then system managed device PM cannot be used because
53+
* it may call PM actions from locked context and fast SPIM PM actions can only be
54+
* called from a thread context.
55+
*/
56+
BUILD_ASSERT(!IS_ENABLED(CONFIG_PM_DEVICE_SYSTEM_MANAGED));
5257
#else
5358
#define SPIM_REQUESTS_CLOCK(idx) 0
5459
#endif

0 commit comments

Comments
 (0)