From: Anand Moon <linux.amoon@gmail.com>
To: Thierry Reding <thierry.reding@gmail.com>,
Sjoerd Simons <sjoerd.simons@collabora.co.uk>
Cc: linux-pwm@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-samsung-soc@vger.kernel.org,
Anand Moon <linux.amoon@gmail.com>
Subject: [PATCH] pwm: Add clk enable/disable for pwm_samsung_enable/pwm_samsung_disable
Date: Wed, 15 Apr 2015 03:35:08 +0930 [thread overview]
Message-ID: <1429034708-4537-1-git-send-email-linux.amoon@gmail.com> (raw)
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@gmail.com>
---
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
next reply other threads:[~2015-04-14 18:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-14 18:05 Anand Moon [this message]
2015-04-15 8:34 ` [PATCH] pwm: Add clk enable/disable for pwm_samsung_enable/pwm_samsung_disable Sjoerd Simons
2015-04-15 10:17 ` Anand Moon
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=1429034708-4537-1-git-send-email-linux.amoon@gmail.com \
--to=linux.amoon@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pwm@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=sjoerd.simons@collabora.co.uk \
--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