Skip to contentSkip to conversation

Add drivers/pwm and drivers/pwm/st_pwm.c

PATCH In review Viresh Kumar 5 participants 14 messages May 31, 2011 – Jun 29, 2011

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

v2 cover Add drivers/pwm and drivers/pwm/st_pwm.c

This patchset adds drivers/pwm directory as suggested by Arnd Bergmann in following discussion:

http://comments.gmane.org/gmane.linux.ports.arm.kernel/118651

and also adds support for ST Microelectronics Pulse Width Modulator. This is currently used by ST's SPEAr platform and tested on the same.

Changes since V1:
- Moved driver to drivers/pwm/ directory from drivers/misc
- arch/arm/configs/spear3xx_defconfig updated accordingly.

Changes since earlier patchset:
- Moved driver to drivers/misc/ directory.

It was earlier reviewed as part of following patchset:
"[PATCH V6 00/17] Adding devices support for all spear machines"

Viresh Kumar (3):
drivers/pwm st_pwm: Add support for ST's Pulse Width Modulator
SPEAr3xx: Add machine support for ST's PWM IP
SPEAr3xx: Update defconfig for ST's PWM

 MAINTAINERS                                   |    5 +
 arch/arm/configs/spear3xx_defconfig           |    2 +
 arch/arm/mach-spear3xx/include/mach/generic.h |    1 +
 arch/arm/mach-spear3xx/spear320.c             |   16 +
 arch/arm/mach-spear3xx/spear320_evb.c         |    1 +
 drivers/Kconfig                               |    1 +
 drivers/Makefile                              |    1 +
 drivers/pwm/Kconfig                           |   22 ++
 drivers/pwm/Makefile                          |    5 +
 drivers/pwm/st_pwm.c                          |  486 +++++++++++++++++++++++++
 10 files changed, 540 insertions(+), 0 deletions(-)
 create mode 100644 drivers/pwm/Kconfig
 create mode 100644 drivers/pwm/Makefile
 create mode 100644 drivers/pwm/st_pwm.c
Signature · 1 line
1.7.2.2
#1 lore raw

PATCH v2 1/3 drivers/pwm st_pwm: Add support for ST's Pulse Width Modulator

This patch adds support for ST Microelectronics Pulse Width Modulator. This is currently used by ST's SPEAr platform and tested on the same.

This patch also adds drivers/pwm directory as suggested by Arnd Bergmann in following discussion:

http://comments.gmane.org/gmane.linux.ports.arm.kernel/118651

---
 MAINTAINERS          |    5 +
 drivers/Kconfig      |    1 +
 drivers/Makefile     |    1 +
 drivers/pwm/Kconfig  |   22 +++
 drivers/pwm/Makefile |    5 +
 drivers/pwm/st_pwm.c |  486 ++++++++++++++++++++++++++++++++++++++++++++++++++
 6 files changed, 520 insertions(+), 0 deletions(-)
 create mode 100644 drivers/pwm/Kconfig
 create mode 100644 drivers/pwm/Makefile
 create mode 100644 drivers/pwm/st_pwm.c
MAINTAINERS +5 -0
index 48b0a4f..4e8ffa4 100644
@@ -6031,6 +6031,11 @@ M:	Jan-Benedict Glaw <[email protected]>
 S:	Maintained
 F:	arch/alpha/kernel/srm_env.c
 
+ST Microelectronics Pulse Width Modulator Support
+M:	Viresh Kumar <[email protected]>
+S:	Maintained
+F:	drivers/pwm/st_pwm.c
+
 STABLE BRANCH
 M:	Greg Kroah-Hartman <[email protected]>
 L:	[email protected]
drivers/Kconfig +1 -0
index 3bb154d..4d3bb12 100644
@@ -126,4 +126,5 @@ source "drivers/hwspinlock/Kconfig"
 
 source "drivers/clocksource/Kconfig"
 
+source "drivers/pwm/Kconfig"
 endmenu
drivers/Makefile +1 -0
index 09f3232..c321763 100644
@@ -6,6 +6,7 @@
 #
 
 obj-y				+= gpio/
