Skip to contentSkip to conversation

PWM driver support for EHRPWM & ECAP

PATCH Applied Philip, Avinash 2 participants 5 messages Jul 25, 2012 – Jul 26, 2012 PWM

lore
Share & tools
lore
#0 lore raw

v2 cover PWM driver support for EHRPWM & ECAP

This patch series adds support for PWM driver support for EHRPWM and ECAP modules which has been present on AM335x SOC. AM335X SOC has 3 instances of ECAP & EHRPWM.

EHRPWM device can be used to generate PWM waveforms. It has 2 channels of PWM output and each can be configured for different duty cycle and polarity.

ECAP device can be used as either Capture or APWM mode. In APWM mode, ECAP can generate PWM waveform.

Patch #1 adds Generic PWM driver support for simple APWM functionality of ECAP ECAP hardware.

Patch #2 adds PWM driver support for EHRPWM device.

This patch series is based on new PWM framework maintained at [1].

1. https://gitorious.org/linux-pwm/linux-pwm/trees/for-next

Since v1:
- Alphabetically placed in Kconfig and Makefile
- Removes unused MACROS
- Starts using TI prefix for ecap & ehrpwm modules to avoid confusion.
- Starts using platform_get_resource() instead of platform_get_resource_byname()
- Removes dev_info messages of PWM device Initialized.
- Add const qualifier on struct pwm_ops definition.
- Removes platform_drvdata check on platform_driver_remove.
- Starts checking pwmchip_remove() return value.
- Kept back MACRO definitions which are related to give more readability

Philip, Avinash (2):
pwm: pwm-tiecap: PWM driver support for ECAP APWM
pwm: pwm-tiehrpwm: PWM driver support for EHRPWM

 drivers/pwm/Kconfig        |   22 +++
 drivers/pwm/Makefile       |    2 +
 drivers/pwm/pwm-tiecap.c   |  232 +++++++++++++++++++++++++
 drivers/pwm/pwm-tiehrpwm.c |  411 ++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 667 insertions(+), 0 deletions(-)
 create mode 100644 drivers/pwm/pwm-tiecap.c
 create mode 100644 drivers/pwm/pwm-tiehrpwm.c
#1 lore raw

PATCH v2 1/2 pwm: pwm-tiecap: PWM driver support for ECAP APWM

ECAP hardware on AM33XX SOC supports auxiliary PWM (APWM) feature. This commit adds PWM driver support for ECAP hardware on AM33XX SOC.

In the ECAP hardware, each PWM pin can also be configured to be in capture mode. Current implementation only supports PWM mode of operation. Also, hardware supports sync between multiple PWM pins but the driver supports simple independent PWM functionality.

---
:100644 100644 94e176e... 2840747... M drivers/pwm/Kconfig
:100644 100644 5459702... 35fee43... M drivers/pwm/Makefile
:000000 100644 0000000... 3c2ad28... A drivers/pwm/pwm-tiecap.c

 drivers/pwm/Kconfig      |   11 ++
 drivers/pwm/Makefile     |    1 +
 drivers/pwm/pwm-tiecap.c |  232 ++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 244 insertions(+), 0 deletions(-)
drivers/pwm/Kconfig +11 -0
index 94e176e..2840747 100644
@@ -76,6 +76,17 @@ config PWM_TEGRA
 	  To compile this driver as a module, choose M here: the module
 	  will be called pwm-tegra.
 
+config  PWM_TIECAP
+	tristate "ECAP PWM support"
+	depends on SOC_AM33XX
+
+	help
+	  PWM driver support for the ECAP APWM controller found on AM33XX
+	  TI SOC
+
+	  To compile this driver as a module, choose M here: the module
+	  will be called pwm-tiecap.
+
 config PWM_VT8500
 	tristate "vt8500 pwm support"
 	depends on ARCH_VT8500
