Skip to contentSkip to conversation

mfd: Add TWL4030 PWM driver

PATCH In review Bernhard Walle 6 participants 9 messages Mar 20, 2012 – Mar 21, 2012

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

PATCH 1/1 mfd: Add TWL4030 PWM driver

This PWM driver uses the PWM of the TWL4030. The driver for the TWL6030 PWM has been used as mode, but the PWM registers are different.

The driver can be used and has been tested in conjunction with pwm-backlight to control a backlight LED of a LCD touch screen.

---
 drivers/mfd/Kconfig       |    9 ++
 drivers/mfd/Makefile      |    1 +
 drivers/mfd/twl4030-pwm.c |  235 +++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 245 insertions(+)
 create mode 100644 drivers/mfd/twl4030-pwm.c
drivers/mfd/Kconfig +9 -0
index f147395..4a7bee8 100644
@@ -235,6 +235,15 @@ config TWL4030_POWER
 	  and load scripts controlling which resources are switched off/on
 	  or reset when a sleep, wakeup or warm reset event occurs.
 
+config TWL4030_PWM
+	tristate "TWL4030 PWM (Pulse Width Modulator) Support"
+	depends on TWL4030_CORE
+	select HAVE_PWM
+	default n
+	help
+	  Say yes here if you want support for TWL4030 PWM. This PWM
+	  can be used to control the brightness of an LCD backlight.
+
 config MFD_TWL4030_AUDIO
 	bool
 	depends on TWL4030_CORE
drivers/mfd/Makefile +1 -0
index b953bab..7b824eb 100644
@@ -48,6 +48,7 @@ obj-$(CONFIG_MENELAUS)		+= menelaus.o
 obj-$(CONFIG_TWL4030_CORE)	+= twl-core.o twl4030-irq.o twl6030-irq.o
 obj-$(CONFIG_TWL4030_MADC)      += twl4030-madc.o
 obj-$(CONFIG_TWL4030_POWER)    += twl4030-power.o
+obj-$(CONFIG_TWL4030_PWM)	+= twl4030-pwm.o
 obj-$(CONFIG_MFD_TWL4030_AUDIO)	+= twl4030-audio.o
 obj-$(CONFIG_TWL6030_PWM)	+= twl6030-pwm.o
 obj-$(CONFIG_TWL6040_CORE)	+= twl6040-core.o twl6040-irq.o
drivers/mfd/twl4030-pwm.c new file +235 -0

235 lines not on this page · raw message

Signature · 1 line
1.7.9.4
#1 lore raw
Quoted 8 lines · Bernhard Walle

This PWM driver uses the PWM of the TWL4030. The driver for the TWL6030 PWM has been used as mode, but the PWM registers are different.

The driver can be used and has been tested in conjunction with pwm-backlight to control a backlight LED of a LCD touch screen.

Since it's too late for v3.4 now and we will get a new pwm subsystem in v3.5, I suggest you change the driver to work register with that subsystem instead of just using the old header file. Note that drivers/mfd is not really the right place anyway, because this is not a multifunction driver but just one device driver that happens to be a slave of an mfd.

Arnd

#2 lore raw

Am 20.03.12 23:02, schrieb Arnd Bergmann:

Quoted 8 lines · Bernhard Walle
Quoted 7 lines

This PWM driver uses the PWM of the TWL4030. The driver for the TWL6030 PWM has been used as mode, but the PWM registers are different.

The driver can be used and has been tested in conjunction with pwm-backlight to control a backlight LED of a LCD touch screen.

Quoted 8 lines
Quoted 1 line

Since it's too late for v3.4 now and we will get a new pwm subsystem in v3.5, I suggest you change the driver to work register with that subsystem instead of just using the old header file. Note that drivers/mfd is not really the right place anyway, because this is not a multifunction driver but just one device driver that happens to be a slave of an mfd.

Does that new subsystem already exist in some tree?

Regards,
Bernhard

#3 lore raw
Quoted 11 lines · Bernhard Walle

Am 20.03.12 23:02, schrieb Arnd Bergmann:

Quoted 10 lines · Bernhard Walle
Quoted 8 lines

This PWM driver uses the PWM of the TWL4030. The driver for the TWL6030 PWM has been used as mode, but the PWM registers are different.

The driver can be used and has been tested in conjunction with pwm-backlight to control a backlight LED of a LCD touch screen.

Quoted 8 lines
Quoted 6 lines

Since it's too late for v3.4 now and we will get a new pwm subsystem in v3.5, I suggest you change the driver to work register with that subsystem instead of just using the old header file. Note that drivers/mfd is not really the right place anyway, because this is not a multifunction driver but just one device driver that happens to be a slave of an mfd.

Does that new subsystem already exist in some tree?

Thierry Reding has been busily posting patches, so he probably has one that you can use, but I couldn't find it now.

Arnd

