linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4] pwm: i.MX: add devicetree support
@ 2012-09-10  8:59 Sascha Hauer
  2012-09-10  8:59 ` [PATCH 1/7] pwm: i.MX: factor out SoC specific functions Sascha Hauer
                   ` (6 more replies)
  0 siblings, 7 replies; 12+ messages in thread
From: Sascha Hauer @ 2012-09-10  8:59 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: HACHIMI Samir, shawn.guo, thierry.reding, linux-kernel,
	Benoît Thébaudeau, kernel


Changes since v3:

- Change patches to subject 'pwm:'
- Use uppercase PWM when referring to PWMs
- Change commit message for "factor out SoC specific functions" patch

Changes since v2:

- check return value of clk_prepare_enable
- remove platform based probing

Changes since v1:

- Add devicetree binding documentation
- Merge 5/9 and 9/9
- fix #pwm-cells (must be 2 instead of 3)
- fix wrong name in MODULE_DEVICE_TABLE
- drop platform based probing while introducing devicetree based probe


The following changes since commit fea7a08acb13524b47711625eebea40a0ede69a0:

  Linux 3.6-rc3 (2012-08-22 13:29:06 -0700)

are available in the git repository at:

  git://git.pengutronix.de/git/imx/linux-2.6.git tags/imx-pwm-oftree

for you to fetch changes up to 5e39af20dedff5dca77c36209ddb09729cfe090e:

  pwm: i.MX: fix clock lookup (2012-09-10 10:40:27 +0200)

----------------------------------------------------------------
Cleanup i.MX PWM driver and add devicetree support

----------------------------------------------------------------
Philipp Zabel (2):
      pwm: i.MX: add devicetree support
      pwm: i.MX: fix clock lookup

Sascha Hauer (5):
      pwm: i.MX: factor out SoC specific functions
      pwm: i.MX: remove unnecessary if in pwm_[en|dis]able
      pwm: i.MX: add functions to enable/disable pwm.
      pwm: i.MX: Use module_platform_driver
      pwm: i.MX: use per clock unconditionally

 Documentation/devicetree/bindings/pwm/imx-pwm.txt |   17 ++
 drivers/pwm/pwm-imx.c                             |  278 ++++++++++++++-------
 2 files changed, 199 insertions(+), 96 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/pwm/imx-pwm.txt

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 1/7] pwm: i.MX: factor out SoC specific functions
  2012-09-10  8:59 [PATCH v4] pwm: i.MX: add devicetree support Sascha Hauer
@ 2012-09-10  8:59 ` Sascha Hauer
  2012-09-10  8:59 ` [PATCH 2/7] pwm: i.MX: remove unnecessary if in pwm_[en|dis]able Sascha Hauer
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 12+ messages in thread
From: Sascha Hauer @ 2012-09-10  8:59 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: HACHIMI Samir, shawn.guo, thierry.reding, linux-kernel,
	Benoît Thébaudeau, kernel, Sascha Hauer

To cleanup the code and to make it easier to support different
SoCs.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Reviewed-by: Shawn Guo <shawn.guo@linaro.org>
Reviewed-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
---
 drivers/pwm/pwm-imx.c |  146 ++++++++++++++++++++++++++++---------------------
 1 file changed, 83 insertions(+), 63 deletions(-)

diff --git a/drivers/pwm/pwm-imx.c b/drivers/pwm/pwm-imx.c
index 2a0b353..8b7f01e 100644
--- a/drivers/pwm/pwm-imx.c
+++ b/drivers/pwm/pwm-imx.c
@@ -46,81 +46,96 @@ struct imx_chip {
 	void __iomem	*mmio_base;
 
 	struct pwm_chip	chip;
+
+	int (*config)(struct pwm_chip *chip,
+		struct pwm_device *pwm, int duty_ns, int period_ns);
 };
 
 #define to_imx_chip(chip)	container_of(chip, struct imx_chip, chip)
 
