[PATCH V2 1/2] drivers/pwm: add PXA pulse width modulator controller

Sascha Hauer s.hauer at pengutronix.de
Thu Feb 16 02:40:31 EST 2012


On Wed, Feb 15, 2012 at 04:21:13PM +0100, Robert Jarzmik wrote:
> 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 ?

Oh, yes, you are right. You have to add a struct device_d * to struct
pwm_chip.

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 |



More information about the barebox mailing list