diff options
author | Dinh Nguyen <Dinh.Nguyen@freescale.com> | 2010-10-23 10:12:46 -0400 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2010-10-26 10:24:04 -0400 |
commit | 47c5382287c863473ac2c11d18d6f4100e9dd5b8 (patch) | |
tree | 6b9512554cca806c4758d5b3a9a8c9465245228f /arch/arm | |
parent | 4a74bddcc52e5d76681f4910203c9d435370f04c (diff) |
ARM: imx: Add gpio-keys to plat-mxc
Add imx_add_gpio_keys function to add gpio-keys in plat-mxc
Signed-off-by: Dinh Nguyen <Dinh.Nguyen@freescale.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/plat-mxc/devices/Kconfig | 4 | ||||
-rw-r--r-- | arch/arm/plat-mxc/devices/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/plat-mxc/devices/platform-gpio_keys.c | 27 | ||||
-rw-r--r-- | arch/arm/plat-mxc/include/mach/devices-common.h | 4 | ||||
-rw-r--r-- | arch/arm/plat-mxc/include/mach/iomux-mx51.h | 2 |
5 files changed, 38 insertions, 0 deletions
diff --git a/arch/arm/plat-mxc/devices/Kconfig b/arch/arm/plat-mxc/devices/Kconfig index 26e745b110a7..9aa6f3ea9012 100644 --- a/arch/arm/plat-mxc/devices/Kconfig +++ b/arch/arm/plat-mxc/devices/Kconfig | |||
@@ -9,6 +9,10 @@ config IMX_HAVE_PLATFORM_FLEXCAN | |||
9 | select HAVE_CAN_FLEXCAN if CAN | 9 | select HAVE_CAN_FLEXCAN if CAN |
10 | bool | 10 | bool |
11 | 11 | ||
12 | config IMX_HAVE_PLATFORM_GPIO_KEYS | ||
13 | bool | ||
14 | default y if ARCH_MX51 | ||
15 | |||
12 | config IMX_HAVE_PLATFORM_IMX_I2C | 16 | config IMX_HAVE_PLATFORM_IMX_I2C |
13 | bool | 17 | bool |
14 | 18 | ||
diff --git a/arch/arm/plat-mxc/devices/Makefile b/arch/arm/plat-mxc/devices/Makefile index 0a3c1f089413..45aefeb283ba 100644 --- a/arch/arm/plat-mxc/devices/Makefile +++ b/arch/arm/plat-mxc/devices/Makefile | |||
@@ -1,6 +1,7 @@ | |||
1 | obj-$(CONFIG_IMX_HAVE_PLATFORM_ESDHC) += platform-esdhc.o | 1 | obj-$(CONFIG_IMX_HAVE_PLATFORM_ESDHC) += platform-esdhc.o |
2 | obj-$(CONFIG_IMX_HAVE_PLATFORM_FEC) += platform-fec.o | 2 | obj-$(CONFIG_IMX_HAVE_PLATFORM_FEC) += platform-fec.o |
3 | obj-$(CONFIG_IMX_HAVE_PLATFORM_FLEXCAN) += platform-flexcan.o | 3 | obj-$(CONFIG_IMX_HAVE_PLATFORM_FLEXCAN) += platform-flexcan.o |
4 | obj-$(CONFIG_IMX_HAVE_PLATFORM_GPIO_KEYS) += platform-gpio_keys.o | ||
4 | obj-y += platform-imx-dma.o | 5 | obj-y += platform-imx-dma.o |
5 | obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_I2C) += platform-imx-i2c.o | 6 | obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_I2C) += platform-imx-i2c.o |
6 | obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_SSI) += platform-imx-ssi.o | 7 | obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_SSI) += platform-imx-ssi.o |
diff --git a/arch/arm/plat-mxc/devices/platform-gpio_keys.c b/arch/arm/plat-mxc/devices/platform-gpio_keys.c new file mode 100644 index 000000000000..1c53a532ea0e --- /dev/null +++ b/arch/arm/plat-mxc/devices/platform-gpio_keys.c | |||
@@ -0,0 +1,27 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 Freescale Semiconductor, Inc. All Rights Reserved. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or | ||
5 | * modify it under the terms of the GNU General Public License | ||
6 | * as published by the Free Software Foundation; either version 2 | ||
7 | * of the License, or (at your option) any later version. | ||
8 | * This program is distributed in the hope that it will be useful, | ||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | * GNU General Public License for more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License | ||
14 | * along with this program; if not, write to the Free Software | ||
15 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
16 | * Boston, MA 02110-1301, USA. | ||
17 | */ | ||
18 | #include <asm/sizes.h> | ||
19 | #include <mach/hardware.h> | ||
20 | #include <mach/devices-common.h> | ||
21 | |||
22 | struct platform_device *__init imx_add_gpio_keys( | ||
23 | const struct gpio_keys_platform_data *pdata) | ||
24 | { | ||
25 | return imx_add_platform_device("gpio-keys", -1, NULL, | ||
26 | 0, pdata, sizeof(*pdata)); | ||
27 | } | ||
diff --git a/arch/arm/plat-mxc/include/mach/devices-common.h b/arch/arm/plat-mxc/include/mach/devices-common.h index 86d7575a564d..8c6896fd1e5f 100644 --- a/arch/arm/plat-mxc/include/mach/devices-common.h +++ b/arch/arm/plat-mxc/include/mach/devices-common.h | |||
@@ -29,6 +29,10 @@ struct platform_device *__init imx_add_flexcan(int id, | |||
29 | resource_size_t irq, | 29 | resource_size_t irq, |
30 | const struct flexcan_platform_data *pdata); | 30 | const struct flexcan_platform_data *pdata); |
31 | 31 | ||
32 | #include <linux/gpio_keys.h> | ||
33 | struct platform_device *__init imx_add_gpio_keys( | ||
34 | const struct gpio_keys_platform_data *pdata); | ||
35 | |||
32 | #include <mach/i2c.h> | 36 | #include <mach/i2c.h> |
33 | struct imx_imx_i2c_data { | 37 | struct imx_imx_i2c_data { |
34 | int id; | 38 | int id; |
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx51.h b/arch/arm/plat-mxc/include/mach/iomux-mx51.h index e46b1c2836d4..d7a41e9a2605 100644 --- a/arch/arm/plat-mxc/include/mach/iomux-mx51.h +++ b/arch/arm/plat-mxc/include/mach/iomux-mx51.h | |||
@@ -45,6 +45,8 @@ typedef enum iomux_config { | |||
45 | PAD_CTL_PKE | PAD_CTL_HYS) | 45 | PAD_CTL_PKE | PAD_CTL_HYS) |
46 | #define MX51_GPIO_PAD_CTRL (PAD_CTL_DSE_HIGH | PAD_CTL_PKE | \ | 46 | #define MX51_GPIO_PAD_CTRL (PAD_CTL_DSE_HIGH | PAD_CTL_PKE | \ |
47 | PAD_CTL_SRE_FAST) | 47 | PAD_CTL_SRE_FAST) |
48 | #define MX51_GPIO_PAD_CTRL_2 (PAD_CTL_SRE_FAST | PAD_CTL_DSE_HIGH | \ | ||
49 | PAD_CTL_PUS_100K_UP) | ||
48 | #define MX51_ECSPI_PAD_CTRL (PAD_CTL_HYS | PAD_CTL_PKE | PAD_CTL_DSE_HIGH | \ | 50 | #define MX51_ECSPI_PAD_CTRL (PAD_CTL_HYS | PAD_CTL_PKE | PAD_CTL_DSE_HIGH | \ |
49 | PAD_CTL_SRE_FAST) | 51 | PAD_CTL_SRE_FAST) |
50 | #define MX51_SDHCI_PAD_CTRL (PAD_CTL_DSE_HIGH | PAD_CTL_PUS_47K_UP | \ | 52 | #define MX51_SDHCI_PAD_CTRL (PAD_CTL_DSE_HIGH | PAD_CTL_PUS_47K_UP | \ |