-static int imx_pwm_config(struct pwm_chip *chip,
+static int imx_pwm_config_v1(struct pwm_chip *chip,
 		struct pwm_device *pwm, int duty_ns, int period_ns)
 {
 	struct imx_chip *imx = to_imx_chip(chip);
 
-	if (!(cpu_is_mx1() || cpu_is_mx21())) {
-		unsigned long long c;
-		unsigned long period_cycles, duty_cycles, prescale;
-		u32 cr;
-
-		c = clk_get_rate(imx->clk);
-		c = c * period_ns;
-		do_div(c, 1000000000);
-		period_cycles = c;
-
-		prescale = period_cycles / 0x10000 + 1;
-
-		period_cycles /= prescale;
-		c = (unsigned long long)period_cycles * duty_ns;
-		do_div(c, period_ns);
-		duty_cycles = c;
-
-		/*
-		 * according to imx pwm RM, the real period value should be
-		 * PERIOD value in PWMPR plus 2.
-		 */
-		if (period_cycles > 2)
-			period_cycles -= 2;
-		else
-			period_cycles = 0;
-
-		writel(duty_cycles, imx->mmio_base + MX3_PWMSAR);
-		writel(period_cycles, imx->mmio_base + MX3_PWMPR);
-
-		cr = MX3_PWMCR_PRESCALER(prescale) |
-			MX3_PWMCR_DOZEEN | MX3_PWMCR_WAITEN |
-			MX3_PWMCR_DBGEN | 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);
-	} else if (cpu_is_mx1() || cpu_is_mx21()) {
-		/* The PWM subsystem allows for exact frequencies. However,
-		 * I cannot connect a scope on my device to the PWM line and
-		 * thus cannot provide the program the PWM controller
-		 * exactly. Instead, I'm relying on the fact that the
-		 * Bootloader (u-boot or WinCE+haret) has programmed the PWM
-		 * function group already. So I'll just modify the PWM sample
-		 * register to follow the ratio of duty_ns vs. period_ns
-		 * accordingly.
-		 *
-		 * This is good enough for programming the brightness of
-		 * the LCD backlight.
-		 *
-		 * The real implementation would divide PERCLK[0] first by
-		 * both the prescaler (/1 .. /128) and then by CLKSEL
-		 * (/2 .. /16).
-		 */
-		u32 max = readl(imx->mmio_base + MX1_PWMP);
-		u32 p = max * duty_ns / period_ns;
-		writel(max - p, imx->mmio_base + MX1_PWMS);
-	} else {
-		BUG();
-	}
+	/*
+	 * The PWM subsystem allows for exact frequencies. However,
+	 * I cannot connect a scope on my device to the PWM line and
+	 * thus cannot provide the program the PWM controller
+	 * exactly. Instead, I'm relying on the fact that the
+	 * Bootloader (u-boot or WinCE+haret) has programmed the PWM
+	 * function group already. So I'll just modify the PWM sample
+	 * register to follow the ratio of duty_ns vs. period_ns
+	 * accordingly.
+	 *
+	 * This is good enough for programming the brightness of
+	 * the LCD backlight.
+	 *
+	 * The real implementation would divide PERCLK[0] first by
+	 * both the prescaler (/1 .. /128) and then by CLKSEL
+	 * (/2 .. /16).
+	 */
+	u32 max = readl(imx->mmio_base + MX1_PWMP);
+	u32 p = max * duty_ns / period_ns;
+	writel(max - p, imx->mmio_base + MX1_PWMS);
+
+	return 0;
+}
+
+static int imx_pwm_config_v2(struct pwm_chip *chip,
+		struct pwm_device *pwm, int duty_ns, int period_ns)
+{
+	struct imx_chip *imx = to_imx_chip(chip);
+	unsigned long long c;
+	unsigned long period_cycles, duty_cycles, prescale;
+	u32 cr;
+
+	c = clk_get_rate(imx->clk);
+	c = c * period_ns;
+	do_div(c, 1000000000);
+	period_cycles = c;
+
+	prescale = period_cycles / 0x10000 + 1;
+
+	period_cycles /= prescale;
+	c = (unsigned long long)period_cycles * duty_ns;
+	do_div(c, period_ns);
+	duty_cycles = c;
+
+	/*
+	 * according to imx pwm RM, the real period value should be
+	 * PERIOD value in PWMPR plus 2.
+	 */
+	if (period_cycles > 2)
+		period_cycles -= 2;
+	else
+		period_cycles = 0;
+
+	writel(duty_cycles, imx->mmio_base + MX3_PWMSAR);
+	writel(period_cycles, imx->mmio_base + MX3_PWMPR);
+
+	cr = MX3_PWMCR_PRESCALER(prescale) |
+		MX3_PWMCR_DOZEEN | MX3_PWMCR_WAITEN |
+		MX3_PWMCR_DBGEN | 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;
 }
 
