diff options
author | Joonyoung Shim <jy0922.shim@samsung.com> | 2010-06-21 03:28:28 -0400 |
---|---|---|
committer | Kukjin Kim <kgene.kim@samsung.com> | 2010-08-05 05:31:01 -0400 |
commit | e7d0628ceacf59edc1c9c390a3117fc177486817 (patch) | |
tree | 57169999a7aa0beb64ab02556d31aa170c595be5 | |
parent | 6901bbc8024524c9b4bb5d7a38c84c83e4646eeb (diff) |
ARM: S5PV210: Add keypad device helpers
This patch adds the keypad device platform helpers for S5PV210 cpu.
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
-rw-r--r-- | arch/arm/mach-s5pv210/Kconfig | 5 | ||||
-rw-r--r-- | arch/arm/mach-s5pv210/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/mach-s5pv210/cpu.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-s5pv210/include/mach/map.h | 3 | ||||
-rw-r--r-- | arch/arm/mach-s5pv210/setup-keypad.c | 34 | ||||
-rw-r--r-- | arch/arm/plat-samsung/include/plat/keypad-core.h | 31 |
6 files changed, 78 insertions, 0 deletions
diff --git a/arch/arm/mach-s5pv210/Kconfig b/arch/arm/mach-s5pv210/Kconfig index e65825f47f0..1244d612872 100644 --- a/arch/arm/mach-s5pv210/Kconfig +++ b/arch/arm/mach-s5pv210/Kconfig | |||
@@ -37,6 +37,11 @@ config S5PV210_SETUP_FB_24BPP | |||
37 | help | 37 | help |
38 | Common setup code for S5PV210 with an 24bpp RGB display helper. | 38 | Common setup code for S5PV210 with an 24bpp RGB display helper. |
39 | 39 | ||
40 | config S5PV210_SETUP_KEYPAD | ||
41 | bool | ||
42 | help | ||
43 | Common setup code for keypad. | ||
44 | |||
40 | config S5PV210_SETUP_SDHCI | 45 | config S5PV210_SETUP_SDHCI |
41 | bool | 46 | bool |
42 | select S5PV210_SETUP_SDHCI_GPIO | 47 | select S5PV210_SETUP_SDHCI_GPIO |
diff --git a/arch/arm/mach-s5pv210/Makefile b/arch/arm/mach-s5pv210/Makefile index af557856b12..05048c5aa4c 100644 --- a/arch/arm/mach-s5pv210/Makefile +++ b/arch/arm/mach-s5pv210/Makefile | |||
@@ -32,5 +32,6 @@ obj-$(CONFIG_S5PV210_SETUP_FB_24BPP) += setup-fb-24bpp.o | |||
32 | obj-$(CONFIG_S5PV210_SETUP_I2C1) += setup-i2c1.o | 32 | obj-$(CONFIG_S5PV210_SETUP_I2C1) += setup-i2c1.o |
33 | obj-$(CONFIG_S5PV210_SETUP_I2C2) += setup-i2c2.o | 33 | obj-$(CONFIG_S5PV210_SETUP_I2C2) += setup-i2c2.o |
34 | obj-$(CONFIG_S5PV210_SETUP_IDE) += setup-ide.o | 34 | obj-$(CONFIG_S5PV210_SETUP_IDE) += setup-ide.o |
35 | obj-$(CONFIG_S5PV210_SETUP_KEYPAD) += setup-keypad.o | ||
35 | obj-$(CONFIG_S5PV210_SETUP_SDHCI) += setup-sdhci.o | 36 | obj-$(CONFIG_S5PV210_SETUP_SDHCI) += setup-sdhci.o |
36 | obj-$(CONFIG_S5PV210_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o | 37 | obj-$(CONFIG_S5PV210_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o |
diff --git a/arch/arm/mach-s5pv210/cpu.c b/arch/arm/mach-s5pv210/cpu.c index 8c4fdcde7f3..15e983a3f09 100644 --- a/arch/arm/mach-s5pv210/cpu.c +++ b/arch/arm/mach-s5pv210/cpu.c | |||
@@ -34,6 +34,7 @@ | |||
34 | #include <plat/s5pv210.h> | 34 | #include <plat/s5pv210.h> |
35 | #include <plat/ata-core.h> | 35 | #include <plat/ata-core.h> |
36 | #include <plat/iic-core.h> | 36 | #include <plat/iic-core.h> |
37 | #include <plat/keypad-core.h> | ||
37 | #include <plat/sdhci.h> | 38 | #include <plat/sdhci.h> |
38 | 39 | ||
39 | /* Initial IO mappings */ | 40 | /* Initial IO mappings */ |
@@ -93,6 +94,9 @@ void __init s5pv210_map_io(void) | |||
93 | s3c_i2c0_setname("s3c2440-i2c"); | 94 | s3c_i2c0_setname("s3c2440-i2c"); |
94 | s3c_i2c1_setname("s3c2440-i2c"); | 95 | s3c_i2c1_setname("s3c2440-i2c"); |
95 | s3c_i2c2_setname("s3c2440-i2c"); | 96 | s3c_i2c2_setname("s3c2440-i2c"); |
97 | |||
98 | /* Use s5pv210-keypad instead of samsung-keypad */ | ||
99 | samsung_keypad_setname("s5pv210-keypad"); | ||
96 | } | 100 | } |
97 | 101 | ||
98 | void __init s5pv210_init_clocks(int xtal) | 102 | void __init s5pv210_init_clocks(int xtal) |
diff --git a/arch/arm/mach-s5pv210/include/mach/map.h b/arch/arm/mach-s5pv210/include/mach/map.h index 3846a0be2fa..d0af0c1a526 100644 --- a/arch/arm/mach-s5pv210/include/mach/map.h +++ b/arch/arm/mach-s5pv210/include/mach/map.h | |||
@@ -32,6 +32,8 @@ | |||
32 | #define S5PV210_PA_SPI0 0xE1300000 | 32 | #define S5PV210_PA_SPI0 0xE1300000 |
33 | #define S5PV210_PA_SPI1 0xE1400000 | 33 | #define S5PV210_PA_SPI1 0xE1400000 |
34 | 34 | ||
35 | #define S5PV210_PA_KEYPAD (0xE1600000) | ||
36 | |||
35 | #define S5PV210_PA_IIC0 (0xE1800000) | 37 | #define S5PV210_PA_IIC0 (0xE1800000) |
36 | #define S5PV210_PA_IIC1 (0xFAB00000) | 38 | #define S5PV210_PA_IIC1 (0xFAB00000) |
37 | #define S5PV210_PA_IIC2 (0xE1A00000) | 39 | #define S5PV210_PA_IIC2 (0xE1A00000) |
@@ -107,5 +109,6 @@ | |||
107 | 109 | ||
108 | #define SAMSUNG_PA_ADC S5PV210_PA_ADC | 110 | #define SAMSUNG_PA_ADC S5PV210_PA_ADC |
109 | #define SAMSUNG_PA_CFCON S5PV210_PA_CFCON | 111 | #define SAMSUNG_PA_CFCON S5PV210_PA_CFCON |
112 | #define SAMSUNG_PA_KEYPAD S5PV210_PA_KEYPAD | ||
110 | 113 | ||
111 | #endif /* __ASM_ARCH_MAP_H */ | 114 | #endif /* __ASM_ARCH_MAP_H */ |
diff --git a/arch/arm/mach-s5pv210/setup-keypad.c b/arch/arm/mach-s5pv210/setup-keypad.c new file mode 100644 index 00000000000..37b2790aafc --- /dev/null +++ b/arch/arm/mach-s5pv210/setup-keypad.c | |||
@@ -0,0 +1,34 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-s5pv210/setup-keypad.c | ||
3 | * | ||
4 | * Copyright (C) 2010 Samsung Electronics Co.Ltd | ||
5 | * Author: Joonyoung Shim <jy0922.shim@samsung.com> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify it | ||
8 | * under the terms of the GNU General Public License as published by the | ||
9 | * Free Software Foundation; either version 2 of the License, or (at your | ||
10 | * option) any later version. | ||
11 | * | ||
12 | */ | ||
13 | |||
14 | #include <linux/gpio.h> | ||
15 | #include <plat/gpio-cfg.h> | ||
16 | |||
17 | void samsung_keypad_cfg_gpio(unsigned int rows, unsigned int cols) | ||
18 | { | ||
19 | unsigned int gpio, end; | ||
20 | |||
21 | /* Set all the necessary GPH3 pins to special-function 3: KP_ROW[x] */ | ||
22 | end = S5PV210_GPH3(rows); | ||
23 | for (gpio = S5PV210_GPH3(0); gpio < end; gpio++) { | ||
24 | s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(3)); | ||
25 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); | ||
26 | } | ||
27 | |||
28 | /* Set all the necessary GPH2 pins to special-function 3: KP_COL[x] */ | ||
29 | end = S5PV210_GPH2(cols); | ||
30 | for (gpio = S5PV210_GPH2(0); gpio < end; gpio++) { | ||
31 | s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(3)); | ||
32 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); | ||
33 | } | ||
34 | } | ||
diff --git a/arch/arm/plat-samsung/include/plat/keypad-core.h b/arch/arm/plat-samsung/include/plat/keypad-core.h new file mode 100644 index 00000000000..d513e1b3a31 --- /dev/null +++ b/arch/arm/plat-samsung/include/plat/keypad-core.h | |||
@@ -0,0 +1,31 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/plat-samsung/include/plat/keypad-core.h | ||
3 | * | ||
4 | * Copyright (C) 2010 Samsung Electronics Co.Ltd | ||
5 | * Author: Joonyoung Shim <jy0922.shim@samsung.com> | ||
6 | * | ||
7 | * Samsung keypad controller core function | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify it | ||
10 | * under the terms of the GNU General Public License as published by the | ||
11 | * Free Software Foundation; either version 2 of the License, or (at your | ||
12 | * option) any later version. | ||
13 | * | ||
14 | */ | ||
15 | |||
16 | #ifndef __ASM_ARCH_KEYPAD_CORE_H | ||
17 | #define __ASM_ARCH_KEYPAD_CORE_H | ||
18 | |||
19 | /* These function are only for use with the core support code, such as | ||
20 | * the cpu specific initialisation code | ||
21 | */ | ||
22 | |||
23 | /* re-define device name depending on support. */ | ||
24 | static inline void samsung_keypad_setname(char *name) | ||
25 | { | ||
26 | #ifdef CONFIG_SAMSUNG_DEV_KEYPAD | ||
27 | samsung_device_keypad.name = name; | ||
28 | #endif | ||
29 | } | ||
30 | |||
31 | #endif /* __ASM_ARCH_KEYPAD_CORE_H */ | ||