All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Thierry Reding <thierry.reding@gmail.com>,
	Lee Jones <lee.jones@linaro.org>
Cc: linux-pwm@vger.kernel.org, kernel@pengutronix.de
Subject: [PATCH 04/47] pwm: rockchip: Don't modify HW state in .remove() callback
Date: Wed,  7 Jul 2021 18:27:52 +0200	[thread overview]
Message-ID: <20210707162835.1772882-5-u.kleine-koenig@pengutronix.de> (raw)
In-Reply-To: <20210707162835.1772882-1-u.kleine-koenig@pengutronix.de>

A consumer is expected to disable a PWM before calling pwm_put(). And if
they didn't there is hopefully a good reason (or the consumer needs
fixing). Also if disabling an enabled PWM was the right thing to do,
this should better be done in the framework instead of in each low level
driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/pwm/pwm-rockchip.c | 14 --------------
 1 file changed, 14 deletions(-)

diff --git a/drivers/pwm/pwm-rockchip.c b/drivers/pwm/pwm-rockchip.c
index cbe900877724..8fcef29948d7 100644
--- a/drivers/pwm/pwm-rockchip.c
+++ b/drivers/pwm/pwm-rockchip.c
@@ -384,20 +384,6 @@ static int rockchip_pwm_remove(struct platform_device *pdev)
 {
 	struct rockchip_pwm_chip *pc = platform_get_drvdata(pdev);
 
-	/*
-	 * Disable the PWM clk before unpreparing it if the PWM device is still
-	 * running. This should only happen when the last PWM user left it
-	 * enabled, or when nobody requested a PWM that was previously enabled
-	 * by the bootloader.
-	 *
-	 * FIXME: Maybe the core should disable all PWM devices in
-	 * pwmchip_remove(). In this case we'd only have to call
-	 * clk_unprepare() after pwmchip_remove().
-	 *
-	 */
-	if (pwm_is_enabled(pc->chip.pwms))
-		clk_disable(pc->clk);
-
 	clk_unprepare(pc->pclk);
 	clk_unprepare(pc->clk);
 
-- 
2.30.2


  parent reply	other threads:[~2021-07-07 16:28 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-07 16:27 [PATCH 00/47] pwm: Make pwmchip_remove return void Uwe Kleine-König
2021-07-07 16:27 ` [PATCH 01/47] pwm: lpc32xx: Don't modify HW state in .probe() after the PWM chip was registered Uwe Kleine-König
2021-07-07 16:27 ` [PATCH 02/47] pwm: mxs: " Uwe Kleine-König
2021-07-07 16:27 ` [PATCH 03/47] pwm: img: Don't modify HW state in .remove() callback Uwe Kleine-König
2021-07-07 16:27 ` Uwe Kleine-König [this message]
2021-07-07 16:27 ` [PATCH 05/47] pwm: stm32-lp: " Uwe Kleine-König
2021-07-07 16:27 ` [PATCH 06/47] pwm: hibvt: Disable the clock only after the PWM was unregistered Uwe Kleine-König
2021-07-07 16:27 ` [PATCH 07/47] pwm: rockchip: Unprepare clocks " Uwe Kleine-König
2021-07-07 16:27 ` [PATCH 08/47] pwm: tiehrpwm: Unprepare clock " Uwe Kleine-König
2021-07-07 16:27 ` [PATCH 09/47] pwm: ntxec: Drop useless assignment to struct pwmchip::base Uwe Kleine-König
2021-07-07 16:27 ` [PATCH 10/47] pwm: jz4740: Improve compile coverage by allowing to enable on !MIPS Uwe Kleine-König
2021-07-07 16:27 ` [PATCH 11/47] pwm: keembay: Improve compile coverage by allowing to enable on !ARM64 Uwe Kleine-König
2021-07-07 16:28 ` [PATCH 12/47] pwm: ab8500: Simplify using devm_pwmchip_add() Uwe Kleine-König
2021-07-07 16:28 ` [PATCH 13/47] pwm: bcm-kona: " Uwe Kleine-König
2021-07-07 16:28 ` [PATCH 14/47] pwm: ep93xx: " Uwe Kleine-König
2021-07-07 16:28 ` [PATCH 15/47] pwm: fsl-ftm: " Uwe Kleine-König
2021-07-07 16:28 ` [PATCH 16/47] pwm: imx27: " Uwe Kleine-König
2021-07-07 16:28 ` [PATCH 17/47] pwm: intel-lgm: " Uwe Kleine-König
2021-07-07 16:28 ` [PATCH 18/47] pwm: iqs620a: " Uwe Kleine-König
2021-07-07 16:28 ` [PATCH 19/47] pwm: jz4740: " Uwe Kleine-König
2021-07-07 16:28 ` [PATCH 20/47] pwm: keembay: " Uwe Kleine-König
2021-07-07 16:28 ` [PATCH 21/47] pwm: lp3943: " Uwe Kleine-König
2021-07-07 16:28 ` [PATCH 22/47] pwm: lpc32xx: " Uwe Kleine-König
2021-07-07 16:28 ` [PATCH 23/47] pwm: mediatek: " Uwe Kleine-König
2021-07-07 16:28 ` [PATCH 24/47] pwm: mxs: " Uwe Kleine-König
2021-07-07 16:28 ` [PATCH 25/47] pwm: ntxec: " Uwe Kleine-König
2021-07-07 16:28 ` [PATCH 26/47] pwm: pxa: " Uwe Kleine-König
2021-07-07 16:28 ` [PATCH 27/47] pwm: raspberrypi-poe: " Uwe Kleine-König
2021-07-07 16:28 ` [PATCH 28/47] pwm: sl28cpld: " Uwe Kleine-König
2021-07-07 16:28 ` [PATCH 29/47] pwm: stm32-lp: " Uwe Kleine-König
2021-07-07 16:28 ` [PATCH 30/47] pwm: tiecap: " Uwe Kleine-König
2021-07-07 16:28 ` [PATCH 31/47] pwm: twl-led: " Uwe Kleine-König
2021-07-07 16:28 ` [PATCH 32/47] pwm: twl: " Uwe Kleine-König
2021-07-07 16:28 ` [PATCH 33/47] pwm: atmel-hlcdc: Don't check the return code of pwmchip_remove() Uwe Kleine-König
2021-07-07 16:28 ` [PATCH 34/47] pwm: atmel-tcb: " Uwe Kleine-König
2021-07-07 16:28 ` [PATCH 35/47] pwm: brcmstb: " Uwe Kleine-König
2021-07-07 16:28 ` [PATCH 36/47] pwm: cros-ec: " Uwe Kleine-König
2021-07-07 16:28 ` [PATCH 37/47] pwm: img: " Uwe Kleine-König
2021-07-07 16:28 ` [PATCH 38/47] pwm: imx-tpm: " Uwe Kleine-König
2021-07-07 16:28 ` [PATCH 39/47] pwm: mtk-disp: " Uwe Kleine-König
2021-07-07 16:28 ` [PATCH 40/47] pwm: omap-dmtimer: " Uwe Kleine-König
2021-07-07 16:28 ` [PATCH 41/47] pwm: pca9685: " Uwe Kleine-König
2021-07-07 16:28 ` [PATCH 42/47] pwm: rcar: " Uwe Kleine-König
2021-07-07 16:28 ` [PATCH 43/47] pwm: renesas-tpu: " Uwe Kleine-König
2021-07-07 16:28 ` [PATCH 44/47] pwm: samsung: " Uwe Kleine-König
2021-07-07 16:28 ` [PATCH 45/47] pwm: sifive: " Uwe Kleine-König
2021-07-07 16:28 ` [PATCH 46/47] pwm: sun4i: " Uwe Kleine-König
2021-07-07 16:28 ` [PATCH 47/47] pwm: Make pwmchip_remove() return void Uwe Kleine-König

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=20210707162835.1772882-5-u.kleine-koenig@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=kernel@pengutronix.de \
    --cc=lee.jones@linaro.org \
    --cc=linux-pwm@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.