+static int imx_pwm_config(struct pwm_chip *chip,
+		struct pwm_device *pwm, int duty_ns, int period_ns)
+{
+	struct imx_chip *imx = to_imx_chip(chip);
+
+	return imx->config(chip, pwm, duty_ns, period_ns);
+}
+
 static int imx_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm)
 {
 	struct imx_chip *imx = to_imx_chip(chip);
@@ -187,6 +202,11 @@ static int __devinit imx_pwm_probe(struct platform_device *pdev)
 	if (imx->mmio_base == NULL)
 		return -EADDRNOTAVAIL;
 
+	if (cpu_is_mx1() || cpu_is_mx21())
+		imx->config = imx_pwm_config_v1;
+	else
+		imx->config = imx_pwm_config_v2;
+
 	ret = pwmchip_add(&imx->chip);
 	if (ret < 0)
 		return ret;
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 2/7] pwm: i.MX: remove unnecessary if in pwm_[en|dis]able
  2012-09-10  8:59 [PATCH v4] pwm: i.MX: add devicetree support Sascha Hauer
  2012-09-10  8:59 ` [PATCH 1/7] pwm: i.MX: factor out SoC specific functions Sascha Hauer
@ 2012-09-10  8:59 ` Sascha Hauer
  2012-09-10  8:59 ` [PATCH 3/7] pwm: i.MX: add functions to enable/disable pwm Sascha Hauer
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 12+ messages in thread
From: Sascha Hauer @ 2012-09-10  8:59 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: HACHIMI Samir, shawn.guo, thierry.reding, linux-kernel,
	Benoît Thébaudeau, kernel, Sascha Hauer

The PWM core makes sure that pwm_enable/disable are called only
once. Still keep the enabled state since we will need it in
pwm_config.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Reviewed-by: Shawn Guo <shawn.guo@linaro.org>
Reviewed-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
---
 drivers/pwm/pwm-imx.c |   25 +++++++++++--------------
 1 file changed, 11 insertions(+), 14 deletions(-)

diff --git a/drivers/pwm/pwm-imx.c b/drivers/pwm/pwm-imx.c
index 8b7f01e..5d426ff 100644
--- a/drivers/pwm/pwm-imx.c
+++ b/drivers/pwm/pwm-imx.c
@@ -42,7 +42,7 @@
 struct imx_chip {
 	struct clk	*clk;
 
-	int		clk_enabled;
+	int		enabled;
 	void __iomem	*mmio_base;
 
 	struct pwm_chip	chip;
@@ -139,14 +139,15 @@ static int imx_pwm_config(struct pwm_chip *chip,
 static int imx_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm)
 {
 	struct imx_chip *imx = to_imx_chip(chip);
-	int rc = 0;
+	int ret;
 
-	if (!imx->clk_enabled) {
-		rc = clk_prepare_enable(imx->clk);
-		if (!rc)
-			imx->clk_enabled = 1;
-	}
-	return rc;
+	ret = clk_prepare_enable(imx->clk);
+	if (ret)
+		return ret;
+
+	imx->enabled = 1;
+
+	return 0;
 }
 
 static void imx_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm)
@@ -155,10 +156,8 @@ static void imx_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm)
 
 	writel(0, imx->mmio_base + MX3_PWMCR);
 
-	if (imx->clk_enabled) {
-		clk_disable_unprepare(imx->clk);
-		imx->clk_enabled = 0;
-	}
+	clk_disable_unprepare(imx->clk);
+	imx->enabled = 0;
 }
 
 static struct pwm_ops imx_pwm_ops = {
@@ -190,8 +189,6 @@ static int __devinit imx_pwm_probe(struct platform_device *pdev)
 	imx->chip.base = -1;
 	imx->chip.npwm = 1;
 
-	imx->clk_enabled = 0;
-
 	r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (r == NULL) {
 		dev_err(&pdev->dev, "no memory resource defined\n");
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 3/7] pwm: i.MX: add functions to enable/disable pwm.
  2012-09-10  8:59 [PATCH v4] pwm: i.MX: add devicetree support Sascha Hauer
  2012-09-10  8:59 ` [PATCH 1/7] pwm: i.MX: factor out SoC specific functions Sascha Hauer
  2012-09-10  8:59 ` [PATCH 2/7] pwm: i.MX: remove unnecessary if in pwm_[en|dis]able Sascha Hauer
@ 2012-09-10  8:59 ` Sascha Hauer
  2012-09-10  8:59 ` [PATCH 4/7] pwm: i.MX: Use module_platform_driver Sascha Hauer
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 12+ messages in thread
From: Sascha Hauer @ 2012-09-10  8:59 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: HACHIMI Samir, shawn.guo, thierry.reding, linux-kernel,
	Benoît Thébaudeau, kernel, Sascha Hauer

We used to enable/disable the PWM only by switching the
clock on or off. Instead, use the dedicated register bits.
These differ on different SoCs, so introduce a SoC specific
function for this.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Reviewed-by: Shawn Guo <shawn.guo@linaro.org>
Reviewed-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
---
 drivers/pwm/pwm-imx.c |   48 ++++++++++++++++++++++++++++++++++++++++++++----
 1 file changed, 44 insertions(+), 4 deletions(-)

diff --git a/drivers/pwm/pwm-imx.c b/drivers/pwm/pwm-imx.c
index 5d426ff..13d4d22 100644
--- a/drivers/pwm/pwm-imx.c
+++ b/drivers/pwm/pwm-imx.c
@@ -25,6 +25,7 @@
 #define MX1_PWMS    0x04   /* PWM Sample Register */
 #define MX1_PWMP    0x08   /* PWM Period Register */
 
+#define MX1_PWMC_EN		(1 << 4)
 
 /* i.MX27, i.MX31, i.MX35 share the same PWM function block: */
 
@@ -49,6 +50,7 @@ struct imx_chip {
 
 	int (*config)(struct pwm_chip *chip,
 		struct pwm_device *pwm, int duty_ns, int period_ns);
+	void (*set_enable)(struct pwm_chip *chip, bool enable);
 };
 
 #define to_imx_chip(chip)	container_of(chip, struct imx_chip, chip)
@@ -82,6 +84,21 @@ static int imx_pwm_config_v1(struct pwm_chip *chip,
 	return 0;
 }
 
+static void imx_pwm_set_enable_v1(struct pwm_chip *chip, bool enable)
+{
+	struct imx_chip *imx = to_imx_chip(chip);
+	u32 val;
+
+	val = readl(imx->mmio_base + MX1_PWMC);
+
+	if (enable)
+		val |= MX1_PWMC_EN;
+	else
+		val &= ~MX1_PWMC_EN;
+
+	writel(val, imx->mmio_base + MX1_PWMC);
+}
+
 static int imx_pwm_config_v2(struct pwm_chip *chip,
 		struct pwm_device *pwm, int duty_ns, int period_ns)
 {
@@ -116,7 +133,10 @@ 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_EN;
+		MX3_PWMCR_DBGEN;
+
+	if (imx->enabled)
+		cr |= MX3_PWMCR_EN;
 
 	if (cpu_is_mx25())
 		cr |= MX3_PWMCR_CLKSRC_IPG;
@@ -128,6 +148,21 @@ static int imx_pwm_config_v2(struct pwm_chip *chip,
 	return 0;
 }
 
+static void imx_pwm_set_enable_v2(struct pwm_chip *chip, bool enable)
+{
+	struct imx_chip *imx = to_imx_chip(chip);
+	u32 val;
+
+	val = readl(imx->mmio_base + MX3_PWMCR);
+
+	if (enable)
+		val |= MX3_PWMCR_EN;
+	else
+		val &= ~MX3_PWMCR_EN;
+
+	writel(val, imx->mmio_base + MX3_PWMCR);
+}
+
 static int imx_pwm_config(struct pwm_chip *chip,
 		struct pwm_device *pwm, int duty_ns, int period_ns)
 {
@@ -145,6 +180,8 @@ static int imx_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm)
 	if (ret)
 		return ret;
 
+	imx->set_enable(chip, true);
+
 	imx->enabled = 1;
 
 	return 0;
@@ -154,7 +191,7 @@ static void imx_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm)
 {
 	struct imx_chip *imx = to_imx_chip(chip);
 
-	writel(0, imx->mmio_base + MX3_PWMCR);
+	imx->set_enable(chip, false);
 
 	clk_disable_unprepare(imx->clk);
 	imx->enabled = 0;
@@ -199,10 +236,13 @@ static int __devinit imx_pwm_probe(struct platform_device *pdev)
 	if (imx->mmio_base == NULL)
 		return -EADDRNOTAVAIL;
 
-	if (cpu_is_mx1() || cpu_is_mx21())
+	if (cpu_is_mx1() || cpu_is_mx21()) {
 		imx->config = imx_pwm_config_v1;
-	else
+		imx->set_enable = imx_pwm_set_enable_v1;
+	} else {
 		imx->config = imx_pwm_config_v2;
+		imx->set_enable = imx_pwm_set_enable_v2;
+	}
 
 	ret = pwmchip_add(&imx->chip);
 	if (ret < 0)
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 4/7] pwm: i.MX: Use module_platform_driver
  2012-09-10  8:59 [PATCH v4] pwm: i.MX: add devicetree support Sascha Hauer
                   ` (2 preceding siblings ...)
  2012-09-10  8:59 ` [PATCH 3/7] pwm: i.MX: add functions to enable/disable pwm Sascha Hauer
@ 2012-09-10  8:59 ` Sascha Hauer
  2012-09-10  8:59 ` [PATCH 5/7] pwm: i.MX: add devicetree support Sascha Hauer
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 12+ messages in thread
From: Sascha Hauer @ 2012-09-10  8:59 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: HACHIMI Samir, shawn.guo, thierry.reding, linux-kernel,
	Benoît Thébaudeau, kernel, Sascha Hauer

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Reviewed-by: Shawn Guo <shawn.guo@linaro.org>
Reviewed-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
---
 drivers/pwm/pwm-imx.c |   12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/drivers/pwm/pwm-imx.c b/drivers/pwm/pwm-imx.c
index 13d4d22..a1e799e 100644
--- a/drivers/pwm/pwm-imx.c
+++ b/drivers/pwm/pwm-imx.c
@@ -271,17 +271,7 @@ static struct platform_driver imx_pwm_driver = {
 	.remove		= __devexit_p(imx_pwm_remove),
 };
 
-static int __init imx_pwm_init(void)
-{
-	return platform_driver_register(&imx_pwm_driver);
-}
-arch_initcall(imx_pwm_init);
-
-static void __exit imx_pwm_exit(void)
-{
-	platform_driver_unregister(&imx_pwm_driver);
-}
-module_exit(imx_pwm_exit);
+module_platform_driver(imx_pwm_driver);
 
 MODULE_LICENSE("GPL v2");
 MODULE_AUTHOR("Sascha Hauer <s.hauer@pengutronix.de>");
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 5/7] pwm: i.MX: add devicetree support
  2012-09-10  8:59 [PATCH v4] pwm: i.MX: add devicetree support Sascha Hauer
                   ` (3 preceding siblings ...)
  2012-09-10  8:59 ` [PATCH 4/7] pwm: i.MX: Use module_platform_driver Sascha Hauer
@ 2012-09-10  8:59 ` Sascha Hauer
  2012-09-11 14:40   ` Thierry Reding
  2012-09-10  8:59 ` [PATCH 6/7] pwm: i.MX: use per clock unconditionally Sascha Hauer
  2012-09-10  8:59 ` [PATCH 7/7] pwm: i.MX: fix clock lookup Sascha Hauer
  6 siblings, 1 reply; 12+ messages in thread
From: Sascha Hauer @ 2012-09-10  8:59 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: HACHIMI Samir, shawn.guo, thierry.reding, linux-kernel,
	Benoît Thébaudeau, kernel, Philipp Zabel, Sascha Hauer

From: Philipp Zabel <p.zabel@pengutronix.de>

At the same time remove platform based support. No user for
this driver has made it into mainline so far, so all we break
is out of tree stuff.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Reviewed-by: Shawn Guo <shawn.guo@linaro.org>
Reviewed-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
---
 Documentation/devicetree/bindings/pwm/imx-pwm.txt |   17 ++++++++
 drivers/pwm/pwm-imx.c                             |   45 ++++++++++++++++-----
 2 files changed, 52 insertions(+), 10 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/pwm/imx-pwm.txt

diff --git a/Documentation/devicetree/bindings/pwm/imx-pwm.txt b/Documentation/devicetree/bindings/pwm/imx-pwm.txt
new file mode 100644
index 0000000..9b9b185
--- /dev/null
+++ b/Documentation/devicetree/bindings/pwm/imx-pwm.txt
@@ -0,0 +1,17 @@
+Freescale i.MX PWM controller
+
+Required properties:
+- compatible: should be "fsl,<soc>-pwm"
+- reg: physical base address and length of the controller's registers
+- #pwm-cells: should be 2.  The first cell specifies the per-chip index
+  of the PWM to use and the second cell is the duty cycle in nanoseconds.
+- interrupts: The interrupt for the pwm controller
+
+Example:
+
+pwm1: pwm@53fb4000 {
+	#pwm-cells = <2>;
+	compatible = "fsl,imx53-pwm", "fsl,imx27-pwm";
+	reg = <0x53fb4000 0x4000>;
+	interrupts = <61>;
+};
diff --git a/drivers/pwm/pwm-imx.c b/drivers/pwm/pwm-imx.c
index a1e799e..b4e0ad3 100644
--- a/drivers/pwm/pwm-imx.c
+++ b/drivers/pwm/pwm-imx.c
@@ -16,8 +16,7 @@
 #include <linux/clk.h>
 #include <linux/io.h>
 #include <linux/pwm.h>
-#include <mach/hardware.h>
-
+#include <linux/of_device.h>
 
 /* i.MX1 and i.MX21 share the same PWM function block: */
 
@@ -204,12 +203,41 @@ static struct pwm_ops imx_pwm_ops = {
 	.owner = THIS_MODULE,
 };
 
+struct imx_pwm_data {
+	int (*config)(struct pwm_chip *chip,
+		struct pwm_device *pwm, int duty_ns, int period_ns);
+	void (*set_enable)(struct pwm_chip *chip, bool enable);
+};
+
+static struct imx_pwm_data imx_pwm_data_v1 = {
+	.config = imx_pwm_config_v1,
+	.set_enable = imx_pwm_set_enable_v1,
+};
+
+static struct imx_pwm_data imx_pwm_data_v2 = {
+	.config = imx_pwm_config_v2,
+	.set_enable = imx_pwm_set_enable_v2,
+};
+
+static const struct of_device_id imx_pwm_dt_ids[] = {
+	{ .compatible = "fsl,imx1-pwm", .data = &imx_pwm_data_v1, },
+	{ .compatible = "fsl,imx27-pwm", .data = &imx_pwm_data_v2, },
+	{ /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, imx_pwm_dt_ids);
+
 static int __devinit imx_pwm_probe(struct platform_device *pdev)
 {
+	const struct of_device_id *of_id =
+			of_match_device(imx_pwm_dt_ids, &pdev->dev);
+	struct imx_pwm_data *data;
 	struct imx_chip *imx;
 	struct resource *r;
 	int ret = 0;
 
+	if (!of_id)
+		return -ENODEV;
+
 	imx = devm_kzalloc(&pdev->dev, sizeof(*imx), GFP_KERNEL);
 	if (imx == NULL) {
 		dev_err(&pdev->dev, "failed to allocate memory\n");
@@ -236,13 +264,9 @@ static int __devinit imx_pwm_probe(struct platform_device *pdev)
 	if (imx->mmio_base == NULL)
 		return -EADDRNOTAVAIL;
 
-	if (cpu_is_mx1() || cpu_is_mx21()) {
-		imx->config = imx_pwm_config_v1;
-		imx->set_enable = imx_pwm_set_enable_v1;
-	} else {
-		imx->config = imx_pwm_config_v2;
-		imx->set_enable = imx_pwm_set_enable_v2;
-	}
+	data = of_id->data;
+	imx->config = data->config;
+	imx->set_enable = data->set_enable;
 
 	ret = pwmchip_add(&imx->chip);
 	if (ret < 0)
@@ -265,7 +289,8 @@ static int __devexit imx_pwm_remove(struct platform_device *pdev)
 
 static struct platform_driver imx_pwm_driver = {
 	.driver		= {
-		.name	= "mxc_pwm",
+		.name	= "imx-pwm",
+		.of_match_table = of_match_ptr(imx_pwm_dt_ids),
 	},
 	.probe		= imx_pwm_probe,
 	.remove		= __devexit_p(imx_pwm_remove),
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 6/7] pwm: i.MX: use per clock unconditionally
  2012-09-10  8:59 [PATCH v4] pwm: i.MX: add devicetree support Sascha Hauer
                   ` (4 preceding siblings ...)
  2012-09-10  8:59 ` [PATCH 5/7] pwm: i.MX: add devicetree support Sascha Hauer
@ 2012-09-10  8:59 ` Sascha Hauer
  2012-09-10  8:59 ` [PATCH 7/7] pwm: i.MX: fix clock lookup Sascha Hauer
  6 siblings, 0 replies; 12+ messages in thread
From: Sascha Hauer @ 2012-09-10  8:59 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: HACHIMI Samir, shawn.guo, thierry.reding, linux-kernel,
	Benoît Thébaudeau, kernel, Sascha Hauer

The i.MX PWM module 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>
Reviewed-by: Shawn Guo <shawn.guo@linaro.org>
Reviewed-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
---
 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 b4e0ad3..852de6c 100644
--- a/drivers/pwm/pwm-imx.c
+++ b/drivers/pwm/pwm-imx.c
@@ -132,16 +132,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


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 7/7] pwm: i.MX: fix clock lookup
  2012-09-10  8:59 [PATCH v4] pwm: i.MX: add devicetree support Sascha Hauer
                   ` (5 preceding siblings ...)
  2012-09-10  8:59 ` [PATCH 6/7] pwm: i.MX: use per clock unconditionally Sascha Hauer
@ 2012-09-10  8:59 ` Sascha Hauer
  6 siblings, 0 replies; 12+ messages in thread
