diff options
author | Fabio Estevam <fabio.estevam@nxp.com> | 2018-01-02 14:01:59 +0100 |
---|---|---|
committer | Thierry Reding <thierry.reding@gmail.com> | 2018-03-28 00:17:36 +0200 |
commit | 1f6eefeb7cd45360397fb5d3f08ce9ec41e80b17 (patch) | |
tree | 64d35667eccf3794fed940dbca515082cce0317a /drivers/pwm | |
parent | dt-bindings: pwm: renesas-tpu: Correct SoC part numbers and family names (diff) | |
download | linux-1f6eefeb7cd45360397fb5d3f08ce9ec41e80b17.tar.xz linux-1f6eefeb7cd45360397fb5d3f08ce9ec41e80b17.zip |
pwm: imx: Let PWM be active during suspend
On a imx6q-cubox-i board, which has an LED driven by PWM, when the system
goes into suspend the PWM block is disabled by default, then the PWM pin
goes to logic level zero and turn on the LED during suspend, which is not
really the behaviour we want to see.
By keeping the PWM enabled during suspend via STOPEN bit, the pwm-leds
driver sets the brightness to zero in suspend and then the LED is
turned off as expected.
So always set the STOPEN to fix the PWM behaviour in suspend.
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Diffstat (limited to 'drivers/pwm')
-rw-r--r-- | drivers/pwm/pwm-imx.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/pwm/pwm-imx.c b/drivers/pwm/pwm-imx.c index 2ba5c3a398ff..08cbe8120588 100644 --- a/drivers/pwm/pwm-imx.c +++ b/drivers/pwm/pwm-imx.c @@ -35,6 +35,7 @@ #define MX3_PWMSAR 0x0C /* PWM Sample Register */ #define MX3_PWMPR 0x10 /* PWM Period Register */ #define MX3_PWMCR_PRESCALER(x) ((((x) - 1) & 0xFFF) << 4) +#define MX3_PWMCR_STOPEN (1 << 25) #define MX3_PWMCR_DOZEEN (1 << 24) #define MX3_PWMCR_WAITEN (1 << 23) #define MX3_PWMCR_DBGEN (1 << 22) @@ -210,7 +211,7 @@ static int imx_pwm_apply_v2(struct pwm_chip *chip, struct pwm_device *pwm, writel(period_cycles, imx->mmio_base + MX3_PWMPR); cr = MX3_PWMCR_PRESCALER(prescale) | - MX3_PWMCR_DOZEEN | MX3_PWMCR_WAITEN | + MX3_PWMCR_STOPEN | MX3_PWMCR_DOZEEN | MX3_PWMCR_WAITEN | MX3_PWMCR_DBGEN | MX3_PWMCR_CLKSRC_IPG_HIGH | MX3_PWMCR_EN; |