summaryrefslogtreecommitdiffstats
path: root/drivers/pwm/pwm-imx.c
Commit message (Collapse)AuthorAgeFilesLines
* pwm: i.MX: fix clock lookupPhilipp Zabel2012-09-121-8/+27
| | | | | | | | | | | | | | | | The i.MX PWM core has two clocks: The ipg clock and the ipg highfreq (peripheral) clock. The ipg clock has to be enabled for this hardware to work. The actual PWM output can either be driven by the ipg clock or the ipg highfreq. The ipg highfreq has the advantage that it runs even when the SoC is in low power modes. This patch requests both clocks and enables the ipg clock for accessing registers and the peripheral clock to actually turn on the PWM. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Reviewed-by: Shawn Guo <shawn.guo@linaro.org> Reviewed-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com> Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
* pwm: i.MX: use per clock unconditionallySascha Hauer2012-09-121-7/+1Star
| | | | | | | | | | | | | | The i.MX PWM module has two clocks: The ipg clock and the ipg highfreq (peripheral) clock. The ipg clock has to be enabled for this hardware to work. The actual PWM output can either be driven by the ipg clock or the ipg highfreq. The ipg highfreq has the advantage that it runs even when the SoC is in low power modes. Use the always running clock also on i.MX25. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Reviewed-by: Shawn Guo <shawn.guo@linaro.org> Reviewed-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com> Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
* pwm: i.MX: add devicetree supportPhilipp Zabel2012-09-121-9/+35
| | | | | | | | | | | | At the same time remove platform based support. No user for this driver has made it into mainline so far, so all we break is out of tree stuff. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Reviewed-by: Shawn Guo <shawn.guo@linaro.org> Reviewed-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com> Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
* pwm: i.MX: Use module_platform_driverSascha Hauer2012-09-121-11/+1Star
| | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Reviewed-by: Shawn Guo <shawn.guo@linaro.org> Reviewed-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com> Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
* pwm: i.MX: add functions to enable/disable pwm.Sascha Hauer2012-09-121-4/+44
| | | | | | | | | | | | We used to enable/disable the PWM only by switching the clock on or off. Instead, use the dedicated register bits. These differ on different SoCs, so introduce a SoC specific function for this. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Reviewed-by: Shawn Guo <shawn.guo@linaro.org> Reviewed-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com> Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
* pwm: i.MX: remove unnecessary if in pwm_[en|dis]ableSascha Hauer2012-09-121-14/+11Star
| | | | | | | | | | | The PWM core makes sure that pwm_enable/disable are called only once. Still keep the enabled state since we will need it in pwm_config. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Reviewed-by: Shawn Guo <shawn.guo@linaro.org> Reviewed-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com> Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
* pwm: i.MX: factor out SoC specific functionsSascha Hauer2012-09-121-63/+83
| | | | | | | | | | To cleanup the code and to make it easier to support different SoCs. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Reviewed-by: Shawn Guo <shawn.guo@linaro.org> Reviewed-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com> Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
* pwm: Convert pwm-imx to use devm_* APIsAxel Lin2012-07-231-47/+10Star
| | | | | Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
* ARM i.MX: Move i.MX pwm driver to pwm frameworkSascha Hauer2012-07-021-0/+267
Move the driver to drivers/pwm/ and convert it to use the framework. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> [eric@eukrea.com: set chip.dev to prevent probe failure] [eric@eukrea.com: fix pwmchip_add return code test] Signed-off-by: Eric Bénard <eric@eukrea.com> Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>