On Mon, Nov 20, 2017 at 09:27:23PM -0200, Fabio Estevam wrote: > From: Fabio Estevam > > 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. It looks like this would also keep other PWMs enabled in suspend. If for example you hooked up a fan to this PWM this change would make it so that the fan would remain on during suspend. That doesn't sound desirable to me. On v2, I see this reply from you: Please note that on imx6qdl-cuboxi the pwm is active low. I also see that imx6q-cubox-i uses the "fsl,imx27-pwm" compatible version of this controller and that supports polarity inversion. I think the correct thing to do here is to mark the PWM as inverted (according to the DTS file it is actually the pwmleds node that has an active-low property). If you invert the PWM you could add extra code to the PWM driver to deal with this properly and set STOPEN only for inverted PWM signals. Thierry