ARM: mx5: dynamically allocate pwm devices
authorFabio Estevam <fabio.estevam@freescale.com>
Wed, 1 Dec 2010 13:11:46 +0000 (11:11 -0200)
committerSascha Hauer <s.hauer@pengutronix.de>
Wed, 12 Jan 2011 13:50:09 +0000 (14:50 +0100)
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
arch/arm/mach-mx5/devices-imx51.h
arch/arm/plat-mxc/devices/platform-mxc_pwm.c
arch/arm/plat-mxc/include/mach/mx51.h

index 6302e467000027e825ff54f3578106c7f121e713..39183ee56dd660909e74084215c8e79fa46f5cc9 100644 (file)
@@ -47,3 +47,7 @@ extern const struct imx_spi_imx_data imx51_ecspi_data[] __initconst;
 extern const struct imx_imx2_wdt_data imx51_imx2_wdt_data[] __initconst;
 #define imx51_add_imx2_wdt(id, pdata)  \
        imx_add_imx2_wdt(&imx51_imx2_wdt_data[id])
+
+extern const struct imx_mxc_pwm_data imx51_mxc_pwm_data[] __initconst;
+#define imx51_add_mxc_pwm(id, pdata)   \
+       imx_add_mxc_pwm(&imx51_mxc_pwm_data[id], pdata)
index 3d8ebdba38eed86771e3bdd6dab97fa7e3d73c18..b0c4ae298111feefe47dc6d4701e0b73823c5af1 100644 (file)
@@ -40,6 +40,15 @@ const struct imx_mxc_pwm_data imx27_mxc_pwm_data __initconst =
        imx_mxc_pwm_data_entry_single(MX27, 0, , SZ_4K);
 #endif /* ifdef CONFIG_SOC_IMX27 */
 
+#ifdef CONFIG_SOC_IMX51
+const struct imx_mxc_pwm_data imx51_mxc_pwm_data[] __initconst = {
+#define imx51_mxc_pwm_data_entry(_id, _hwid)                           \
+       imx_mxc_pwm_data_entry(MX51, _id, _hwid, SZ_16K)
+       imx51_mxc_pwm_data_entry(0, 1),
+       imx51_mxc_pwm_data_entry(1, 2),
+};
+#endif /* ifdef CONFIG_SOC_IMX51 */
+
 struct platform_device *__init imx_add_mxc_pwm(
                const struct imx_mxc_pwm_data *data)
 {
index 873807f96d705654967afbae517aaaad046e3c94..ec9ae5afa09a5a919842236806c341d9cc32fdc4 100644 (file)
 #define MX51_MXC_INT_WDOG1             58
 #define MX51_MXC_INT_WDOG2             59
 #define MX51_MXC_INT_KPP               60
-#define MX51_MXC_INT_PWM1              61
+#define MX51_INT_PWM1                  61
 #define MX51_INT_I2C1                  62
 #define MX51_INT_I2C2                  63
 #define MX51_MXC_INT_HS_I2C            64
 #define MX51_MXC_INT_SPDIF             91
 #define MX51_MXC_INT_TVE               92
 #define MX51_MXC_INT_FIRI              93
-#define MX51_MXC_INT_PWM2              94
+#define MX51_INT_PWM2                  94
 #define MX51_MXC_INT_SLIM_EXP          95
 #define MX51_INT_SSI3                  96
 #define MX51_MXC_INT_EMI_BOOT          97