From: Sascha Hauer @ 2012-09-10  8:59 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: HACHIMI Samir, shawn.guo, thierry.reding, linux-kernel,
	Benoît Thébaudeau, kernel, Philipp Zabel, Sascha Hauer

From: Philipp Zabel <p.zabel@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.
This patch requests both clocks and enables the ipg clock for accessing
registers and the peripheral clock to actually turn on the PWM.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Reviewed-by: Shawn Guo <shawn.guo@linaro.org>
Reviewed-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
---
 drivers/pwm/pwm-imx.c |   35 +++++++++++++++++++++++++++--------
 1 file changed, 27 insertions(+), 8 deletions(-)

diff --git a/drivers/pwm/pwm-imx.c b/drivers/pwm/pwm-imx.c
index 852de6c..8a5d3ae 100644
--- a/drivers/pwm/pwm-imx.c
+++ b/drivers/pwm/pwm-imx.c
@@ -40,7 +40,8 @@
 #define MX3_PWMCR_EN              (1 << 0)
 
 struct imx_chip {
-	struct clk	*clk;
+	struct clk	*clk_per;
+	struct clk	*clk_ipg;
 
 	int		enabled;
 	void __iomem	*mmio_base;
@@ -106,7 +107,7 @@ static int imx_pwm_config_v2(struct pwm_chip *chip,
 	unsigned long period_cycles, duty_cycles, prescale;
 	u32 cr;
 
-	c = clk_get_rate(imx->clk);
+	c = clk_get_rate(imx->clk_per);
 	c = c * period_ns;
 	do_div(c, 1000000000);
 	period_cycles = c;
@@ -161,8 +162,17 @@ static int imx_pwm_config(struct pwm_chip *chip,
 		struct pwm_device *pwm, int duty_ns, int period_ns)
 {
 	struct imx_chip *imx = to_imx_chip(chip);
+	int ret;
+
+	ret = clk_prepare_enable(imx->clk_ipg);
+	if (ret)
+		return ret;
 
-	return imx->config(chip, pwm, duty_ns, period_ns);
+	ret = imx->config(chip, pwm, duty_ns, period_ns);
+
+	clk_disable_unprepare(imx->clk_ipg);
+
+	return ret;
 }
 
 static int imx_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm)
@@ -170,7 +180,7 @@ static int imx_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm)
 	struct imx_chip *imx = to_imx_chip(chip);
 	int ret;
 
