[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20161229141041.16369-1-stefan@agner.ch>
Date: Thu, 29 Dec 2016 15:10:41 +0100
From: Stefan Agner <stefan@...er.ch>
To: l.majewski@...ess.pl, thierry.reding@...il.com
Cc: s.hauer@...gutronix.de, linux-pwm@...r.kernel.org,
bhuvanchandra.dv@...adex.com, linux-kernel@...r.kernel.org,
fabio.estevam@....com, boris.brezillon@...e-electrons.com,
LW@...o-electronics.de, kernel@...gutronix.de, shawnguo@...nel.org,
Stefan Agner <stefan@...er.ch>
Subject: [PATCH] pwm: imx: keep peripheral clock enabled during register access
On some platforms (i.MX 7) the peripheral clock is required during
register access. Make sure that the clock is kept enabled when
accessing registers.
Signed-off-by: Stefan Agner <stefan@...er.ch>
---
Hi Thierry, hi Lukasz,
This patch applies ontop of Lukasz "pwm: imx: Provide atomic operation
for IMX PWM driver" patchset. With that, my expressed concern to patch
2 is solved.
--
Stefan
drivers/pwm/pwm-imx.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/pwm/pwm-imx.c b/drivers/pwm/pwm-imx.c
index a21463436aa4..fbd997514a87 100644
--- a/drivers/pwm/pwm-imx.c
+++ b/drivers/pwm/pwm-imx.c
@@ -192,7 +192,7 @@ static int imx_pwm_apply_v2(struct pwm_chip *chip, struct pwm_device *pwm,
period_cycles = 0;
/* Enable the clock if the PWM is being enabled. */
- if (state->enabled && !cstate.enabled) {
+ if (!cstate.enabled) {
ret = clk_prepare_enable(imx->clk_per);
if (ret)
return ret;
@@ -223,7 +223,7 @@ static int imx_pwm_apply_v2(struct pwm_chip *chip, struct pwm_device *pwm,
writel(cr, imx->mmio_base + MX3_PWMCR);
/* Disable the clock if the PWM is being disabled. */
- if (!state->enabled && cstate.enabled)
+ if (!state->enabled)
clk_disable_unprepare(imx->clk_per);
return 0;
--
2.11.0
Powered by blists - more mailing lists