Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
platform-imx-keypad.c
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2010 Pengutronix
3  * Uwe Kleine-Koenig <[email protected]>
4  *
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>
11 
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, \
17  }
18 
19 #ifdef CONFIG_SOC_IMX21
22 #endif /* ifdef CONFIG_SOC_IMX21 */
23 
24 #ifdef CONFIG_SOC_IMX25
25 const struct imx_imx_keypad_data imx25_imx_keypad_data __initconst =
27 #endif /* ifdef CONFIG_SOC_IMX25 */
28 
29 #ifdef CONFIG_SOC_IMX27
30 const struct imx_imx_keypad_data imx27_imx_keypad_data __initconst =
32 #endif /* ifdef CONFIG_SOC_IMX27 */
33 
34 #ifdef CONFIG_SOC_IMX31
35 const struct imx_imx_keypad_data imx31_imx_keypad_data __initconst =
37 #endif /* ifdef CONFIG_SOC_IMX31 */
38 
39 #ifdef CONFIG_SOC_IMX35
40 const struct imx_imx_keypad_data imx35_imx_keypad_data __initconst =
42 #endif /* ifdef CONFIG_SOC_IMX35 */
43 
44 #ifdef CONFIG_SOC_IMX51
45 const struct imx_imx_keypad_data imx51_imx_keypad_data __initconst =
47 #endif /* ifdef CONFIG_SOC_IMX51 */
48 
49 #ifdef CONFIG_SOC_IMX53
50 const struct imx_imx_keypad_data imx53_imx_keypad_data __initconst =
52 #endif /* ifdef CONFIG_SOC_IMX53 */
53 
55  const struct imx_imx_keypad_data *data,
56  const struct matrix_keymap_data *pdata)
57 {
58  struct resource res[] = {
59  {
60  .start = data->iobase,
61  .end = data->iobase + data->iosize - 1,
62  .flags = IORESOURCE_MEM,
63  }, {
64  .start = data->irq,
65  .end = data->irq,
66  .flags = IORESOURCE_IRQ,
67  },
68  };
69 
70  return imx_add_platform_device("imx-keypad", -1,
71  res, ARRAY_SIZE(res), pdata, sizeof(*pdata));
72 }