-	ret = clk_prepare_enable(imx->clk);
+	ret = clk_prepare_enable(imx->clk_per);
 	if (ret)
 		return ret;
 
@@ -187,7 +197,7 @@ static void imx_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm)
 
 	imx->set_enable(chip, false);
 
-	clk_disable_unprepare(imx->clk);
+	clk_disable_unprepare(imx->clk_per);
 	imx->enabled = 0;
 }
 
@@ -239,10 +249,19 @@ static int __devinit imx_pwm_probe(struct platform_device *pdev)
 		return -ENOMEM;
 	}
 
-	imx->clk = devm_clk_get(&pdev->dev, "pwm");
+	imx->clk_per = devm_clk_get(&pdev->dev, "per");
+	if (IS_ERR(imx->clk_per)) {
+		dev_err(&pdev->dev, "getting per clock failed with %ld\n",
+				PTR_ERR(imx->clk_per));
+		return PTR_ERR(imx->clk_per);
+	}
 
-	if (IS_ERR(imx->clk))
-		return PTR_ERR(imx->clk);
+	imx->clk_ipg = devm_clk_get(&pdev->dev, "ipg");
+	if (IS_ERR(imx->clk_ipg)) {
+		dev_err(&pdev->dev, "getting ipg clock failed with %ld\n",
+				PTR_ERR(imx->clk_ipg));
+		return PTR_ERR(imx->clk_ipg);
+	}
 
 	imx->chip.ops = &imx_pwm_ops;
 	imx->chip.dev = &pdev->dev;
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH 5/7] pwm: i.MX: add devicetree support
  2012-09-10  8:59 ` [PATCH 5/7] pwm: i.MX: add devicetree support Sascha Hauer
@ 2012-09-11 14:40   ` Thierry Reding
  2012-09-12  9:04     ` Sascha Hauer
  0 siblings, 1 reply; 12+ messages in thread
From: Thierry Reding @ 2012-09-11 14:40 UTC (permalink / raw)
  To: Sascha Hauer
  Cc: linux-arm-kernel, HACHIMI Samir, shawn.guo, linux-kernel,
	Benoît Thébaudeau, kernel, Philipp Zabel

[-- Attachment #1: Type: text/plain, Size: 1420 bytes --]

On Mon, Sep 10, 2012 at 10:59:35AM +0200, Sascha Hauer wrote:
> From: Philipp Zabel <p.zabel@pengutronix.de>
> 
> At the same time remove platform based support. No user for
> this driver has made it into mainline so far, so all we break
> is out of tree stuff.
> 
> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> Reviewed-by: Shawn Guo <shawn.guo@linaro.org>
> Reviewed-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
[...]

I was just doing some build tests on the series and noticed that it
fails with this:

	  CC [M]  drivers/pwm/pwm-imx.o
	/home/thierry.reding/src/kernel/linux-pwm.git/drivers/pwm/pwm-imx.c: In function 'imx_pwm_config_v2':
	/home/thierry.reding/src/kernel/linux-pwm.git/drivers/pwm/pwm-imx.c:140:2: error: implicit declaration of function 'cpu_is_mx25' [-Werror=implicit-function-declaration]

This breaks bisection in the middle of the series. It seems to be
related to this change.

> diff --git a/drivers/pwm/pwm-imx.c b/drivers/pwm/pwm-imx.c
> index a1e799e..b4e0ad3 100644
> --- a/drivers/pwm/pwm-imx.c
> +++ b/drivers/pwm/pwm-imx.c
> @@ -16,8 +16,7 @@
>  #include <linux/clk.h>
>  #include <linux/io.h>
>  #include <linux/pwm.h>
> -#include <mach/hardware.h>

This probably needs to be postponed to the next patch, until the final
reference to cpu_is_mx25() is removed.

Thierry

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 5/7] pwm: i.MX: add devicetree support
  2012-09-11 14:40   ` Thierry Reding
