Merge tag 'pm+acpi-3.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael...
[deliverable/linux.git] / arch / arm / mach-imx / devices / platform-imx-keypad.c
CommitLineData
3f880141
UKK
1/*
2 * Copyright (C) 2010 Pengutronix
3 * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
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 */
50f2de61 9#include "../hardware.h"
e0557c0d 10#include "devices-common.h"
3f880141 11
ab9cee4b 12#define imx_imx_keypad_data_entry_single(soc, _size) \
3f880141
UKK
13 { \
14 .iobase = soc ## _KPP_BASE_ADDR, \
ab9cee4b 15 .iosize = _size, \
3f880141
UKK
16 .irq = soc ## _INT_KPP, \
17 }
18
19#ifdef CONFIG_SOC_IMX21
20const struct imx_imx_keypad_data imx21_imx_keypad_data __initconst =
ab9cee4b 21 imx_imx_keypad_data_entry_single(MX21, SZ_16);
3f880141
UKK
22#endif /* ifdef CONFIG_SOC_IMX21 */
23
972cc482 24#ifdef CONFIG_SOC_IMX25
ab9cee4b
UKK
25const struct imx_imx_keypad_data imx25_imx_keypad_data __initconst =
26 imx_imx_keypad_data_entry_single(MX25, SZ_16K);
972cc482 27#endif /* ifdef CONFIG_SOC_IMX25 */
ab9cee4b 28
3f880141
UKK
29#ifdef CONFIG_SOC_IMX27
30const struct imx_imx_keypad_data imx27_imx_keypad_data __initconst =
ab9cee4b 31 imx_imx_keypad_data_entry_single(MX27, SZ_16);
3f880141
UKK
32#endif /* ifdef CONFIG_SOC_IMX27 */
33
d690b4c4
UKK
34#ifdef CONFIG_SOC_IMX31
35const 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 */
38
39#ifdef CONFIG_SOC_IMX35
40const 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 */
43
a5fcfef0
FE
44#ifdef CONFIG_SOC_IMX51
45const 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 */
48
22785de5
FE
49#ifdef CONFIG_SOC_IMX53
50const struct imx_imx_keypad_data imx53_imx_keypad_data __initconst =
51 imx_imx_keypad_data_entry_single(MX53, SZ_16);
52#endif /* ifdef CONFIG_SOC_IMX53 */
53
3f880141
UKK
54struct platform_device *__init imx_add_imx_keypad(
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,
ab9cee4b 61 .end = data->iobase + data->iosize - 1,
3f880141
UKK
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}
This page took 0.244346 seconds and 5 git commands to generate.