aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-exynos/midas-wacom.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-exynos/midas-wacom.c')
-rwxr-xr-xarch/arm/mach-exynos/midas-wacom.c59
1 files changed, 55 insertions, 4 deletions
diff --git a/arch/arm/mach-exynos/midas-wacom.c b/arch/arm/mach-exynos/midas-wacom.c
index 83048ec..725b8b3 100755
--- a/arch/arm/mach-exynos/midas-wacom.c
+++ b/arch/arm/mach-exynos/midas-wacom.c
@@ -24,9 +24,17 @@
static struct wacom_g5_callbacks *wacom_callbacks;
+#ifdef CONFIG_MACH_KONA
+#define GPIO_WACOM_LDO_EN GPIO_PEN_LDO_EN
+#define GPIO_WACOM_SENSE GPIO_PEN_DETECT
+#endif
+
static int wacom_early_suspend_hw(void)
{
+#ifndef CONFIG_MACH_KONA
gpio_set_value(GPIO_PEN_RESET_N, 0);
+#endif
+
#if defined(CONFIG_MACH_T0_EUR_OPEN)
if (system_rev >= 10)
gpio_direction_output(GPIO_WACOM_LDO_EN, 0);
@@ -46,7 +54,10 @@ static int wacom_late_resume_hw(void)
s3c_gpio_setpull(GPIO_PEN_IRQ, S3C_GPIO_PULL_NONE);
gpio_direction_output(GPIO_WACOM_LDO_EN, 1);
msleep(100);
+#ifndef CONFIG_MACH_KONA
gpio_set_value(GPIO_PEN_RESET_N, 1);
+#endif
+
return 0;
}
@@ -76,6 +87,15 @@ static void wacom_register_callbacks(struct wacom_g5_callbacks *cb)
static struct wacom_g5_platform_data wacom_platform_data = {
+#if defined(CONFIG_MACH_KONA)
+ .x_invert = 0,
+ .y_invert = 0,
+ .xy_switch = 0,
+ .min_x = WACOM_POSX_OFFSET,
+ .max_x = WACOM_POSY_MAX,
+ .min_y = WACOM_POSY_OFFSET,
+ .max_y = WACOM_POSX_MAX,
+#else
.x_invert = 1,
.y_invert = 0,
.xy_switch = 1,
@@ -83,6 +103,7 @@ static struct wacom_g5_platform_data wacom_platform_data = {
.max_x = WACOM_POSX_MAX,
.min_y = 0,
.max_y = WACOM_POSY_MAX,
+#endif
.min_pressure = 0,
.max_pressure = WACOM_PRESSURE_MAX,
.gpio_pendct = GPIO_PEN_PDCT,
@@ -105,7 +126,16 @@ static struct wacom_g5_platform_data wacom_platform_data = {
.gpio_pen_insert = GPIO_WACOM_SENSE,
#endif
};
-
+/* I2C Setting */
+#if defined(CONFIG_MACH_KONA)
+/* I2C6 */
+static struct i2c_board_info i2c_devs6[] __initdata = {
+ {
+ I2C_BOARD_INFO("wacom_g5sp_i2c", 0x56),
+ .platform_data = &wacom_platform_data,
+ },
+};
+#elif defined(CONFIG_MACH_T0)
#if defined(CONFIG_MACH_T0_EUR_OPEN) ||\
(defined(CONFIG_TARGET_LOCALE_CHN) && !defined(CONFIG_MACH_T0_CHN_CTC))
/* I2C5 */
@@ -124,18 +154,33 @@ static struct i2c_board_info i2c_devs2[] __initdata = {
},
};
#endif
+#endif
void __init midas_wacom_init(void)
{
int gpio;
int ret;
+#ifndef CONFIG_MACH_KONA
/*RESET*/
gpio = GPIO_PEN_RESET_N;
ret = gpio_request(gpio, "PEN_RESET");
s3c_gpio_cfgpin(gpio, S3C_GPIO_OUTPUT);
gpio_direction_output(gpio, 0);
-
+#endif
+
+#if defined(CONFIG_MACH_KONA)
+ printk(KERN_INFO "[E-PEN] Use FWE\n");
+ gpio = GPIO_PEN_FWE1;
+ ret = gpio_request(gpio, "PEN_FWE1");
+ if (ret) {
+ printk(KERN_ERR "[E-PEN] failed to request PEN_FWE1.(%d)\n",
+ ret);
+ return ;
+ }
+ s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(0x1));
+ s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
+#else
/*SLP & FWE1*/
if (system_rev < WACOM_FWE1_HWID) {
printk(KERN_INFO "[E-PEN] Use SLP\n");
@@ -150,6 +195,7 @@ void __init midas_wacom_init(void)
s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(0x1));
s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
}
+#endif
gpio_direction_output(gpio, 0);
/*PDCT*/
@@ -169,7 +215,10 @@ void __init midas_wacom_init(void)
s5p_register_gpio_interrupt(gpio);
gpio_direction_input(gpio);
-#if defined(CONFIG_MACH_T0_EUR_OPEN) ||\
+#if defined(CONFIG_MACH_KONA)
+ i2c_devs6[0].irq = gpio_to_irq(gpio);
+ irq_set_irq_type(i2c_devs6[0].irq, IRQ_TYPE_EDGE_RISING);
+#elif defined(CONFIG_MACH_T0_EUR_OPEN) || \
(defined(CONFIG_TARGET_LOCALE_CHN) && !defined(CONFIG_MACH_T0_CHN_CTC))
i2c_devs5[0].irq = gpio_to_irq(gpio);
irq_set_irq_type(i2c_devs5[0].irq, IRQ_TYPE_EDGE_RISING);
@@ -186,7 +235,9 @@ void __init midas_wacom_init(void)
s3c_gpio_cfgpin(gpio, S3C_GPIO_OUTPUT);
gpio_direction_output(gpio, 0);
-#if defined(CONFIG_MACH_T0_EUR_OPEN) ||\
+#if defined(CONFIG_MACH_KONA)
+ i2c_register_board_info(6, i2c_devs6, ARRAY_SIZE(i2c_devs6));
+#elif defined(CONFIG_MACH_T0_EUR_OPEN) ||\
(defined(CONFIG_TARGET_LOCALE_CHN) && !defined(CONFIG_MACH_T0_CHN_CTC))
i2c_register_board_info(5, i2c_devs5, ARRAY_SIZE(i2c_devs5));
#else