소스 검색

pwm: i.MX: use per clock unconditionally

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>
Sascha Hauer 13 년 전
부모
커밋
8d1c24bfd2
1개의 변경된 파일1개의 추가작업 그리고 7개의 파일을 삭제
  1. 1 7
      drivers/pwm/pwm-imx.c

+ 1 - 7
drivers/pwm/pwm-imx.c

@@ -17,7 +17,6 @@
 #include <linux/io.h>
 #include <linux/io.h>
 #include <linux/pwm.h>
 #include <linux/pwm.h>
 #include <linux/of_device.h>
 #include <linux/of_device.h>
-#include <mach/hardware.h>
 
 
 /* i.MX1 and i.MX21 share the same PWM function block: */
 /* i.MX1 and i.MX21 share the same PWM function block: */
 
 
@@ -133,16 +132,11 @@ static int imx_pwm_config_v2(struct pwm_chip *chip,
 
 
 	cr = MX3_PWMCR_PRESCALER(prescale) |
 	cr = MX3_PWMCR_PRESCALER(prescale) |
 		MX3_PWMCR_DOZEEN | MX3_PWMCR_WAITEN |
 		MX3_PWMCR_DOZEEN | MX3_PWMCR_WAITEN |
-		MX3_PWMCR_DBGEN;
+		MX3_PWMCR_DBGEN | MX3_PWMCR_CLKSRC_IPG_HIGH;
 
 
 	if (imx->enabled)
 	if (imx->enabled)
 		cr |= MX3_PWMCR_EN;
 		cr |= MX3_PWMCR_EN;
 
 
-	if (cpu_is_mx25())
-		cr |= MX3_PWMCR_CLKSRC_IPG;
-	else
-		cr |= MX3_PWMCR_CLKSRC_IPG_HIGH;
-
 	writel(cr, imx->mmio_base + MX3_PWMCR);
 	writel(cr, imx->mmio_base + MX3_PWMCR);
 
 
 	return 0;
 	return 0;