@ 2012-09-12  9:04     ` Sascha Hauer
  2012-09-18  6:11       ` Thierry Reding
  0 siblings, 1 reply; 12+ messages in thread
From: Sascha Hauer @ 2012-09-12  9:04 UTC (permalink / raw)
  To: Thierry Reding
  Cc: linux-arm-kernel, HACHIMI Samir, shawn.guo, linux-kernel,
	Benoît Thébaudeau, kernel, Philipp Zabel

On Tue, Sep 11, 2012 at 04:40:43PM +0200, Thierry Reding wrote:
> On Mon, Sep 10, 2012 at 10:59:35AM +0200, Sascha Hauer wrote:
> > From: Philipp Zabel <p.zabel@pengutronix.de>
> > 
> > At the same time remove platform based support. No user for
> > this driver has made it into mainline so far, so all we break
> > is out of tree stuff.
> > 
> > Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
> > Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> > Reviewed-by: Shawn Guo <shawn.guo@linaro.org>
> > Reviewed-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
> [...]
> 
> I was just doing some build tests on the series and noticed that it
> fails with this:
> 
> 	  CC [M]  drivers/pwm/pwm-imx.o
> 	/home/thierry.reding/src/kernel/linux-pwm.git/drivers/pwm/pwm-imx.c: In function 'imx_pwm_config_v2':
> 	/home/thierry.reding/src/kernel/linux-pwm.git/drivers/pwm/pwm-imx.c:140:2: error: implicit declaration of function 'cpu_is_mx25' [-Werror=implicit-function-declaration]
> 
> This breaks bisection in the middle of the series. It seems to be
> related to this change.
> 
> > diff --git a/drivers/pwm/pwm-imx.c b/drivers/pwm/pwm-imx.c
> > index a1e799e..b4e0ad3 100644
> > --- a/drivers/pwm/pwm-imx.c
> > +++ b/drivers/pwm/pwm-imx.c
> > @@ -16,8 +16,7 @@
> >  #include <linux/clk.h>
> >  #include <linux/io.h>
> >  #include <linux/pwm.h>
> > -#include <mach/hardware.h>
> 
> This probably needs to be postponed to the next patch, until the final
> reference to cpu_is_mx25() is removed.