drivers/pwm/Makefile +1 -0
index 5459702..35fee43 100644
@@ -6,4 +6,5 @@ obj-$(CONFIG_PWM_MXS)		+= pwm-mxs.o
 obj-$(CONFIG_PWM_PXA)		+= pwm-pxa.o
 obj-$(CONFIG_PWM_SAMSUNG)	+= pwm-samsung.o
 obj-$(CONFIG_PWM_TEGRA)		+= pwm-tegra.o
+obj-$(CONFIG_PWM_TIECAP)	+= pwm-tiecap.o
 obj-$(CONFIG_PWM_VT8500)	+= pwm-vt8500.o
drivers/pwm/pwm-tiecap.c new file +232 -0

232 lines not on this page · raw message

Signature · 1 line
1.7.1
#2 lore raw

Re: [PATCH v2 1/2] pwm: pwm-tiecap: PWM driver support for ECAP APWM

Quoted 10 lines · Avinash

ECAP hardware on AM33XX SOC supports auxiliary PWM (APWM) feature. This commit adds PWM driver support for ECAP hardware on AM33XX SOC.

In the ECAP hardware, each PWM pin can also be configured to be in capture mode. Current implementation only supports PWM mode of operation. Also, hardware supports sync between multiple PWM pins but the driver supports simple independent PWM functionality.

Applied, with a minor cosmetic fixup. Thanks.

Thierry

#3 lore raw

PATCH v2 2/2 pwm: pwm-tiehrpwm: PWM driver support for EHRPWM

In reply to Philip, Avinash

Enhanced high resolution PWM module (EHRPWM) hardware can be used to generate PWM output over 2 channels. This commit adds PWM driver support for EHRPWM device present on AM33XX SOC. Current implementation supports simple PWM functionality.

---
:100644 100644 2840747... 371a36c... M drivers/pwm/Kconfig
:100644 100644 35fee43... e4b2c89... M drivers/pwm/Makefile
:000000 100644 0000000... 010d232... A drivers/pwm/pwm-tiehrpwm.c

 drivers/pwm/Kconfig        |   11 ++
 drivers/pwm/Makefile       |    1 +
 drivers/pwm/pwm-tiehrpwm.c |  411 ++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 423 insertions(+), 0 deletions(-)
drivers/pwm/Kconfig +11 -0
index 2840747..371a36c 100644
@@ -87,6 +87,17 @@ config  PWM_TIECAP
 	  To compile this driver as a module, choose M here: the module
 	  will be called pwm-tiecap.
 
+config  PWM_TIEHRPWM
+	tristate "EHRPWM PWM support"
+	depends on SOC_AM33XX
+
+	help
+	  PWM driver support for the EHRPWM controller found on AM33XX
+	  TI SOC
+
+	  To compile this driver as a module, choose M here: the module
+	  will be called pwm-tiehrpwm.
+
 config PWM_VT8500
 	tristate "vt8500 pwm support"
 	depends on ARCH_VT8500
drivers/pwm/Makefile +1 -0
index 35fee43..e4b2c89 100644
@@ -7,4 +7,5 @@ obj-$(CONFIG_PWM_PXA)		+= pwm-pxa.o
 obj-$(CONFIG_PWM_SAMSUNG)	+= pwm-samsung.o
 obj-$(CONFIG_PWM_TEGRA)		+= pwm-tegra.o
 obj-$(CONFIG_PWM_TIECAP)	+= pwm-tiecap.o
+obj-$(CONFIG_PWM_TIEHRPWM)	+= pwm-tiehrpwm.o
 obj-$(CONFIG_PWM_VT8500)	+= pwm-vt8500.o
drivers/pwm/pwm-tiehrpwm.c new file +411 -0

411 lines not on this page · raw message

Signature · 1 line
1.7.1
#4 lore raw

Re: [PATCH v2 2/2] pwm: pwm-tiehrpwm: PWM driver support for EHRPWM

Quoted 7 lines · Avinash

Enhanced high resolution PWM module (EHRPWM) hardware can be used to generate PWM output over 2 channels. This commit adds PWM driver support for EHRPWM device present on AM33XX SOC. Current implementation supports simple PWM functionality.

Applied, with a minor cosmetic fixup. Thanks.

Thierry