+obj-y				+= pwm/
 obj-$(CONFIG_PCI)		+= pci/
 obj-$(CONFIG_PARISC)		+= parisc/
 obj-$(CONFIG_RAPIDIO)		+= rapidio/
drivers/pwm/Kconfig new file +22 -0
new file mode 100644
index 0000000..85fd25c
@@ -0,0 +1,22 @@
+#
+# Pulse Width Modulator (PWM) devices
+#
+
+menuconfig PWMLIB
+	bool "PWM Support"
+	help
+	  This enables PWM support for kernel. You only need to enable this, if
+	  you also want to enable one or more of the PWM drivers below.
+
+	  If unsure, say N.
+
+if PWMLIB
+
+config ST_PWM
+	tristate "ST Microelectronics Pulse Width Modulator"
+	default n
+	help
+	  Support for ST Microelectronics Pulse Width Modulator. Currently it is
+	  present and tested on SPEAr Platform only.
+
+endif # PWMLIB
drivers/pwm/Makefile new file +5 -0
new file mode 100644
index 0000000..7c3b338
@@ -0,0 +1,5 @@
+#
+# Makefile for PWM devices
+#
+
+obj-$(CONFIG_ST_PWM)		+= st_pwm.o
drivers/pwm/st_pwm.c new file +486 -0

486 lines not on this page · raw message

Signature · 1 line
1.7.2.2
#2 lore raw

Re: [PATCH V2 1/3] drivers/pwm st_pwm: Add support for ST's Pulse Width Modulator

Quoted 11 lines · On Tue, 31 May 2011 14:21:51 +0530 Viresh Kumar <[email protected]> wrote:

This patch adds support for ST Microelectronics Pulse Width Modulator. This is currently used by ST's SPEAr platform and tested on the same.

This patch also adds drivers/pwm directory as suggested by Arnd Bergmann in following discussion:

http://comments.gmane.org/gmane.linux.ports.arm.kernel/118651

...

Quoted 9 lines

+/**
+ * struct pwm_device: struct representing pwm device/channel
+ *
+ * pwmd_id: id of pwm device
+ * pwm: pointer to parent pwm ip
+ * label: used for storing label passed in pwm_request
+ * offset: base address offset from parent pwm mmio_base
+ * busy: represents usage status of a pwm device
+ * lock: lock specific to a pwm device

More specificity here would be helpful. Precisely which data does the lock protect?

Quoted 14 lines

+ * node: node for adding device to parent pwm's devices list
+ *
+ * Each pwm IP contains four independent pwm device/channels. Some or all of
+ * which may be present in our configuration.
+ */

drivers/pwm/st_pwm.c new file +9 -0
+struct pwm_device {
+	unsigned pwmd_id;
+	struct pwm *pwm;
+	const char *label;
+	unsigned offset;
+	unsigned busy;
+	spinlock_t lock;
+	struct list_head node;
+};

drivers/pwm/st_pwm.c line 82

Quoted 10 lines
drivers/pwm/st_pwm.c new file +10 -0
+
+/**
+ * struct pwm: struct representing pwm ip
+ *
+ * id: id of pwm ip
+ * mmio_base: base address of pwm
+ * clk: pointer to clk structure of pwm ip
+ * clk_enabled: clock enable status
+ * pdev: pointer to pdev structure of pwm
+ * lock: lock specific to current pwm ip

Ditto.

Quoted 55 lines

+ * devices: list of devices/childrens of pwm ip
+ * node: node for adding pwm to global list of all pwm ips
+ */

