linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: <linux-arm-kernel@lists.infradead.org>
Cc: "HACHIMI Samir" <shachimi@adeneo-embedded.com>,
	shawn.guo@linaro.org, thierry.reding@avionic-design.de,
	linux-kernel@vger.kernel.org,
	"Benoît Thébaudeau" <benoit.thebaudeau@advansee.com>,
	kernel@pengutronix.de, "Sascha Hauer" <s.hauer@pengutronix.de>
Subject: [PATCH 6/8] pwm i.MX: use per clock unconditionally
Date: Wed,  5 Sep 2012 15:35:25 +0200	[thread overview]
Message-ID: <1346852127-25226-7-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1346852127-25226-1-git-send-email-s.hauer@pengutronix.de>

The i.MX pwm core has two clocks: The ipg clock and the ipg highfreq
(peripheral) clock. The ipg clock has to be enabled for this hardware
to work. The actual pwm output can either be driven by the ipg clock
or the ipg highfreq. The ipg highfreq has the advantage that it runs
even when the SoC is in low power modes.
Use the always running clock also on i.MX25.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/pwm/pwm-imx.c |    7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/pwm/pwm-imx.c b/drivers/pwm/pwm-imx.c
index af77045..b234288 100644
--- a/drivers/pwm/pwm-imx.c
+++ b/drivers/pwm/pwm-imx.c
@@ -131,16 +131,11 @@ static int imx_pwm_config_v2(struct pwm_chip *chip,
 
 	cr = MX3_PWMCR_PRESCALER(prescale) |
 		MX3_PWMCR_DOZEEN | MX3_PWMCR_WAITEN |
-		MX3_PWMCR_DBGEN;
+		MX3_PWMCR_DBGEN | MX3_PWMCR_CLKSRC_IPG_HIGH;
 
 	if (imx->enabled)
 		cr |= MX3_PWMCR_EN;
 
-	if (cpu_is_mx25())
-		cr |= MX3_PWMCR_CLKSRC_IPG;
-	else
-		cr |= MX3_PWMCR_CLKSRC_IPG_HIGH;
-
 	writel(cr, imx->mmio_base + MX3_PWMCR);
 
 	return 0;
-- 
1.7.10.4


  parent reply	other threads:[~2012-09-05 13:35 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-05 13:35 [PATCH v2] pwm i.MX: add devicetree support Sascha Hauer
2012-09-05 13:35 ` [PATCH 1/8] pwm i.MX: factor out SoC specific functions Sascha Hauer
2012-09-05 13:35 ` [PATCH 2/8] pwm i.MX: remove unnecessary if in pwm_[en|dis]able Sascha Hauer
2012-09-05 13:35 ` [PATCH 3/8] pwm i.MX: add functions to enable/disable pwm Sascha Hauer
2012-09-05 13:35 ` [PATCH 4/8] pwm i.MX: Use module_platform_driver Sascha Hauer
2012-09-05 13:35 ` [PATCH 5/8] pwm i.MX: add devicetree support Sascha Hauer
2012-09-05 21:42   ` Benoît Thébaudeau
2012-09-06  6:58     ` Sascha Hauer
2012-09-05 13:35 ` Sascha Hauer [this message]
2012-09-05 13:35 ` [PATCH 7/8] pwm i.MX: fix clock lookup Sascha Hauer
2012-09-05 21:48   ` Benoît Thébaudeau
2012-09-06  7:15     ` Sascha Hauer
2012-09-05 13:35 ` [PATCH 8/8] ARM i.MX53: Add pwm support Sascha Hauer
2012-09-06  8:19 ` [PATCH v2] pwm i.MX: add devicetree support Shawn Guo

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=1346852127-25226-7-git-send-email-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=benoit.thebaudeau@advansee.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shachimi@adeneo-embedded.com \
    --cc=shawn.guo@linaro.org \
    --cc=thierry.reding@avionic-design.de \
    /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;
as well as URLs for NNTP newsgroup(s).