From 2d2bc55f5146ae8a10dc99243a6243029ba0170d Mon Sep 17 00:00:00 2001 From: Radoslaw Koppel Date: Thu, 17 Jun 2021 17:23:55 +0200 Subject: [PATCH] drivers: pwm: pwm_nrfx: Fix driver suspending This commit clears current settings of the PWM perihperal that are stored inside device structure. This makes sure that PWM period and prescaler is configured as expected after driver was suspended. Signed-off-by: Radoslaw Koppel --- drivers/pwm/pwm_nrfx.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/pwm/pwm_nrfx.c b/drivers/pwm/pwm_nrfx.c index 256ae4a4b2f..6ff93aa1972 100644 --- a/drivers/pwm/pwm_nrfx.c +++ b/drivers/pwm/pwm_nrfx.c @@ -288,6 +288,8 @@ static void pwm_nrfx_uninit(const struct device *dev) const struct pwm_nrfx_config *config = dev->config; nrfx_pwm_uninit(&config->pwm); + + memset(dev->data, 0, sizeof(struct pwm_nrfx_data)); } static int pwm_nrfx_set_power_state(uint32_t new_state,