drivers/pwm/st_pwm.c new file +52 -0
+struct pwm {
+	unsigned id;
+	void __iomem *mmio_base;
+	struct clk *clk;
+	int clk_enabled;
+	struct platform_device *pdev;
+	spinlock_t lock;
+	struct list_head devices;
+	struct list_head node;
+};
+
+/*
+ * period_ns = 10^9 * (PRESCALE + 1) * PV / PWM_CLK_RATE
+ * duty_ns = 10^9 * (PRESCALE + 1) * DC / PWM_CLK_RATE
+ *
+ * PV = (PWM_CLK_RATE * period_ns)/ (10^9 * (PRESCALE + 1))
+ * DC = (PWM_CLK_RATE * duty_ns)/ (10^9 * (PRESCALE + 1))
+ */
+int pwm_config(struct pwm_device *pwmd, int duty_ns, int period_ns)
+{
+	u64 val, div, clk_rate;
+	unsigned long prescale = MIN_PRESCALE, pv, dc;
+	int ret = 0;
+
+	if (!pwmd) {
+		pr_err("pwm: config - NULL pwm device pointer\n");
+		return -EFAULT;
+	}
+
+	if (period_ns == 0 || duty_ns > period_ns) {
+		ret = -EINVAL;
+		goto err;
+	}
+
+	/* TODO: Need to optimize this loop */
+	while (1) {
+		div = 1000000000;
+		div *= 1 + prescale;
+		clk_rate = clk_get_rate(pwmd->pwm->clk);
+		val = clk_rate * period_ns;
+		pv = div64_u64(val, div);
+		val = clk_rate * duty_ns;
+		dc = div64_u64(val, div);
+
+		if ((pv == 0) || (dc == 0)) {
+			ret = -EINVAL;
+			goto err;
+		}
+		if ((pv > MAX_PERIOD) || (dc > MAX_DUTY)) {
+			prescale++;
+			if (prescale > MAX_PRESCALE) {
+				ret = -EINVAL;

drivers/pwm/st_pwm.c line 147

Quoted 10 lines
drivers/pwm/st_pwm.c new file +10 -0
+				goto err;
+			}
+			continue;
+		}
+		if ((pv < MIN_PERIOD) || (dc < MIN_DUTY)) {
+			ret = -EINVAL;
+			goto err;
+		}
+		break;
+	}

gee, is this some sort of puzzle? So human-readable description of what this code is doing would be an improvement.

Quoted 9 lines
drivers/pwm/st_pwm.c new file +9 -0
+	/*
+	 * NOTE: the clock to PWM has to be enabled first
+	 * before writing to the registers
+	 */
+	spin_lock(&pwmd->pwm->lock);
+	ret = clk_enable(pwmd->pwm->clk);
+	if (ret) {
+		spin_unlock(&pwmd->pwm->lock);
+		goto err;

drivers/pwm/st_pwm.c line 167

Quoted 10 lines
drivers/pwm/st_pwm.c new file +10 -0
+	}
+
+	spin_lock(&pwmd->lock);
+	writel(prescale << PRESCALE_SHIFT, pwmd->pwm->mmio_base +
+			pwmd->offset + PWMCR);
+	writel(dc, pwmd->pwm->mmio_base + pwmd->offset + PWMDCR);
+	writel(pv, pwmd->pwm->mmio_base + pwmd->offset + PWMPCR);
+	spin_unlock(&pwmd->lock);
+	clk_disable(pwmd->pwm->clk);
+	spin_unlock(&pwmd->pwm->lock);

The nesting rules for these two locks seems sensible and obvious, but I guess documenting the rule wouldn't hurt.

drivers/pwm/st_pwm.c

Quoted 11 lines
drivers/pwm/st_pwm.c new file +8 -0
+	return 0;
+err:
+	dev_err(&pwmd->pwm->pdev->dev, "pwm config fail\n");
+	return ret;
+}
+EXPORT_SYMBOL(pwm_config);
+
 
...
 
+static int __devinit st_pwm_probe(struct platform_device *pdev)

And here things get rather odd.

Most of this file is a generic, non-device specific PWM layer, exported to other modules. But then we get into driver bits which are specific to one paritular type of device. Confused - this is like putting the e100 driver inside net/ipv4/tcp.c?

#3 lore raw

Re: [PATCH V2 1/3] drivers/pwm st_pwm: Add support for ST's Pulse Width Modulator

Quoted 5 lines · Andrew Morton
Quoted 1 line · On Tue, 31 May 2011 14:21:51 +0530 Viresh Kumar <[email protected]> wrote:

+ * lock: lock specific to a pwm device

Quoted 8 lines

More specificity here would be helpful. Precisely which data does the lock protect?

Quoted 1 line

+ * lock: lock specific to current pwm ip

Ditto.

Ok.

