[PATCH] pwm: Add clk enable/disable for pwm_samsung_enable/pwm_samsung_disable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



It's safe to disable the clk when we following.
	pwm_config(pwm, 0, period);
 	pwm_disable(pwm);
And enable clk when we do following.
	pwm_config(pwm, duty, period);
 	pwm_enable(pwm);

Tested on OdroidXU3 Board.

Signed-off-by: Anand Moon <linux.amoon@xxxxxxxxx>
---
 drivers/pwm/pwm-samsung.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/pwm/pwm-samsung.c b/drivers/pwm/pwm-samsung.c
index 3e9b583..b579753 100644
--- a/drivers/pwm/pwm-samsung.c
+++ b/drivers/pwm/pwm-samsung.c
@@ -247,6 +247,7 @@ static int pwm_samsung_enable(struct pwm_chip *chip, struct pwm_device *pwm)
 	tcon &= ~TCON_MANUALUPDATE(tcon_chan);
 	tcon |= TCON_START(tcon_chan) | TCON_AUTORELOAD(tcon_chan);
 	writel(tcon, our_chip->base + REG_TCON);
+	clk_prepare_enable(our_chip->base_clk);
 
 	spin_unlock_irqrestore(&samsung_pwm_lock, flags);
 
@@ -265,6 +266,7 @@ static void pwm_samsung_disable(struct pwm_chip *chip, struct pwm_device *pwm)
 	tcon = readl(our_chip->base + REG_TCON);
 	tcon &= ~TCON_AUTORELOAD(tcon_chan);
 	writel(tcon, our_chip->base + REG_TCON);
+	clk_disable_unprepare(our_chip->base_clk);
 
 	spin_unlock_irqrestore(&samsung_pwm_lock, flags);
 }
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux SoC Development]     [Linux Rockchip Development]     [Linux USB Development]     [Video for Linux]     [Linux Audio Users]     [Linux SCSI]     [Yosemite News]

  Powered by Linux