diff options
author | Arnaud Patard (Rtp) <arnaud.patard@rtp-net.org> | 2011-01-13 06:26:40 -0500 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2011-01-13 08:03:58 -0500 |
commit | dd027b00eb5cc8580452fe66447eacdce2d57db6 (patch) | |
tree | dcadbb55d8be2b34b4936b5dcaf56c8307bd1f38 | |
parent | 01c0761cc13a72c5aca5eab5870be8341eed214b (diff) |
mx51: add support for pwm
This patch is adding support for pwm1 and pwm2 devices found
on mx51.
[ this patch has been tested with pwm-backlight driver ]
Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | arch/arm/mach-mx5/clock-mx51-mx53.c | 7 | ||||
-rw-r--r-- | arch/arm/plat-mxc/pwm.c | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/arch/arm/mach-mx5/clock-mx51-mx53.c b/arch/arm/mach-mx5/clock-mx51-mx53.c index f1f45b63f455..ce4ffd769138 100644 --- a/arch/arm/mach-mx5/clock-mx51-mx53.c +++ b/arch/arm/mach-mx5/clock-mx51-mx53.c | |||
@@ -1191,6 +1191,11 @@ DEFINE_CLOCK(gpt_ipg_clk, 0, MXC_CCM_CCGR2, MXC_CCM_CCGRx_CG10_OFFSET, | |||
1191 | DEFINE_CLOCK(gpt_clk, 0, MXC_CCM_CCGR2, MXC_CCM_CCGRx_CG9_OFFSET, | 1191 | DEFINE_CLOCK(gpt_clk, 0, MXC_CCM_CCGR2, MXC_CCM_CCGRx_CG9_OFFSET, |
1192 | NULL, NULL, &ipg_clk, &gpt_ipg_clk); | 1192 | NULL, NULL, &ipg_clk, &gpt_ipg_clk); |
1193 | 1193 | ||
1194 | DEFINE_CLOCK(pwm1_clk, 0, MXC_CCM_CCGR2, MXC_CCM_CCGRx_CG6_OFFSET, | ||
1195 | NULL, NULL, &ipg_clk, NULL); | ||
1196 | DEFINE_CLOCK(pwm2_clk, 0, MXC_CCM_CCGR2, MXC_CCM_CCGRx_CG8_OFFSET, | ||
1197 | NULL, NULL, &ipg_clk, NULL); | ||
1198 | |||
1194 | /* I2C */ | 1199 | /* I2C */ |
1195 | DEFINE_CLOCK(i2c1_clk, 0, MXC_CCM_CCGR1, MXC_CCM_CCGRx_CG9_OFFSET, | 1200 | DEFINE_CLOCK(i2c1_clk, 0, MXC_CCM_CCGR1, MXC_CCM_CCGRx_CG9_OFFSET, |
1196 | NULL, NULL, &ipg_clk, NULL); | 1201 | NULL, NULL, &ipg_clk, NULL); |
@@ -1283,6 +1288,8 @@ static struct clk_lookup mx51_lookups[] = { | |||
1283 | _REGISTER_CLOCK("imx-uart.2", NULL, uart3_clk) | 1288 | _REGISTER_CLOCK("imx-uart.2", NULL, uart3_clk) |
1284 | _REGISTER_CLOCK(NULL, "gpt", gpt_clk) | 1289 | _REGISTER_CLOCK(NULL, "gpt", gpt_clk) |
1285 | _REGISTER_CLOCK("fec.0", NULL, fec_clk) | 1290 | _REGISTER_CLOCK("fec.0", NULL, fec_clk) |
1291 | _REGISTER_CLOCK("mxc_pwm.0", "pwm", pwm1_clk) | ||
1292 | _REGISTER_CLOCK("mxc_pwm.1", "pwm", pwm2_clk) | ||
1286 | _REGISTER_CLOCK("imx-i2c.0", NULL, i2c1_clk) | 1293 | _REGISTER_CLOCK("imx-i2c.0", NULL, i2c1_clk) |
1287 | _REGISTER_CLOCK("imx-i2c.1", NULL, i2c2_clk) | 1294 | _REGISTER_CLOCK("imx-i2c.1", NULL, i2c2_clk) |
1288 | _REGISTER_CLOCK("imx-i2c.2", NULL, hsi2c_clk) | 1295 | _REGISTER_CLOCK("imx-i2c.2", NULL, hsi2c_clk) |
diff --git a/arch/arm/plat-mxc/pwm.c b/arch/arm/plat-mxc/pwm.c index c36f2630ed93..7a61ef8f471a 100644 --- a/arch/arm/plat-mxc/pwm.c +++ b/arch/arm/plat-mxc/pwm.c | |||
@@ -57,7 +57,7 @@ int pwm_config(struct pwm_device *pwm, int duty_ns, int period_ns) | |||
57 | if (pwm == NULL || period_ns == 0 || duty_ns > period_ns) | 57 | if (pwm == NULL || period_ns == 0 || duty_ns > period_ns) |
58 | return -EINVAL; | 58 | return -EINVAL; |
59 | 59 | ||
60 | if (cpu_is_mx27() || cpu_is_mx3() || cpu_is_mx25()) { | 60 | if (cpu_is_mx27() || cpu_is_mx3() || cpu_is_mx25() || cpu_is_mx51()) { |
61 | unsigned long long c; | 61 | unsigned long long c; |
62 | unsigned long period_cycles, duty_cycles, prescale; | 62 | unsigned long period_cycles, duty_cycles, prescale; |
63 | u32 cr; | 63 | u32 cr; |