[PATCH V2 1/2] drivers/pwm: add PXA pulse width modulator controller
Sascha Hauer
s.hauer at pengutronix.de
Wed Feb 15 03:32:02 EST 2012
Hi Robert,
On Tue, Feb 14, 2012 at 01:58:13PM +0100, Robert Jarzmik wrote:
> Add PXA embedded pulse width modulator support. The PWM can
> generate signals from 49.6kHz to 1.625MHz.
> The driver is for pxa2xx family. The pxa3xx was not handled yet.
>
> Signed-off-by: Robert Jarzmik <robert.jarzmik at free.fr>
> ---
> arch/arm/mach-pxa/Makefile | 1 +
> arch/arm/mach-pxa/devices.c | 5 +
> arch/arm/mach-pxa/include/mach/clock.h | 1 +
> arch/arm/mach-pxa/include/mach/devices.h | 2 +-
> arch/arm/mach-pxa/include/mach/regs-pwm.h | 20 +++
> arch/arm/mach-pxa/speed-pxa27x.c | 5 +
> drivers/pwm/Kconfig | 6 +
> drivers/pwm/Makefile | 1 +
> drivers/pwm/pxa_pwm.c | 219 +++++++++++++++++++++++++++++
> 9 files changed, 259 insertions(+), 1 deletions(-)
> create mode 100644 arch/arm/mach-pxa/include/mach/regs-pwm.h
> create mode 100644 drivers/pwm/pxa_pwm.c
>
> +
> +static int __init pxa_pwm_register_vars(struct device_d *dev,
> + struct pxa_pwm_chip *pxa_pwm)
> +{
> + int ret;
> +
> + ret = dev_add_param(dev, "duty_ns", set_duty_ns, NULL, 0);
> + if (!ret)
> + ret = dev_add_param(dev, "period_ns", set_period_ns, NULL, 0);
> + if (!ret)
> + ret = dev_add_param(dev, "enable", set_enable, NULL, 0);
> + if (!ret)
> + ret = dev_set_param(dev, "enable", 0);
> + return ret;
> +}
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.
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