diff options
author | Naveen Krishna Ch <ch.naveen@samsung.com> | 2010-06-21 18:54:18 -0400 |
---|---|---|
committer | Kukjin Kim <kgene.kim@samsung.com> | 2010-08-05 05:30:51 -0400 |
commit | 2211f28cdaf416f566ec4af0e431dc04393e9c14 (patch) | |
tree | aa6a26f3dd78a98a2bc7182bfe1a555c1c33f58a /arch/arm | |
parent | 32018a8c83903199206c9d98f54006e69ec55dd4 (diff) |
ARM: S5PC100: Add keypad device to the SMDKC100 board
This patch is to support keypad device to the SMDKC100 board.
Signed-off-by: Naveen Krishna Ch <ch.naveen@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-s5pc100/Kconfig | 7 | ||||
-rw-r--r-- | arch/arm/mach-s5pc100/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/mach-s5pc100/include/mach/map.h | 2 | ||||
-rw-r--r-- | arch/arm/mach-s5pc100/mach-smdkc100.c | 24 | ||||
-rw-r--r-- | arch/arm/mach-s5pc100/setup-keypad.c | 34 |
5 files changed, 68 insertions, 0 deletions
diff --git a/arch/arm/mach-s5pc100/Kconfig b/arch/arm/mach-s5pc100/Kconfig index a7ba205f3c1c..cd7f4e95d230 100644 --- a/arch/arm/mach-s5pc100/Kconfig +++ b/arch/arm/mach-s5pc100/Kconfig | |||
@@ -30,6 +30,11 @@ config S5PC100_SETUP_IDE | |||
30 | help | 30 | help |
31 | Common setup code for S5PC100 IDE GPIO configurations | 31 | Common setup code for S5PC100 IDE GPIO configurations |
32 | 32 | ||
33 | config S5PC100_SETUP_KEYPAD | ||
34 | bool | ||
35 | help | ||
36 | Common setup code for KEYPAD GPIO configurations. | ||
37 | |||
33 | config S5PC100_SETUP_SDHCI | 38 | config S5PC100_SETUP_SDHCI |
34 | bool | 39 | bool |
35 | select S5PC100_SETUP_SDHCI_GPIO | 40 | select S5PC100_SETUP_SDHCI_GPIO |
@@ -51,12 +56,14 @@ config MACH_SMDKC100 | |||
51 | select S3C_DEV_HSMMC | 56 | select S3C_DEV_HSMMC |
52 | select S3C_DEV_HSMMC1 | 57 | select S3C_DEV_HSMMC1 |
53 | select S3C_DEV_HSMMC2 | 58 | select S3C_DEV_HSMMC2 |
59 | select SAMSUNG_DEV_KEYPAD | ||
54 | select SAMSUNG_DEV_TS | 60 | select SAMSUNG_DEV_TS |
55 | select S3C_DEV_WDT | 61 | select S3C_DEV_WDT |
56 | select HAVE_S3C2410_WATCHDOG | 62 | select HAVE_S3C2410_WATCHDOG |
57 | select S5PC100_SETUP_FB_24BPP | 63 | select S5PC100_SETUP_FB_24BPP |
58 | select S5PC100_SETUP_I2C1 | 64 | select S5PC100_SETUP_I2C1 |
59 | select S5PC100_SETUP_IDE | 65 | select S5PC100_SETUP_IDE |
66 | select S5PC100_SETUP_KEYPAD | ||
60 | select S5PC100_SETUP_SDHCI | 67 | select S5PC100_SETUP_SDHCI |
61 | help | 68 | help |
62 | Machine support for the Samsung SMDKC100 | 69 | Machine support for the Samsung SMDKC100 |
diff --git a/arch/arm/mach-s5pc100/Makefile b/arch/arm/mach-s5pc100/Makefile index ab3ebe2f5d2a..a021ed1fb4b6 100644 --- a/arch/arm/mach-s5pc100/Makefile +++ b/arch/arm/mach-s5pc100/Makefile | |||
@@ -20,6 +20,7 @@ obj-$(CONFIG_CPU_S5PC100) += dma.o | |||
20 | obj-$(CONFIG_S5PC100_SETUP_FB_24BPP) += setup-fb-24bpp.o | 20 | obj-$(CONFIG_S5PC100_SETUP_FB_24BPP) += setup-fb-24bpp.o |
21 | obj-$(CONFIG_S5PC100_SETUP_I2C1) += setup-i2c1.o | 21 | obj-$(CONFIG_S5PC100_SETUP_I2C1) += setup-i2c1.o |
22 | obj-$(CONFIG_S5PC100_SETUP_IDE) += setup-ide.o | 22 | obj-$(CONFIG_S5PC100_SETUP_IDE) += setup-ide.o |
23 | obj-$(CONFIG_S5PC100_SETUP_KEYPAD) += setup-keypad.o | ||
23 | obj-$(CONFIG_S5PC100_SETUP_SDHCI) += setup-sdhci.o | 24 | obj-$(CONFIG_S5PC100_SETUP_SDHCI) += setup-sdhci.o |
24 | obj-$(CONFIG_S5PC100_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o | 25 | obj-$(CONFIG_S5PC100_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o |
25 | 26 | ||
diff --git a/arch/arm/mach-s5pc100/include/mach/map.h b/arch/arm/mach-s5pc100/include/mach/map.h index 66b626081430..809ff90824cf 100644 --- a/arch/arm/mach-s5pc100/include/mach/map.h +++ b/arch/arm/mach-s5pc100/include/mach/map.h | |||
@@ -137,11 +137,13 @@ | |||
137 | #define S3C_PA_HSMMC2 S5PC100_PA_HSMMC(2) | 137 | #define S3C_PA_HSMMC2 S5PC100_PA_HSMMC(2) |
138 | #define S3C_PA_KEYPAD S5PC100_PA_KEYPAD | 138 | #define S3C_PA_KEYPAD S5PC100_PA_KEYPAD |
139 | #define S3C_PA_WDT S5PC100_PA_WATCHDOG | 139 | #define S3C_PA_WDT S5PC100_PA_WATCHDOG |
140 | #define S3C_PA_TSADC S5PC100_PA_TSADC | ||
140 | #define S3C_PA_ONENAND S5PC100_PA_ONENAND | 141 | #define S3C_PA_ONENAND S5PC100_PA_ONENAND |
141 | #define S3C_PA_ONENAND_BUF S5PC100_PA_ONENAND_BUF | 142 | #define S3C_PA_ONENAND_BUF S5PC100_PA_ONENAND_BUF |
142 | #define S3C_SZ_ONENAND_BUF S5PC100_SZ_ONENAND_BUF | 143 | #define S3C_SZ_ONENAND_BUF S5PC100_SZ_ONENAND_BUF |
143 | 144 | ||
144 | #define SAMSUNG_PA_ADC S5PC100_PA_TSADC | 145 | #define SAMSUNG_PA_ADC S5PC100_PA_TSADC |
145 | #define SAMSUNG_PA_CFCON S5PC100_PA_CFCON | 146 | #define SAMSUNG_PA_CFCON S5PC100_PA_CFCON |
147 | #define SAMSUNG_PA_KEYPAD S5PC100_PA_KEYPAD | ||
146 | 148 | ||
147 | #endif /* __ASM_ARCH_C100_MAP_H */ | 149 | #endif /* __ASM_ARCH_C100_MAP_H */ |
diff --git a/arch/arm/mach-s5pc100/mach-smdkc100.c b/arch/arm/mach-s5pc100/mach-smdkc100.c index bf1b9271f34f..a00dd090f1a1 100644 --- a/arch/arm/mach-s5pc100/mach-smdkc100.c +++ b/arch/arm/mach-s5pc100/mach-smdkc100.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/i2c.h> | 22 | #include <linux/i2c.h> |
23 | #include <linux/fb.h> | 23 | #include <linux/fb.h> |
24 | #include <linux/delay.h> | 24 | #include <linux/delay.h> |
25 | #include <linux/input.h> | ||
25 | 26 | ||
26 | #include <asm/mach/arch.h> | 27 | #include <asm/mach/arch.h> |
27 | #include <asm/mach/map.h> | 28 | #include <asm/mach/map.h> |
@@ -44,6 +45,7 @@ | |||
44 | #include <plat/iic.h> | 45 | #include <plat/iic.h> |
45 | #include <plat/ata.h> | 46 | #include <plat/ata.h> |
46 | #include <plat/adc.h> | 47 | #include <plat/adc.h> |
48 | #include <plat/keypad.h> | ||
47 | #include <plat/ts.h> | 49 | #include <plat/ts.h> |
48 | 50 | ||
49 | /* Following are default values for UCON, ULCON and UFCON UART registers */ | 51 | /* Following are default values for UCON, ULCON and UFCON UART registers */ |
@@ -156,6 +158,25 @@ static struct s3c_ide_platdata smdkc100_ide_pdata __initdata = { | |||
156 | .setup_gpio = s5pc100_ide_setup_gpio, | 158 | .setup_gpio = s5pc100_ide_setup_gpio, |
157 | }; | 159 | }; |
158 | 160 | ||
161 | static uint32_t smdkc100_keymap[] __initdata = { | ||
162 | /* KEY(row, col, keycode) */ | ||
163 | KEY(0, 3, KEY_1), KEY(0, 4, KEY_2), KEY(0, 5, KEY_3), | ||
164 | KEY(0, 6, KEY_4), KEY(0, 7, KEY_5), | ||
165 | KEY(1, 3, KEY_A), KEY(1, 4, KEY_B), KEY(1, 5, KEY_C), | ||
166 | KEY(1, 6, KEY_D), KEY(1, 7, KEY_E) | ||
167 | }; | ||
168 | |||
169 | static struct matrix_keymap_data smdkc100_keymap_data __initdata = { | ||
170 | .keymap = smdkc100_keymap, | ||
171 | .keymap_size = ARRAY_SIZE(smdkc100_keymap), | ||
172 | }; | ||
173 | |||
174 | static struct samsung_keypad_platdata smdkc100_keypad_data __initdata = { | ||
175 | .keymap_data = &smdkc100_keymap_data, | ||
176 | .rows = 2, | ||
177 | .cols = 8, | ||
178 | }; | ||
179 | |||
159 | static struct platform_device *smdkc100_devices[] __initdata = { | 180 | static struct platform_device *smdkc100_devices[] __initdata = { |
160 | &s3c_device_adc, | 181 | &s3c_device_adc, |
161 | &s3c_device_cfcon, | 182 | &s3c_device_cfcon, |
@@ -169,6 +190,7 @@ static struct platform_device *smdkc100_devices[] __initdata = { | |||
169 | &s3c_device_wdt, | 190 | &s3c_device_wdt, |
170 | &smdkc100_lcd_powerdev, | 191 | &smdkc100_lcd_powerdev, |
171 | &s5pc100_device_iis0, | 192 | &s5pc100_device_iis0, |
193 | &samsung_device_keypad, | ||
172 | &s5pc100_device_ac97, | 194 | &s5pc100_device_ac97, |
173 | }; | 195 | }; |
174 | 196 | ||
@@ -198,6 +220,8 @@ static void __init smdkc100_machine_init(void) | |||
198 | s3c_fb_set_platdata(&smdkc100_lcd_pdata); | 220 | s3c_fb_set_platdata(&smdkc100_lcd_pdata); |
199 | s3c_ide_set_platdata(&smdkc100_ide_pdata); | 221 | s3c_ide_set_platdata(&smdkc100_ide_pdata); |
200 | 222 | ||
223 | samsung_keypad_set_platdata(&smdkc100_keypad_data); | ||
224 | |||
201 | /* LCD init */ | 225 | /* LCD init */ |
202 | gpio_request(S5PC100_GPD(0), "GPD"); | 226 | gpio_request(S5PC100_GPD(0), "GPD"); |
203 | gpio_request(S5PC100_GPH0(6), "GPH0"); | 227 | gpio_request(S5PC100_GPH0(6), "GPH0"); |
diff --git a/arch/arm/mach-s5pc100/setup-keypad.c b/arch/arm/mach-s5pc100/setup-keypad.c new file mode 100644 index 000000000000..d0837a72a58e --- /dev/null +++ b/arch/arm/mach-s5pc100/setup-keypad.c | |||
@@ -0,0 +1,34 @@ | |||
1 | /* linux/arch/arm/mach-s5pc100/setup-keypad.c | ||
2 | * | ||
3 | * Copyright (c) 2010 Samsung Electronics Co., Ltd. | ||
4 | * http://www.samsung.com/ | ||
5 | * | ||
6 | * GPIO configuration for S5PC100 KeyPad device | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | */ | ||
12 | |||
13 | #include <linux/gpio.h> | ||
14 | #include <plat/gpio-cfg.h> | ||
15 | |||
16 | void samsung_keypad_cfg_gpio(unsigned int rows, unsigned int cols) | ||
17 | { | ||
18 | unsigned int gpio; | ||
19 | unsigned int end; | ||
20 | |||
21 | /* Set all the necessary GPH3 pins to special-function 3: KP_ROW[x] */ | ||
22 | end = S5PC100_GPH3(rows); | ||
23 | for (gpio = S5PC100_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 = S5PC100_GPH2(cols); | ||
30 | for (gpio = S5PC100_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 | } | ||