LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Nikita Shubin <nikita.shubin@maquefel.me>
To: Alexander Sverdlin <alexander.sverdlin@gmail.com>,
	Geert Uytterhoeven <geert@linux-m68k.org>
Cc: "Nikita Shubin" <nikita.shubin@maquefel.me>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"Thierry Reding" <thierry.reding@gmail.com>,
	"Lee Jones" <lee.jones@linaro.org>,
	linux-pwm@vger.kernel.org (open list:PWM SUBSYSTEM),
	linux-kernel@vger.kernel.org (open list)
Subject: [PATCH v2 7/8] pwm: ep93xx: Prepare clock before using it
Date: Mon, 26 Jul 2021 16:59:55 +0300	[thread overview]
Message-ID: <20210726140001.24820-8-nikita.shubin@maquefel.me> (raw)
In-Reply-To: <20210726140001.24820-1-nikita.shubin@maquefel.me>

From: Alexander Sverdlin <alexander.sverdlin@gmail.com>

Use clk_prepare_enable()/clk_disable_unprepare() in preparation for switch
to Common Clock Framework.

Signed-off-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Nikita Shubin <nikita.shubin@maquefel.me>
---
 drivers/pwm/pwm-ep93xx.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/pwm/pwm-ep93xx.c b/drivers/pwm/pwm-ep93xx.c
index 4ca70794ad96..8c0d4d69d9e6 100644
--- a/drivers/pwm/pwm-ep93xx.c
+++ b/drivers/pwm/pwm-ep93xx.c
@@ -74,7 +74,7 @@ static int ep93xx_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,
 	 * Configuration can be changed at any time.
 	 */
 	if (!pwm_is_enabled(pwm)) {
-		ret = clk_enable(ep93xx_pwm->clk);
+		ret = clk_prepare_enable(ep93xx_pwm->clk);
 		if (ret)
 			return ret;
 	}
@@ -105,7 +105,7 @@ static int ep93xx_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,
 	}
 
 	if (!pwm_is_enabled(pwm))
-		clk_disable(ep93xx_pwm->clk);
+		clk_disable_unprepare(ep93xx_pwm->clk);
 
 	return ret;
 }
@@ -120,7 +120,7 @@ static int ep93xx_pwm_polarity(struct pwm_chip *chip, struct pwm_device *pwm,
 	 * The clock needs to be enabled to access the PWM registers.
 	 * Polarity can only be changed when the PWM is disabled.
 	 */
-	ret = clk_enable(ep93xx_pwm->clk);
+	ret = clk_prepare_enable(ep93xx_pwm->clk);
 	if (ret)
 		return ret;
 
@@ -129,7 +129,7 @@ static int ep93xx_pwm_polarity(struct pwm_chip *chip, struct pwm_device *pwm,
 	else
 		writew(0x0, ep93xx_pwm->base + EP93XX_PWMx_INVERT);
 
-	clk_disable(ep93xx_pwm->clk);
+	clk_disable_unprepare(ep93xx_pwm->clk);
 
 	return 0;
 }
@@ -139,7 +139,7 @@ static int ep93xx_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm)
 	struct ep93xx_pwm *ep93xx_pwm = to_ep93xx_pwm(chip);
 	int ret;
 
-	ret = clk_enable(ep93xx_pwm->clk);
+	ret = clk_prepare_enable(ep93xx_pwm->clk);
 	if (ret)
 		return ret;
 
@@ -153,7 +153,7 @@ static void ep93xx_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm)
 	struct ep93xx_pwm *ep93xx_pwm = to_ep93xx_pwm(chip);
 
 	writew(0x0, ep93xx_pwm->base + EP93XX_PWMx_ENABLE);
