mm: move shmem prototypes to shmem_fs.h
[linux/fpc-iii.git] / arch / arm / plat-mxc / devices / platform-imx-keypad.c
blob26366114b021aadc9cb49173de6c70c0d4e6227c
1 /*
2 * Copyright (C) 2010 Pengutronix
3 * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
5 * This program is free software; you can redistribute it and/or modify it under
6 * the terms of the GNU General Public License version 2 as published by the
7 * Free Software Foundation.
8 */
9 #include <mach/hardware.h>
10 #include <mach/devices-common.h>
12 #define imx_imx_keypad_data_entry_single(soc, _size) \
13 { \
14 .iobase = soc ## _KPP_BASE_ADDR, \
15 .iosize = _size, \
16 .irq = soc ## _INT_KPP, \
19 #ifdef CONFIG_SOC_IMX21
20 const struct imx_imx_keypad_data imx21_imx_keypad_data __initconst =
21 imx_imx_keypad_data_entry_single(MX21, SZ_16);
22 #endif /* ifdef CONFIG_SOC_IMX21 */
24 #ifdef CONFIG_SOC_IMX25
25 const struct imx_imx_keypad_data imx25_imx_keypad_data __initconst =
26 imx_imx_keypad_data_entry_single(MX25, SZ_16K);
27 #endif /* ifdef CONFIG_SOC_IMX25 */
29 #ifdef CONFIG_SOC_IMX27
30 const struct imx_imx_keypad_data imx27_imx_keypad_data __initconst =
31 imx_imx_keypad_data_entry_single(MX27, SZ_16);
32 #endif /* ifdef CONFIG_SOC_IMX27 */
34 #ifdef CONFIG_SOC_IMX31
35 const struct imx_imx_keypad_data imx31_imx_keypad_data __initconst =
36 imx_imx_keypad_data_entry_single(MX31, SZ_16);
37 #endif /* ifdef CONFIG_SOC_IMX31 */
39 #ifdef CONFIG_SOC_IMX35
40 const struct imx_imx_keypad_data imx35_imx_keypad_data __initconst =
41 imx_imx_keypad_data_entry_single(MX35, SZ_16);
42 #endif /* ifdef CONFIG_SOC_IMX35 */
44 #ifdef CONFIG_SOC_IMX51
45 const struct imx_imx_keypad_data imx51_imx_keypad_data __initconst =
46 imx_imx_keypad_data_entry_single(MX51, SZ_16);
47 #endif /* ifdef CONFIG_SOC_IMX51 */
49 struct platform_device *__init imx_add_imx_keypad(
50 const struct imx_imx_keypad_data *data,
51 const struct matrix_keymap_data *pdata)
53 struct resource res[] = {
55 .start = data->iobase,
56 .end = data->iobase + data->iosize - 1,
57 .flags = IORESOURCE_MEM,
58 }, {
59 .start = data->irq,
60 .end = data->irq,
61 .flags = IORESOURCE_IRQ,
65 return imx_add_platform_device("imx-keypad", -1,
66 res, ARRAY_SIZE(res), pdata, sizeof(*pdata));