Skip to content

Commit 8cb491d

Browse files
nordic-krchnordicjm
authored andcommitted
[nrf fromtree] drivers: pwm: nrfx: Add protection against wrong configuration
Do not allow CONFIG_PM_DEVICE_SYSTEM_MANAGED when fast PWM instance is used. Signed-off-by: Krzysztof Chruściński <[email protected]> (cherry picked from commit fc77abc)
1 parent 3c86e5b commit 8cb491d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/pwm/pwm_nrfx.c

+5
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ LOG_MODULE_REGISTER(pwm_nrfx, CONFIG_PWM_LOG_LEVEL);
4848

4949
#if NRFX_FOREACH_PRESENT(PWM, PWM_NRFX_IS_FAST, (||), (0))
5050
#define PWM_NRFX_FAST_PRESENT 1
51+
/* If fast instances are used then system managed device PM cannot be used because
52+
* it may call PM actions from locked context and fast PWM PM actions can only be
53+
* called in a thread context.
54+
*/
55+
BUILD_ASSERT(!IS_ENABLED(CONFIG_PM_DEVICE_SYSTEM_MANAGED));
5156
#endif
5257

5358
#if defined(PWM_NRFX_FAST_PRESENT) && CONFIG_CLOCK_CONTROL_NRF2_GLOBAL_HSFLL

0 commit comments

Comments
 (0)