[PATCH V2 1/2] drivers/pwm: add PXA pulse width modulator controller
Robert Jarzmik
robert.jarzmik at free.fr
Wed Feb 15 10:21:13 EST 2012
Sascha Hauer <s.hauer at pengutronix.de> writes:
> Hi Robert,
> Nice to make the pwms accessible from the command line, but shouldn't
> this be in the core? From what I see all we have to do is to add
> duty_ns and period_ns to struct pwm_chip.
I thought it over twice.
If the set_duty_ns(), set_period_ns() and set_enable() are transfered to the
core, I'll have to link the device and pwm_chip :
- expand pwmadd_chip() : should be expanded with the "struct device_d *dev"
parameter
- provide a way to link *dev with *pwm_chip
=> either store device_d pointer into pwm_device structure, and go through the
list of all PWMs at each set_X() calls
=> or use dev->priv (bad idea since the driver, ie. pxa_pwm wants to do that)
This way, calling set_X(struct device_d *dev, ...) will find pwm_chip pointer
from dev, and call the approriate pwm_config(), ...
So it's a bit more that adding duty_ns and period_ns to struct pwm_chip. Is this
what you want ?
Cheers.
--
Robert
More information about the barebox
mailing list