pwm/pwm_da1469x: Preserve timer state on frequency change.

Read the current timer state (timer control reg) and preserve
its running state when setting frequency. The only bits that
should be set in the control register are the bits to enable
the timer in the proper mode and enable the clock.
diff --git a/hw/drivers/pwm/pwm_da1469x/src/pwm_da1469x.c b/hw/drivers/pwm/pwm_da1469x/src/pwm_da1469x.c
index b6c74da..1f7c5b8 100644
--- a/hw/drivers/pwm/pwm_da1469x/src/pwm_da1469x.c
+++ b/hw/drivers/pwm/pwm_da1469x/src/pwm_da1469x.c
@@ -91,7 +91,7 @@
 
     pwm = da1469x_pwm_resolve(dev->pwm_instance_id);
     if (!pwm || !pwm->in_use) {
-       return SYS_EINVAL;
+        return SYS_EINVAL;
     }
 
     mcu_gpio_set_pin_function(cfg->pin, MCU_GPIO_MODE_OUTPUT, pwm->gpio_func);
@@ -220,6 +220,7 @@
     int tim_pwm_freq;
     uint32_t sys_clk_en;
     uint32_t actual_freq;
+    uint32_t clk_reg;
 
     pwm = da1469x_pwm_resolve(dev->pwm_instance_id);
     if (!pwm || !pwm->in_use) {
@@ -232,7 +233,8 @@
     }
 
     pwm->timer_regs->TIMER_PRESCALER_REG = 0;
-    pwm->timer_regs->TIMER_CTRL_REG = sys_clk_en;
+    clk_reg = pwm->timer_regs->TIMER_CTRL_REG & ~TIMER_TIMER_CTRL_REG_TIM_SYS_CLK_EN_Msk;
+    pwm->timer_regs->TIMER_CTRL_REG = (sys_clk_en | clk_reg);
     pwm->timer_regs->TIMER_PWM_FREQ_REG = tim_pwm_freq;
 
     pwm->freq = actual_freq;