Oops, you are right. I updated the tag accordingly, and did a full
compile test over this series, so please pull again:


The following changes since commit fea7a08acb13524b47711625eebea40a0ede69a0:

  Linux 3.6-rc3 (2012-08-22 13:29:06 -0700)

are available in the git repository at:

  git://git.pengutronix.de/git/imx/linux-2.6.git tags/imx-pwm-oftree

for you to fetch changes up to a1d38ca9e249e670aa9f608e1cc7491fb4ca45af:

  pwm: i.MX: fix clock lookup (2012-09-12 11:00:55 +0200)

----------------------------------------------------------------
Cleanup i.MX PWM driver and add devicetree support

----------------------------------------------------------------
Philipp Zabel (2):
      pwm: i.MX: add devicetree support
      pwm: i.MX: fix clock lookup

Sascha Hauer (5):
      pwm: i.MX: factor out SoC specific functions
      pwm: i.MX: remove unnecessary if in pwm_[en|dis]able
      pwm: i.MX: add functions to enable/disable pwm.
      pwm: i.MX: Use module_platform_driver
      pwm: i.MX: use per clock unconditionally

 Documentation/devicetree/bindings/pwm/imx-pwm.txt |   17 ++
 drivers/pwm/pwm-imx.c                             |  278 ++++++++++++++-------
 2 files changed, 199 insertions(+), 96 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/pwm/imx-pwm.txt

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 5/7] pwm: i.MX: add devicetree support
  2012-09-12  9:04     ` Sascha Hauer
@ 2012-09-18  6:11       ` Thierry Reding
  2012-09-18  7:57         ` Sascha Hauer
  0 siblings, 1 reply; 12+ messages in thread
From: Thierry Reding @ 2012-09-18  6:11 UTC (permalink / raw)
  To: Sascha Hauer
  Cc: linux-arm-kernel, HACHIMI Samir, shawn.guo, linux-kernel,
	Benoît Thébaudeau, kernel, Philipp Zabel

[-- Attachment #1: Type: text/plain, Size: 3393 bytes --]

On Wed, Sep 12, 2012 at 11:04:58AM +0200, Sascha Hauer wrote:
> On Tue, Sep 11, 2012 at 04:40:43PM +0200, Thierry Reding wrote:
> > On Mon, Sep 10, 2012 at 10:59:35AM +0200, Sascha Hauer wrote:
> > > From: Philipp Zabel <p.zabel@pengutronix.de>
> > > 
> > > At the same time remove platform based support. No user for
> > > this driver has made it into mainline so far, so all we break
> > > is out of tree stuff.
> > > 
> > > Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
> > > Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> > > Reviewed-by: Shawn Guo <shawn.guo@linaro.org>
> > > Reviewed-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
> > [...]
> > 
> > I was just doing some build tests on the series and noticed that it
> > fails with this:
> > 
> > 	  CC [M]  drivers/pwm/pwm-imx.o
> > 	/home/thierry.reding/src/kernel/linux-pwm.git/drivers/pwm/pwm-imx.c: In function 'imx_pwm_config_v2':
> > 	/home/thierry.reding/src/kernel/linux-pwm.git/drivers/pwm/pwm-imx.c:140:2: error: implicit declaration of function 'cpu_is_mx25' [-Werror=implicit-function-declaration]
> > 
> > This breaks bisection in the middle of the series. It seems to be
> > related to this change.
> > 
> > > diff --git a/drivers/pwm/pwm-imx.c b/drivers/pwm/pwm-imx.c
> > > index a1e799e..b4e0ad3 100644
> > > --- a/drivers/pwm/pwm-imx.c
> > > +++ b/drivers/pwm/pwm-imx.c
> > > @@ -16,8 +16,7 @@
> > >  #include <linux/clk.h>
> > >  #include <linux/io.h>
> > >  #include <linux/pwm.h>
> > > -#include <mach/hardware.h>
> > 
> > This probably needs to be postponed to the next patch, until the final
> > reference to cpu_is_mx25() is removed.
> 
> Oops, you are right. I updated the tag accordingly, and did a full
> compile test over this series, so please pull again:
> 
> 
> The following changes since commit fea7a08acb13524b47711625eebea40a0ede69a0:
> 
>   Linux 3.6-rc3 (2012-08-22 13:29:06 -0700)
> 
> are available in the git repository at:
> 
>   git://git.pengutronix.de/git/imx/linux-2.6.git tags/imx-pwm-oftree
> 
> for you to fetch changes up to a1d38ca9e249e670aa9f608e1cc7491fb4ca45af:
> 
>   pwm: i.MX: fix clock lookup (2012-09-12 11:00:55 +0200)
> 
> ----------------------------------------------------------------
> Cleanup i.MX PWM driver and add devicetree support
> 
> ----------------------------------------------------------------
> Philipp Zabel (2):
>       pwm: i.MX: add devicetree support
>       pwm: i.MX: fix clock lookup
> 
> Sascha Hauer (5):
>       pwm: i.MX: factor out SoC specific functions
>       pwm: i.MX: remove unnecessary if in pwm_[en|dis]able
>       pwm: i.MX: add functions to enable/disable pwm.
>       pwm: i.MX: Use module_platform_driver
>       pwm: i.MX: use per clock unconditionally
> 
>  Documentation/devicetree/bindings/pwm/imx-pwm.txt |   17 ++
>  drivers/pwm/pwm-imx.c                             |  278 ++++++++++++++-------
>  2 files changed, 199 insertions(+), 96 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/pwm/imx-pwm.txt

Applied, thanks. On a side note, I decided to pull the branch, extract
the patches and apply them to my tree with git am, so this won't show up
as a proper merge. This is all still pretty new to me and I'm still in
the process of finding out what works best, so I hope you don't mind.

Thierry

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 5/7] pwm: i.MX: add devicetree support
  2012-09-18  6:11       ` Thierry Reding
