]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ARM: mx3: dynamically allocate imx-keypad devices
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Tue, 16 Nov 2010 20:27:33 +0000 (21:27 +0100)
committerUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Fri, 19 Nov 2010 20:54:36 +0000 (21:54 +0100)
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
arch/arm/mach-mx3/Kconfig
arch/arm/mach-mx3/devices-imx31.h
arch/arm/mach-mx3/devices-imx35.h
arch/arm/mach-mx3/devices.c
arch/arm/mach-mx3/devices.h
arch/arm/mach-mx3/mach-mx31_3ds.c
arch/arm/plat-mxc/devices/platform-imx-keypad.c

index bcfcf9ad76e534a87b591fd64f46450a9216e1ab..84e4788898a51b8847ef60d251bea5f13ea6c90c 100644 (file)
@@ -91,6 +91,7 @@ config MACH_MX31_3DS
        select SOC_IMX31
        select MXC_DEBUG_BOARD
        select IMX_HAVE_PLATFORM_FSL_USB2_UDC
+       select IMX_HAVE_PLATFORM_IMX_KEYPAD
        select IMX_HAVE_PLATFORM_IMX_UART
        select IMX_HAVE_PLATFORM_MXC_NAND
        select IMX_HAVE_PLATFORM_SPI_IMX
index 109f0bc3b52461ddec95d69f3b2c5bc61bdd08c0..40f4e848a671c6593859a2e3c9ef4e2222aad46e 100644 (file)
@@ -24,6 +24,10 @@ extern const struct imx_imx_i2c_data imx31_imx_i2c_data[] __initconst;
 #define imx31_add_imx_i2c1(pdata)      imx31_add_imx_i2c(1, pdata)
 #define imx31_add_imx_i2c2(pdata)      imx31_add_imx_i2c(2, pdata)
 
+extern const struct imx_imx_keypad_data imx31_imx_keypad_data __initconst;
+#define imx31_add_imx_keypad(pdata)    \
+       imx_add_imx_keypad(&imx31_imx_keypad_data, pdata)
+
 extern const struct imx_imx_ssi_data imx31_imx_ssi_data[] __initconst;
 #define imx31_add_imx_ssi(id, pdata)    \
        imx_add_imx_ssi(&imx31_imx_ssi_data[id], pdata)
index 763ee9754773643dd19efb9797100a7e2f1b2e92..c9fdded7ff39f5a7c476bdd1c9f6d555685dfd96 100644 (file)
@@ -34,6 +34,10 @@ extern const struct imx_imx_i2c_data imx35_imx_i2c_data[] __initconst;
 #define imx35_add_imx_i2c1(pdata)      imx35_add_imx_i2c(1, pdata)
 #define imx35_add_imx_i2c2(pdata)      imx35_add_imx_i2c(2, pdata)
 
+extern const struct imx_imx_keypad_data imx35_imx_keypad_data __initconst;
+#define imx31_add_imx_keypad(pdata)    \
+       imx_add_imx_keypad(&imx35_imx_keypad_data, pdata)
+
 extern const struct imx_imx_ssi_data imx35_imx_ssi_data[] __initconst;
 #define imx35_add_imx_ssi(id, pdata)    \
        imx_add_imx_ssi(&imx35_imx_ssi_data[id], pdata)
index 448fe5614e4f40f247dec501a902fcd9ea26ff7a..b6672db788fb8145ff41931ffc5849335ef61535 100644 (file)
@@ -113,22 +113,3 @@ struct platform_device imx_rtc_device0 = {
        .num_resources  = ARRAY_SIZE(imx_rtc_resources),
        .resource       = imx_rtc_resources,
 };
-
-static struct resource imx_kpp_resources[] = {
-       {
-               .start  = MX3x_KPP_BASE_ADDR,
-               .end    = MX3x_KPP_BASE_ADDR + 0xf,
-               .flags  = IORESOURCE_MEM
-       }, {
-               .start  = MX3x_INT_KPP,
-               .end    = MX3x_INT_KPP,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-struct platform_device imx_kpp_device = {
-       .name = "imx-keypad",
-       .id = -1,
-       .num_resources = ARRAY_SIZE(imx_kpp_resources),
-       .resource = imx_kpp_resources,
-};
index 2f9f87725e7b29fb57f2489b942b66c65c26031e..121962c568d10ca449ea00f1150489de2ea5746a 100644 (file)
@@ -2,4 +2,3 @@ extern struct platform_device mx3_ipu;
 extern struct platform_device mx3_fb;
 extern struct platform_device mx3_camera;
 extern struct platform_device imx_rtc_device0;
-extern struct platform_device imx_kpp_device;
index 1b46f738b310da9f6e280c5ca2224b0a1b149f0c..3dea40743f8184c0042313f7ab7276fce3664eed 100644 (file)
@@ -22,7 +22,6 @@
 #include <linux/mfd/mc13783.h>
 #include <linux/spi/spi.h>
 #include <linux/regulator/machine.h>
-#include <linux/input/matrix_keypad.h>
 
 #include <mach/hardware.h>
 #include <asm/mach-types.h>
@@ -101,7 +100,7 @@ static const uint32_t mx31_3ds_keymap[] = {
        KEY(2, 3, KEY_F10),
 };
 
-static struct matrix_keymap_data mx31_3ds_keymap_data = {
+static const struct matrix_keymap_data mx31_3ds_keymap_data __initconst = {
        .keymap         = mx31_3ds_keymap,
        .keymap_size    = ARRAY_SIZE(mx31_3ds_keymap),
 };
@@ -245,7 +244,7 @@ static void __init mxc_board_init(void)
        spi_register_board_info(mx31_3ds_spi_devs,
                                                ARRAY_SIZE(mx31_3ds_spi_devs));
 
-       mxc_register_device(&imx_kpp_device, &mx31_3ds_keymap_data);
+       imx31_add_imx_keypad(&mx31_3ds_keymap_data);
 
        mx31_3ds_usbotg_init();
        imx31_add_fsl_usb2_udc(&usbotg_pdata);
index 5f3b36777c0489bcf766d4d46f58876d123b07ae..40238f0b8643ab55de0bb0840907a2143a1f6fe0 100644 (file)
@@ -31,6 +31,16 @@ const struct imx_imx_keypad_data imx27_imx_keypad_data __initconst =
        imx_imx_keypad_data_entry_single(MX27, SZ_16);
 #endif /* ifdef CONFIG_SOC_IMX27 */
 
+#ifdef CONFIG_SOC_IMX31
+const struct imx_imx_keypad_data imx31_imx_keypad_data __initconst =
+       imx_imx_keypad_data_entry_single(MX31, SZ_16);
+#endif /* ifdef CONFIG_SOC_IMX31 */
+
+#ifdef CONFIG_SOC_IMX35
+const struct imx_imx_keypad_data imx35_imx_keypad_data __initconst =
+       imx_imx_keypad_data_entry_single(MX35, SZ_16);
+#endif /* ifdef CONFIG_SOC_IMX35 */
+
 struct platform_device *__init imx_add_imx_keypad(
                const struct imx_imx_keypad_data *data,
                const struct matrix_keymap_data *pdata)