Quoted 39 lines
Quoted 39 lines
drivers/pwm/st_pwm.c new file +39 -0
+int pwm_config(struct pwm_device *pwmd, int duty_ns, int period_ns)
+{
+	u64 val, div, clk_rate;
+	unsigned long prescale = MIN_PRESCALE, pv, dc;
+	int ret = 0;
+
+	if (!pwmd) {
+		pr_err("pwm: config - NULL pwm device pointer\n");
+		return -EFAULT;
+	}
+
+	if (period_ns == 0 || duty_ns > period_ns) {
+		ret = -EINVAL;
+		goto err;
+	}
+
+	/* TODO: Need to optimize this loop */
+	while (1) {
+		div = 1000000000;
+		div *= 1 + prescale;
+		clk_rate = clk_get_rate(pwmd->pwm->clk);
+		val = clk_rate * period_ns;
+		pv = div64_u64(val, div);
+		val = clk_rate * duty_ns;
+		dc = div64_u64(val, div);
+
+		if ((pv == 0) || (dc == 0)) {
+			ret = -EINVAL;
+			goto err;
+		}
+		if ((pv > MAX_PERIOD) || (dc > MAX_DUTY)) {
+			prescale++;
+			if (prescale > MAX_PRESCALE) {
+				ret = -EINVAL;
+				goto err;
+			}
+			continue;
+		}
+		if ((pv < MIN_PERIOD) || (dc < MIN_DUTY)) {
Quoted 9 lines

drivers/pwm/st_pwm.c line 147

Quoted 5 lines
drivers/pwm/st_pwm.c new file +5 -0
+			ret = -EINVAL;
+			goto err;
+		}
+		break;
+	}

gee, is this some sort of puzzle? So human-readable description of what this code is doing would be an improvement.

Sure. Will add that.

Quoted 10 lines
Quoted 10 lines
drivers/pwm/st_pwm.c new file +10 -0
+	spin_lock(&pwmd->pwm->lock);
+	ret = clk_enable(pwmd->pwm->clk);
+	if (ret) {
+		spin_unlock(&pwmd->pwm->lock);
+		goto err;
+	}
+
+	spin_lock(&pwmd->lock);
+	writel(prescale << PRESCALE_SHIFT, pwmd->pwm->mmio_base +
+			pwmd->offset + PWMCR);
Quoted 9 lines

drivers/pwm/st_pwm.c line 167

Quoted 5 lines
drivers/pwm/st_pwm.c new file +5 -0
+	writel(dc, pwmd->pwm->mmio_base + pwmd->offset + PWMDCR);
+	writel(pv, pwmd->pwm->mmio_base + pwmd->offset + PWMPCR);
+	spin_unlock(&pwmd->lock);
+	clk_disable(pwmd->pwm->clk);
+	spin_unlock(&pwmd->pwm->lock);

The nesting rules for these two locks seems sensible and obvious, but I guess documenting the rule wouldn't hurt.

Ok.

Quoted 10 lines
Quoted 10 lines
drivers/pwm/st_pwm.c new file +7 -0
+	return 0;
+err:
+	dev_err(&pwmd->pwm->pdev->dev, "pwm config fail\n");
+	return ret;
+}
+EXPORT_SYMBOL(pwm_config);
+
 
...
Quoted 9 lines
Quoted 1 line

+static int __devinit st_pwm_probe(struct platform_device *pdev)

And here things get rather odd.

Most of this file is a generic, non-device specific PWM layer, exported to other modules. But then we get into driver bits which are specific to one paritular type of device. Confused - this is like putting the e100 driver inside net/ipv4/tcp.c?

Sorry but i couldn't get this one completely. :(
Driver is specific to pwm peripheral by ST. This driver can be used for SPEAr or may be other SoC or Devices, and is not at all dependent on SPEAr.

Signature · 1 line
viresh
#4 lore raw

Re: [PATCH V2 1/3] drivers/pwm st_pwm: Add support for ST's Pulse Width Modulator

Quoted 10 lines · On Tuesday 07 June 2011 05:55:25 viresh kumar wrote:
Quoted 9 lines
Quoted 1 line