@ 2012-09-18  7:57         ` Sascha Hauer
  0 siblings, 0 replies; 12+ messages in thread
From: Sascha Hauer @ 2012-09-18  7:57 UTC (permalink / raw)
  To: Thierry Reding
  Cc: linux-arm-kernel, HACHIMI Samir, shawn.guo, linux-kernel,
	Benoît Thébaudeau, kernel, Philipp Zabel

On Tue, Sep 18, 2012 at 08:11:55AM +0200, Thierry Reding wrote:
> On Wed, Sep 12, 2012 at 11:04:58AM +0200, Sascha Hauer wrote:
> > 
> > 
> > The following changes since commit fea7a08acb13524b47711625eebea40a0ede69a0:
> > 
> >   Linux 3.6-rc3 (2012-08-22 13:29:06 -0700)
> > 
> > are available in the git repository at:
> > 
> >   git://git.pengutronix.de/git/imx/linux-2.6.git tags/imx-pwm-oftree
> > 
> > for you to fetch changes up to a1d38ca9e249e670aa9f608e1cc7491fb4ca45af:
> > 
> >   pwm: i.MX: fix clock lookup (2012-09-12 11:00:55 +0200)
> > 
> > ----------------------------------------------------------------
> > Cleanup i.MX PWM driver and add devicetree support
> > 
> > ----------------------------------------------------------------
> > Philipp Zabel (2):
> >       pwm: i.MX: add devicetree support
> >       pwm: i.MX: fix clock lookup
> > 
> > Sascha Hauer (5):
> >       pwm: i.MX: factor out SoC specific functions
> >       pwm: i.MX: remove unnecessary if in pwm_[en|dis]able
> >       pwm: i.MX: add functions to enable/disable pwm.
> >       pwm: i.MX: Use module_platform_driver
> >       pwm: i.MX: use per clock unconditionally
> > 
> >  Documentation/devicetree/bindings/pwm/imx-pwm.txt |   17 ++
> >  drivers/pwm/pwm-imx.c                             |  278 ++++++++++++++-------
> >  2 files changed, 199 insertions(+), 96 deletions(-)
> >  create mode 100644 Documentation/devicetree/bindings/pwm/imx-pwm.txt
> 
> Applied, thanks. On a side note, I decided to pull the branch, extract
> the patches and apply them to my tree with git am, so this won't show up
> as a proper merge. This is all still pretty new to me and I'm still in
> the process of finding out what works best, so I hope you don't mind.

Thanks Thierry. I don't mind at all.

Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2012-09-18  7:57 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-10  8:59 [PATCH v4] pwm: i.MX: add devicetree support Sascha Hauer
2012-09-10  8:59 ` [PATCH 1/7] pwm: i.MX: factor out SoC specific functions Sascha Hauer
2012-09-10  8:59 ` [PATCH 2/7] pwm: i.MX: remove unnecessary if in pwm_[en|dis]able Sascha Hauer
2012-09-10  8:59 ` [PATCH 3/7] pwm: i.MX: add functions to enable/disable pwm Sascha Hauer
2012-09-10  8:59 ` [PATCH 4/7] pwm: i.MX: Use module_platform_driver Sascha Hauer
2012-09-10  8:59 ` [PATCH 5/7] pwm: i.MX: add devicetree support Sascha Hauer
2012-09-11 14:40   ` Thierry Reding
2012-09-12  9:04     ` Sascha Hauer
2012-09-18  6:11       ` Thierry Reding
2012-09-18  7:57         ` Sascha Hauer
2012-09-10  8:59 ` [PATCH 6/7] pwm: i.MX: use per clock unconditionally Sascha Hauer
2012-09-10  8:59 ` [PATCH 7/7] pwm: i.MX: fix clock lookup Sascha Hauer

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).