aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorMarek Szyprowski <m.szyprowski@samsung.com>2011-06-22 00:43:39 -0400
committerKukjin Kim <kgene.kim@samsung.com>2011-07-20 10:17:33 -0400
commitb908af44995d4a581477245de33e0d7ccc0b9a7a (patch)
tree0a7b6d2d785bad2531ad39f569a2e662c8492ef3 /arch
parentedd967b899a9ecc55409c7ea1eeeb0cf0a9077e2 (diff)
ARM: EXYNOS4: Add MCS Touchkey device on Universal_C210
This patch adds definitions to enable support for MCS Touchkey driver for Universal C210 board. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-exynos4/Kconfig1
-rw-r--r--arch/arm/mach-exynos4/mach-universal_c210.c57
2 files changed, 58 insertions, 0 deletions
diff --git a/arch/arm/mach-exynos4/Kconfig b/arch/arm/mach-exynos4/Kconfig
index 32a96f41e0e3..08482439acc3 100644
--- a/arch/arm/mach-exynos4/Kconfig
+++ b/arch/arm/mach-exynos4/Kconfig
@@ -153,6 +153,7 @@ config MACH_ARMLEX4210
153config MACH_UNIVERSAL_C210 153config MACH_UNIVERSAL_C210
154 bool "Mobile UNIVERSAL_C210 Board" 154 bool "Mobile UNIVERSAL_C210 Board"
155 select CPU_EXYNOS4210 155 select CPU_EXYNOS4210
156 select S5P_GPIO_INT
156 select S5P_DEV_FIMC0 157 select S5P_DEV_FIMC0
157 select S5P_DEV_FIMC1 158 select S5P_DEV_FIMC1
158 select S5P_DEV_FIMC2 159 select S5P_DEV_FIMC2
diff --git a/arch/arm/mach-exynos4/mach-universal_c210.c b/arch/arm/mach-exynos4/mach-universal_c210.c
index 65f8d62e067f..83c83cce2478 100644
--- a/arch/arm/mach-exynos4/mach-universal_c210.c
+++ b/arch/arm/mach-exynos4/mach-universal_c210.c
@@ -18,6 +18,8 @@
18#include <linux/regulator/fixed.h> 18#include <linux/regulator/fixed.h>
19#include <linux/regulator/max8952.h> 19#include <linux/regulator/max8952.h>
20#include <linux/mmc/host.h> 20#include <linux/mmc/host.h>
21#include <linux/i2c-gpio.h>
22#include <linux/i2c/mcs.h>
21 23
22#include <asm/mach/arch.h> 24#include <asm/mach/arch.h>
23#include <asm/mach-types.h> 25#include <asm/mach-types.h>
@@ -477,6 +479,56 @@ static struct i2c_board_info i2c5_devs[] __initdata = {
477 }, 479 },
478}; 480};
479 481
482/* GPIO I2C 12 (3 Touchkey) */
483static uint32_t touchkey_keymap[] = {
484 /* MCS_KEY_MAP(value, keycode) */
485 MCS_KEY_MAP(0, KEY_MENU), /* KEY_SEND */
486 MCS_KEY_MAP(1, KEY_BACK), /* KEY_END */
487};
488
489static struct mcs_platform_data touchkey_data = {
490 .keymap = touchkey_keymap,
491 .keymap_size = ARRAY_SIZE(touchkey_keymap),
492 .key_maxval = 2,
493};
494
495/* GPIO I2C 3_TOUCH 2.8V */
496#define I2C_GPIO_BUS_12 12
497static struct i2c_gpio_platform_data i2c_gpio12_data = {
498 .sda_pin = EXYNOS4_GPE4(0), /* XMDMDATA_8 */
499 .scl_pin = EXYNOS4_GPE4(1), /* XMDMDATA_9 */
500};
501
502static struct platform_device i2c_gpio12 = {
503 .name = "i2c-gpio",
504 .id = I2C_GPIO_BUS_12,
505 .dev = {
506 .platform_data = &i2c_gpio12_data,
507 },
508};
509
510static struct i2c_board_info i2c_gpio12_devs[] __initdata = {
511 {
512 I2C_BOARD_INFO("mcs5080_touchkey", 0x20),
513 .platform_data = &touchkey_data,
514 },
515};
516
517static void __init universal_touchkey_init(void)
518{
519 int gpio;
520
521 gpio = EXYNOS4_GPE3(7); /* XMDMDATA_7 */
522 gpio_request(gpio, "3_TOUCH_INT");
523 s5p_register_gpio_interrupt(gpio);
524 s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(0xf));
525 i2c_gpio12_devs[0].irq = gpio_to_irq(gpio);
526
527 gpio = EXYNOS4_GPE3(3); /* XMDMDATA_3 */
528 gpio_request(gpio, "3_TOUCH_EN");
529 gpio_direction_output(gpio, 1);
530}
531
480/* GPIO KEYS */ 532/* GPIO KEYS */
481static struct gpio_keys_button universal_gpio_keys_tables[] = { 533static struct gpio_keys_button universal_gpio_keys_tables[] = {
482 { 534 {
@@ -619,6 +671,7 @@ static struct platform_device *universal_devices[] __initdata = {
619 &s3c_device_i2c5, 671 &s3c_device_i2c5,
620 672
621 /* Universal Devices */ 673 /* Universal Devices */
674 &i2c_gpio12,
622 &universal_gpio_keys, 675 &universal_gpio_keys,
623 &s5p_device_onenand, 676 &s5p_device_onenand,
624}; 677};
@@ -640,6 +693,10 @@ static void __init universal_machine_init(void)
640 s3c_i2c5_set_platdata(NULL); 693 s3c_i2c5_set_platdata(NULL);
641 i2c_register_board_info(5, i2c5_devs, ARRAY_SIZE(i2c5_devs)); 694 i2c_register_board_info(5, i2c5_devs, ARRAY_SIZE(i2c5_devs));
642 695
696 universal_touchkey_init();
697 i2c_register_board_info(I2C_GPIO_BUS_12, i2c_gpio12_devs,
698 ARRAY_SIZE(i2c_gpio12_devs));
699
643 /* Last */ 700 /* Last */
644 platform_add_devices(universal_devices, ARRAY_SIZE(universal_devices)); 701 platform_add_devices(universal_devices, ARRAY_SIZE(universal_devices));
645} 702}