From: Fabio Estevam <festevam@gmail.com>
To: thierry.reding@gmail.com
Cc: linux-pwm@vger.kernel.org, robh@kernel.org,
linux@arm.linux.org.uk, Fabio Estevam <fabio.estevam@nxp.com>
Subject: [PATCH v3] pwm: imx: Let PWM be active during suspend
Date: Mon, 20 Nov 2017 21:27:23 -0200 [thread overview]
Message-ID: <1511220443-26629-1-git-send-email-festevam@gmail.com> (raw)
From: Fabio Estevam <fabio.estevam@nxp.com>
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>
---
Changes since v2:
- Remove the optional dt property and set the STOPEN bit unconditionally (Rob)
drivers/pwm/pwm-imx.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/pwm/pwm-imx.c b/drivers/pwm/pwm-imx.c
index 2ba5c3a..08cbe81 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;
--
2.7.4
next reply other threads:[~2017-11-20 23:27 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-20 23:27 Fabio Estevam [this message]
2017-12-04 12:29 ` [PATCH v3] pwm: imx: Let PWM be active during suspend Fabio Estevam
2017-12-05 8:47 ` Thierry Reding
2017-12-05 18:56 ` Fabio Estevam
2017-12-08 17:22 ` Fabio Estevam
2017-12-11 9:16 ` Thierry Reding
2017-12-11 9:36 ` Russell King - ARM Linux
2017-12-11 12:09 ` Thierry Reding
2017-12-11 10:54 ` Fabio Estevam
2017-12-11 12:13 ` Thierry Reding
2017-12-11 12:24 ` Fabio Estevam
2017-12-11 13:20 ` Lothar Waßmann
2017-12-11 15:07 ` Fabio Estevam
2017-12-11 15:55 ` Lothar Waßmann
2017-12-11 16:06 ` Fabio Estevam
2017-12-11 16:52 ` Lothar Waßmann
2017-12-11 18:48 ` Fabio Estevam
2017-12-15 12:02 ` Lothar Waßmann
2017-12-16 18:26 ` Fabio Estevam
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1511220443-26629-1-git-send-email-festevam@gmail.com \
--to=festevam@gmail.com \
--cc=fabio.estevam@nxp.com \
--cc=linux-pwm@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=robh@kernel.org \
--cc=thierry.reding@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox