diff options
author | Fabio Estevam <fabio.estevam@freescale.com> | 2010-12-01 08:11:46 -0500 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2011-01-12 08:50:09 -0500 |
commit | 076762aa52de48688f6e1b6999fe58d736479f37 (patch) | |
tree | d460dbcd2fe450c49b367aa6e1ac9059240a564f | |
parent | dbc4245bb520580fc1b01105727fde7d7cbe452d (diff) |
ARM: mx5: dynamically allocate pwm devices
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | arch/arm/mach-mx5/devices-imx51.h | 4 | ||||
-rw-r--r-- | arch/arm/plat-mxc/devices/platform-mxc_pwm.c | 9 | ||||
-rw-r--r-- | arch/arm/plat-mxc/include/mach/mx51.h | 4 |
3 files changed, 15 insertions, 2 deletions
diff --git a/arch/arm/mach-mx5/devices-imx51.h b/arch/arm/mach-mx5/devices-imx51.h index 6302e4670000..39183ee56dd6 100644 --- a/arch/arm/mach-mx5/devices-imx51.h +++ b/arch/arm/mach-mx5/devices-imx51.h | |||
@@ -47,3 +47,7 @@ extern const struct imx_spi_imx_data imx51_ecspi_data[] __initconst; | |||
47 | extern const struct imx_imx2_wdt_data imx51_imx2_wdt_data[] __initconst; | 47 | extern const struct imx_imx2_wdt_data imx51_imx2_wdt_data[] __initconst; |
48 | #define imx51_add_imx2_wdt(id, pdata) \ | 48 | #define imx51_add_imx2_wdt(id, pdata) \ |
49 | imx_add_imx2_wdt(&imx51_imx2_wdt_data[id]) | 49 | imx_add_imx2_wdt(&imx51_imx2_wdt_data[id]) |
50 | |||
51 | extern const struct imx_mxc_pwm_data imx51_mxc_pwm_data[] __initconst; | ||
52 | #define imx51_add_mxc_pwm(id, pdata) \ | ||
53 | imx_add_mxc_pwm(&imx51_mxc_pwm_data[id], pdata) | ||
diff --git a/arch/arm/plat-mxc/devices/platform-mxc_pwm.c b/arch/arm/plat-mxc/devices/platform-mxc_pwm.c index 3d8ebdba38ee..b0c4ae298111 100644 --- a/arch/arm/plat-mxc/devices/platform-mxc_pwm.c +++ b/arch/arm/plat-mxc/devices/platform-mxc_pwm.c | |||
@@ -40,6 +40,15 @@ const struct imx_mxc_pwm_data imx27_mxc_pwm_data __initconst = | |||
40 | imx_mxc_pwm_data_entry_single(MX27, 0, , SZ_4K); | 40 | imx_mxc_pwm_data_entry_single(MX27, 0, , SZ_4K); |
41 | #endif /* ifdef CONFIG_SOC_IMX27 */ | 41 | #endif /* ifdef CONFIG_SOC_IMX27 */ |
42 | 42 | ||
43 | #ifdef CONFIG_SOC_IMX51 | ||
44 | const struct imx_mxc_pwm_data imx51_mxc_pwm_data[] __initconst = { | ||
45 | #define imx51_mxc_pwm_data_entry(_id, _hwid) \ | ||
46 | imx_mxc_pwm_data_entry(MX51, _id, _hwid, SZ_16K) | ||
47 | imx51_mxc_pwm_data_entry(0, 1), | ||
48 | imx51_mxc_pwm_data_entry(1, 2), | ||
49 | }; | ||
50 | #endif /* ifdef CONFIG_SOC_IMX51 */ | ||
51 | |||
43 | struct platform_device *__init imx_add_mxc_pwm( | 52 | struct platform_device *__init imx_add_mxc_pwm( |
44 | const struct imx_mxc_pwm_data *data) | 53 | const struct imx_mxc_pwm_data *data) |
45 | { | 54 | { |
diff --git a/arch/arm/plat-mxc/include/mach/mx51.h b/arch/arm/plat-mxc/include/mach/mx51.h index 873807f96d70..ec9ae5afa09a 100644 --- a/arch/arm/plat-mxc/include/mach/mx51.h +++ b/arch/arm/plat-mxc/include/mach/mx51.h | |||
@@ -302,7 +302,7 @@ | |||
302 | #define MX51_MXC_INT_WDOG1 58 | 302 | #define MX51_MXC_INT_WDOG1 58 |
303 | #define MX51_MXC_INT_WDOG2 59 | 303 | #define MX51_MXC_INT_WDOG2 59 |
304 | #define MX51_MXC_INT_KPP 60 | 304 | #define MX51_MXC_INT_KPP 60 |
305 | #define MX51_MXC_INT_PWM1 61 | 305 | #define MX51_INT_PWM1 61 |
306 | #define MX51_INT_I2C1 62 | 306 | #define MX51_INT_I2C1 62 |
307 | #define MX51_INT_I2C2 63 | 307 | #define MX51_INT_I2C2 63 |
308 | #define MX51_MXC_INT_HS_I2C 64 | 308 | #define MX51_MXC_INT_HS_I2C 64 |
@@ -335,7 +335,7 @@ | |||
335 | #define MX51_MXC_INT_SPDIF 91 | 335 | #define MX51_MXC_INT_SPDIF 91 |
336 | #define MX51_MXC_INT_TVE 92 | 336 | #define MX51_MXC_INT_TVE 92 |
337 | #define MX51_MXC_INT_FIRI 93 | 337 | #define MX51_MXC_INT_FIRI 93 |
338 | #define MX51_MXC_INT_PWM2 94 | 338 | #define MX51_INT_PWM2 94 |
339 | #define MX51_MXC_INT_SLIM_EXP 95 | 339 | #define MX51_MXC_INT_SLIM_EXP 95 |
340 | #define MX51_INT_SSI3 96 | 340 | #define MX51_INT_SSI3 96 |
341 | #define MX51_MXC_INT_EMI_BOOT 97 | 341 | #define MX51_MXC_INT_EMI_BOOT 97 |