-	clk_disable(ep93xx_pwm->clk);
+	clk_disable_unprepare(ep93xx_pwm->clk);
 }
 
 static const struct pwm_ops ep93xx_pwm_ops = {
-- 
2.26.2


  parent reply	other threads:[~2021-07-26 14:01 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-26 11:50 [PATCH 0/8] arm: ep93xx: CCF conversion Nikita Shubin
2021-07-26 11:50 ` [PATCH 1/8] iio: ep93xx: Prepare clock before using it Nikita Shubin
2021-07-26 11:50 ` [PATCH 2/8] spi: spi-ep93xx: " Nikita Shubin
2021-07-26 12:01   ` Mark Brown
2021-07-26 11:50 ` [PATCH 3/8] Input: ep93xx_keypad: " Nikita Shubin
2021-07-26 11:50 ` [PATCH 4/8] video: ep93xx: " Nikita Shubin
2021-07-26 11:50 ` [PATCH 5/8] dmaengine: " Nikita Shubin
2021-07-26 11:50 ` [PATCH 6/8] ASoC: cirrus: i2s: " Nikita Shubin
2021-07-26 11:50 ` [PATCH 7/8] pwm: ep93xx: " Nikita Shubin
2021-07-26 11:50 ` [PATCH 8/8] ep93xx: clock: convert in-place to COMMON_CLK Nikita Shubin
2021-07-26 11:57   ` Alexander Sverdlin
2021-07-26 13:59 ` [PATCH v2 0/8] arm: ep93xx: CCF conversion Nikita Shubin
2021-07-26 13:59   ` [PATCH v2 1/8] iio: ep93xx: Prepare clock before using it Nikita Shubin
2021-07-26 13:59   ` [PATCH v2 2/8] spi: spi-ep93xx: " Nikita Shubin
2021-07-26 16:51     ` Mark Brown
2021-08-02  7:36       ` Alexander Sverdlin
2021-09-13 21:36       ` Alexander Sverdlin
2021-09-13 21:37         ` Alexander Sverdlin
2021-09-14 10:32         ` Mark Brown
2021-07-26 13:59   ` [PATCH v2 3/8] Input: ep93xx_keypad: " Nikita Shubin
2021-07-26 13:59   ` [PATCH v2 4/8] video: ep93xx: " Nikita Shubin
2021-07-26 13:59   ` [PATCH v2 5/8] dmaengine: " Nikita Shubin
2021-08-02  6:57     ` Vinod Koul
2021-07-26 13:59   ` [PATCH v2 6/8] ASoC: cirrus: i2s: " Nikita Shubin
2021-07-26 16:51     ` Mark Brown
2021-09-13 21:43       ` Alexander Sverdlin
2021-10-12  7:25         ` Alexander Sverdlin
2021-10-12 10:40           ` Mark Brown
2021-07-26 13:59   ` Nikita Shubin [this message]
2021-07-26 13:59   ` [PATCH v2 8/8] ep93xx: clock: convert in-place to COMMON_CLK Nikita Shubin
2021-10-12  8:03     ` Alexander Sverdlin
2021-10-12  8:29       ` Arnd Bergmann
2021-10-12  8:37         ` Alexander Sverdlin
2021-10-12  9:05           ` Arnd Bergmann
2021-10-12 10:26             ` Mark Brown
2021-10-12 10:36               ` Alexander Sverdlin
2021-10-12 10:43                 ` Mark Brown
2021-10-12 11:03                   ` Alexander Sverdlin
2021-10-12 11:21                     ` Mark Brown
2021-10-12 11:26                       ` Alexander Sverdlin
2021-10-12 11:30                         ` Geert Uytterhoeven
2021-10-12 12:39                           ` Arnd Bergmann
2021-10-12 12:57                             ` Alexander Sverdlin
2021-10-15 22:32                           ` Mark Brown
2021-08-03 22:35   ` (subset) [PATCH v2 0/8] arm: ep93xx: CCF conversion Mark Brown
2021-07-31 22:04 ` [PATCH " Linus Walleij

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=20210726140001.24820-8-nikita.shubin@maquefel.me \
    --to=nikita.shubin@maquefel.me \
    --cc=alexander.sverdlin@gmail.com \
    --cc=geert@linux-m68k.org \
    --cc=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=thierry.reding@gmail.com \
    --cc=u.kleine-koenig@pengutronix.de \
    --subject='Re: [PATCH v2 7/8] pwm: ep93xx: Prepare clock before using it' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).