+static int __devinit st_pwm_probe(struct platform_device *pdev)

And here things get rather odd.

Most of this file is a generic, non-device specific PWM layer, exported to other modules. But then we get into driver bits which are specific to one paritular type of device. Confused - this is like putting the e100 driver inside net/ipv4/tcp.c?

Quoted 3 lines

Sorry but i couldn't get this one completely. :(
Driver is specific to pwm peripheral by ST. This driver can be used for SPEAr or may be other SoC or Devices, and is not at all dependent on SPEAr.

It was my suggestion to start drivers/pwm/ with this driver. We currently have a number of pwm drivers spread over the entire tree, all using slight the same interface header. They all look like this one, and are each used on one SOC, so you have to choose at compile-time which one to use.

There are two problems with this of course:
1. the drivers that export the same interface should be in one directory
2. there should be a common abstraction layer to avoid duplicate code and enable building a kernel with multiple PWM drivers builtin.

Moving this driver to drivers/pwm is the first step to address the problem 1, we will move the other drivers in the 3.1 or 3.2 timeframe.

There is independent by Sascha Hauer to work on the abstraction layer for all the drivers. Once that is in, we will change the individual drivers in drivers/pwm accordingly.

Arnd

#5 lore raw

Re: [PATCH V2 1/3] drivers/pwm st_pwm: Add support for ST's Pulse Width Modulator

Quoted 11 lines · Arnd Bergmann
Quoted 10 lines · On Tuesday 07 June 2011 05:55:25 viresh kumar wrote:
Quoted 9 lines
Quoted 1 line

+static int __devinit st_pwm_probe(struct platform_device *pdev)

And here things get rather odd.

Most of this file is a generic, non-device specific PWM layer, exported to other modules. But then we get into driver bits which are specific to one paritular type of device. Confused - this is like putting the e100 driver inside net/ipv4/tcp.c?

Quoted 5 lines
Quoted 3 lines

Sorry but i couldn't get this one completely. :(
Driver is specific to pwm peripheral by ST. This driver can be used for SPEAr or may be other SoC or Devices, and is not at all dependent on SPEAr.

Now i get the question correctly. :)

Quoted 10 lines

It was my suggestion to start drivers/pwm/ with this driver. We currently have a number of pwm drivers spread over the entire tree, all using slight the same interface header. They all look like this one, and are each used on one SOC, so you have to choose at compile-time which one to use.

There are two problems with this of course:
1. the drivers that export the same interface should be in one directory
2. there should be a common abstraction layer to avoid duplicate code and enable building a kernel with multiple PWM drivers builtin.

Quoted 7 lines

Moving this driver to drivers/pwm is the first step to address the problem 1, we will move the other drivers in the 3.1 or 3.2 timeframe.

There is independent by Sascha Hauer to work on the abstraction layer for all the drivers. Once that is in, we will change the individual drivers in drivers/pwm accordingly.

Above was exactly the reason why i didn't separated framework from device specific part. As soon as framework is pushed, i will update my driver to work with it.

Signature · 1 line
viresh
#6 lore raw

PATCH v2 2/3 SPEAr3xx: Add machine support for ST's PWM IP

In reply to Viresh Kumar
---
 arch/arm/mach-spear3xx/include/mach/generic.h |    1 +
 arch/arm/mach-spear3xx/spear320.c             |   16 ++++++++++++++++
 arch/arm/mach-spear3xx/spear320_evb.c         |    1 +
 3 files changed, 18 insertions(+), 0 deletions(-)
