"Das U-Boot" Source Tree

pwm: imx: Don't drop the enable bit once set

Changing the duty-cycle should not blindly override (and clear) the
enable (EN) bit if it has already been set. For instance, a PWM
backlight can be enabled and set to a specific intensity using two
operations. The order of these operations should not matter.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>

authored by

Miquel Raynal and committed by
Fabio Estevam
5748aa1e 4aea3110

+3 -2
+3 -2
drivers/pwm/pwm-imx.c
··· 20 20 u32 cr; 21 21 22 22 writel(0, &pwm->ir); 23 - cr = PWMCR_PRESCALER(prescale) | 23 + 24 + cr = readl(&pwm->cr) & PWMCR_EN; 25 + cr |= PWMCR_PRESCALER(prescale) | 24 26 PWMCR_DOZEEN | PWMCR_WAITEN | 25 27 PWMCR_DBGEN | PWMCR_CLKSRC_IPG_HIGH; 26 - 27 28 writel(cr, &pwm->cr); 28 29 /* set duty cycles */ 29 30 writel(duty_cycles, &pwm->sar);