#4 lore raw
Quoted 19 lines · Arnd Bergmann
Quoted 18 lines · Bernhard Walle

Am 20.03.12 23:02, schrieb Arnd Bergmann:

Quoted 16 lines · Bernhard Walle
Quoted 8 lines

This PWM driver uses the PWM of the TWL4030. The driver for the TWL6030 PWM has been used as mode, but the PWM registers are different.

The driver can be used and has been tested in conjunction with pwm-backlight to control a backlight LED of a LCD touch screen.

Since it's too late for v3.4 now and we will get a new pwm subsystem in v3.5, I suggest you change the driver to work register with that subsystem instead of just using the old header file. Note that drivers/mfd is not really the right place anyway, because this is not a multifunction driver but just one device driver that happens to be a slave of an mfd.

Quoted 4 lines
Quoted 1 line

Does that new subsystem already exist in some tree?

Thierry Reding has been busily posting patches, so he probably has one that you can use, but I couldn't find it now.

I don't have a public tree anywhere. Does anyone have a recommendation where I could set one up? github or gitorious are the first to come to my mind.

Thierry

#5 lore raw
Quoted 20 lines · Thierry Reding
Quoted 19 lines · Arnd Bergmann
Quoted 18 lines · Bernhard Walle

Am 20.03.12 23:02, schrieb Arnd Bergmann:

Quoted 16 lines · Bernhard Walle
Quoted 8 lines

This PWM driver uses the PWM of the TWL4030. The driver for the TWL6030 PWM has been used as mode, but the PWM registers are different.

The driver can be used and has been tested in conjunction with pwm-backlight to control a backlight LED of a LCD touch screen.

Since it's too late for v3.4 now and we will get a new pwm subsystem in v3.5, I suggest you change the driver to work register with that subsystem instead of just using the old header file. Note that drivers/mfd is not really the right place anyway, because this is not a multifunction driver but just one device driver that happens to be a slave of an mfd.

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

Does that new subsystem already exist in some tree?

Thierry Reding has been busily posting patches, so he probably has one that you can use, but I couldn't find it now.

I don't have a public tree anywhere. Does anyone have a recommendation where I could set one up? github or gitorious are the first to come to my mind.

They both work fine and are easy to set up, at least as a temporary location.

If you want to have something more official in the long run, you could either set up your own git server on your employer's domain or if that is impractical, get an account on kernel.org or linaro.org. Both of those try to limit the amount of accounts they hand out to external people, but since you are going to be a subsystem maintainer, I don't see it as a problem.

Arnd

#6 lore raw
Quoted 5 lines · Arnd Bergmann
Quoted 2 lines · Thierry Reding

I don't have a public tree anywhere. Does anyone have a recommendation where I could set one up? github or gitorious are the first to come to my mind.

They both work fine and are easy to set up, at least as a temporary location.

Okay, I'll check both and will also investigate whether one can be setup on our domain.

Quoted 6 lines

If you want to have something more official in the long run, you could either set up your own git server on your employer's domain or if that is impractical, get an account on kernel.org or linaro.org. Both of those try to limit the amount of accounts they hand out to external people, but since you are going to be a subsystem maintainer, I don't see it as a problem.

Maybe Sascha should have a say in this (adding to Cc). He wrote the original code and got the ball rolling, so I don't want to jump the queue. If he's okay with it, though, I'd be happy to take over.

Thierry

#7 lore raw
Quoted 17 lines · Thierry Reding
Quoted 5 lines · Arnd Bergmann
Quoted 2 lines · Thierry Reding

I don't have a public tree anywhere. Does anyone have a recommendation where I could set one up? github or gitorious are the first to come to my mind.

They both work fine and are easy to set up, at least as a temporary location.

Okay, I'll check both and will also investigate whether one can be setup on our domain.

Quoted 6 lines

If you want to have something more official in the long run, you could either set up your own git server on your employer's domain or if that is impractical, get an account on kernel.org or linaro.org. Both of those try to limit the amount of accounts they hand out to external people, but since you are going to be a subsystem maintainer, I don't see it as a problem.

Quoted 3 lines

Maybe Sascha should have a say in this (adding to Cc). He wrote the original code and got the ball rolling, so I don't want to jump the queue. If he's okay with it, though, I'd be happy to take over.

I'm okay with this. I only wanted to write code for pwm, not maintain 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 |
#8 lore raw
In reply to Bernhard Walle
Quoted 5 lines · Bernhard Walle

This PWM driver uses the PWM of the TWL4030. The driver for the TWL6030 PWM has been used as mode, but the PWM registers are different.

The driver can be used and has been tested in conjunction with pwm-backlight to control a backlight LED of a LCD touch screen.

Nice, could we also have LEDA and LEDB pwm control as pwm_id 2 and 3 in next version? No worries if you don't want it, I could try to take a stab at that later.

Signature · 1 line
Gražvydas