arch/arm/mach-spear3xx/include/mach/generic.h +1 -0
index 8cc3a73..a88e359 100644
@@ -162,6 +162,7 @@ void __init spear310_init(struct pmx_mode *pmx_mode, struct pmx_dev **pmx_devs,
 #ifdef CONFIG_MACH_SPEAR320
 /* Add spear320 machine device structure declarations here */
 extern struct platform_device spear320_plgpio_device;
+extern struct platform_device spear320_pwm_device;
 
 /* pad mux modes */
 extern struct pmx_mode spear320_auto_net_smii_mode;
arch/arm/mach-spear3xx/spear320.c +16 -0
index 575493a..d84e986 100644
@@ -548,6 +548,22 @@ struct platform_device spear320_plgpio_device = {
 	.resource = plgpio_resources,
 };
 
+/* pwm device registeration */
+static struct resource pwm_resources[] = {
+	{
+		.start = SPEAR320_PWM_BASE,
+		.end = SPEAR320_PWM_BASE + SZ_4K - 1,
+		.flags = IORESOURCE_MEM,
+	},
+};
+
+struct platform_device spear320_pwm_device = {
+	.name = "st_pwm",
+	.id = -1,
+	.num_resources = ARRAY_SIZE(pwm_resources),
+	.resource = pwm_resources,
+};
+
 /* spear320 routines */
 void __init spear320_init(struct pmx_mode *pmx_mode, struct pmx_dev **pmx_devs,
 		u8 pmx_dev_count)
arch/arm/mach-spear3xx/spear320_evb.c +1 -0
index 4d747db..6190660 100644
@@ -50,6 +50,7 @@ static struct platform_device *plat_devs[] __initdata = {
 
 	/* spear320 specific devices */
 	&spear320_plgpio_device,
+	&spear320_pwm_device,
 };
 
 static void __init spear320_evb_init(void)
Signature · 1 line
1.7.2.2
#7 lore raw

PATCH v2 3/3 SPEAr3xx: Update defconfig for ST's PWM

In reply to Viresh Kumar
---
 arch/arm/configs/spear3xx_defconfig |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
arch/arm/configs/spear3xx_defconfig +2 -0
index 07e9613..bc29eaf 100644
@@ -30,6 +30,8 @@ CONFIG_SPEAR_PLGPIO=y
 # CONFIG_HWMON is not set
 # CONFIG_HID_SUPPORT is not set
 # CONFIG_USB_SUPPORT is not set
+CONFIG_PWMLIB=y
+CONFIG_ST_PWM=y
 CONFIG_EXT2_FS=y
 CONFIG_EXT2_FS_XATTR=y
 CONFIG_EXT2_FS_SECURITY=y
Signature · 1 line
1.7.2.2
#8 lore raw
In reply to Viresh Kumar
Quoted 15 lines · Viresh KUMAR

This patchset adds drivers/pwm directory as suggested by Arnd Bergmann in following discussion:

http://comments.gmane.org/gmane.linux.ports.arm.kernel/118651

and also adds support for ST Microelectronics Pulse Width Modulator. This is currently used by ST's SPEAr platform and tested on the same.

Changes since V1:
- Moved driver to drivers/pwm/ directory from drivers/misc
- arch/arm/configs/spear3xx_defconfig updated accordingly.

Changes since earlier patchset:
- Moved driver to drivers/misc/ directory.

Quoted 8 lines

It was earlier reviewed as part of following patchset:
"[PATCH V6 00/17] Adding devices support for all spear machines"

Viresh Kumar (3):
drivers/pwm st_pwm: Add support for ST's Pulse Width Modulator
SPEAr3xx: Add machine support for ST's PWM IP
SPEAr3xx: Update defconfig for ST's PWM

Hi Arnd,

Will you push this patchset through your tree or somebody else will do?

Signature · 1 line
viresh
#9 lore raw
Quoted 19 lines · viresh kumar
Quoted 18 lines · Viresh KUMAR

This patchset adds drivers/pwm directory as suggested by Arnd Bergmann in following discussion:

http://comments.gmane.org/gmane.linux.ports.arm.kernel/118651

and also adds support for ST Microelectronics Pulse Width Modulator. This is currently used by ST's SPEAr platform and tested on the same.

Changes since V1:
- Moved driver to drivers/pwm/ directory from drivers/misc
- arch/arm/configs/spear3xx_defconfig updated accordingly.

Changes since earlier patchset:
- Moved driver to drivers/misc/ directory.

It was earlier reviewed as part of following patchset:
"[PATCH V6 00/17] Adding devices support for all spear machines"

Quoted 6 lines
Quoted 4 lines

Viresh Kumar (3):
drivers/pwm st_pwm: Add support for ST's Pulse Width Modulator
SPEAr3xx: Add machine support for ST's PWM IP
SPEAr3xx: Update defconfig for ST's PWM

Will you push this patchset through your tree or somebody else will do?

Good question. If Sascha is able to come up with the patch to introduce the generic layer, I think it would be good to have it go though him.

Otherwise I guess I can carry it, but I'd start a new tree for drivers/{misc,char} then and put it in there, along with patches to move the other pwm drivers.

Arnd

#10 lore raw
Quoted 25 lines · Arnd Bergmann
Quoted 24 lines · viresh kumar
Quoted 22 lines · Viresh KUMAR

This patchset adds drivers/pwm directory as suggested by Arnd Bergmann in following discussion:

http://comments.gmane.org/gmane.linux.ports.arm.kernel/118651

and also adds support for ST Microelectronics Pulse Width Modulator. This is currently used by ST's SPEAr platform and tested on the same.

Changes since V1:
- Moved driver to drivers/pwm/ directory from drivers/misc
- arch/arm/configs/spear3xx_defconfig updated accordingly.

Changes since earlier patchset:
- Moved driver to drivers/misc/ directory.

It was earlier reviewed as part of following patchset:
"[PATCH V6 00/17] Adding devices support for all spear machines"

Viresh Kumar (3):
drivers/pwm st_pwm: Add support for ST's Pulse Width Modulator
SPEAr3xx: Add machine support for ST's PWM IP
SPEAr3xx: Update defconfig for ST's PWM

Quoted 4 lines
Quoted 1 line

Will you push this patchset through your tree or somebody else will do?

Good question. If Sascha is able to come up with the patch to introduce the generic layer, I think it would be good to have it go though him.

Just posted a rebased and documented series again. Let's see what happens. The time seems good to finally get this into the kernel.

Sascha

Signature · 4 lines
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 |
#11 lore raw
Quoted 6 lines · Sascha Hauer
Quoted 3 lines

Good question. If Sascha is able to come up with the patch to introduce the generic layer, I think it would be good to have it go though him.

Just posted a rebased and documented series again. Let's see what happens. The time seems good to finally get this into the kernel.

I'd say let's go forward with your framework. The two patches currently because they both add Makefile/Kconfig files in drivers/pwm.

Maybe you can add Viresh's patch to your series, and wait for him to follow up with a patch to convert it?

I've tried to blindly do the conversion myself, but got stuck with the definition of the platform device that has multiple pwms in it. I wonder if it would be better to change the st-pwm platform interface to define one platform_device for each of them.

Arnd

#12 lore raw
Quoted 11 lines · Arnd Bergmann
Quoted 6 lines · Sascha Hauer
Quoted 3 lines

Good question. If Sascha is able to come up with the patch to introduce the generic layer, I think it would be good to have it go though him.

Just posted a rebased and documented series again. Let's see what happens. The time seems good to finally get this into the kernel.

I'd say let's go forward with your framework. The two patches currently because they both add Makefile/Kconfig files in drivers/pwm.

Quoted 7 lines

Maybe you can add Viresh's patch to your series, and wait for him to follow up with a patch to convert it?

I've tried to blindly do the conversion myself, but got stuck with the definition of the platform device that has multiple pwms in it. I wonder if it would be better to change the st-pwm platform interface to define one platform_device for each of them.

Definitely. From a quick look at the driver it seems the pwms all have a seperate register space.

I can add Viresh's patch to my series once we agree on the base patch. In the meantime maybe Viresh starts converting it ;)

Sascha

Signature · 4 lines
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 |
#13 lore raw
Quoted 6 lines · Sascha Hauer
Quoted 1 line · Arnd Bergmann

On Tuesday 28 June 2011, Sascha Hauer wrote:

Definitely. From a quick look at the driver it seems the pwms all have a seperate register space.

Actually, latest version of pwm (not present in current patch) has common registers to all pwm devices.

Quoted 2 lines

I can add Viresh's patch to my series once we agree on the base patch. In the meantime maybe Viresh starts converting it ;)

I will not be able to do this now due to some other activities i am doing currently. :(
May be you can go ahead with your patchset and i will update mine and send it back as soon as i get some time.

--
viresh