From patchwork Fri May 25 08:58:08 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 8960 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 0B59A23F00 for ; Fri, 25 May 2012 09:08:42 +0000 (UTC) Received: from mail-gg0-f180.google.com (mail-gg0-f180.google.com [209.85.161.180]) by fiordland.canonical.com (Postfix) with ESMTP id BD5E5A18106 for ; Fri, 25 May 2012 09:08:41 +0000 (UTC) Received: by ggnf1 with SMTP id f1so810581ggn.11 for ; Fri, 25 May 2012 02:08:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:x-gm-message-state; bh=5buQK5yKRP42k/Vxp37d0+tqdRlwegCzq2DwYwDLMOM=; b=TVDy0vR0JNB93gZG5QBKLGOcZzcvNciDBkhSBa9X4eA7YTapspbrZf3myooa5a3Igq +uhI1E6GLIGIUJHS+0prbowMJFCoyP03z70LeD6FOMwSYfRxlq+pcj0dcSOTkQBhiORt wYERIKEZe6D68JQ9TRCc7LM1ChqzCZ5DTPdwiUiGKktpU0ZPOQBz10S/pG5x1egqG2Yy YiqrZml9aHBi/1TUnNAe6psXS1GpES5FTIRsIy5IlM9yk7rm/uRVvzlHUY0ZNZ8By1n6 OCY9IUG+iLKGXkxXO6n1u7PgQlRQvzYVda120cy7qi3d4fmq9QMTAdzKPNXS/de28rca uvIg== Received: by 10.50.163.99 with SMTP id yh3mr1726478igb.53.1337936920901; Fri, 25 May 2012 02:08:40 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.24.148 with SMTP id v20csp4662ibb; Fri, 25 May 2012 02:08:40 -0700 (PDT) Received: by 10.68.131.38 with SMTP id oj6mr30591654pbb.39.1337936919566; Fri, 25 May 2012 02:08:39 -0700 (PDT) Received: from mail-pb0-f50.google.com (mail-pb0-f50.google.com [209.85.160.50]) by mx.google.com with ESMTPS id kg6si4833609pbc.155.2012.05.25.02.08.39 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 25 May 2012 02:08:39 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.50 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.160.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.50 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) smtp.mail=sachin.kamat@linaro.org Received: by pbbrr4 with SMTP id rr4so1743118pbb.37 for ; Fri, 25 May 2012 02:08:39 -0700 (PDT) Received: by 10.68.190.39 with SMTP id gn7mr30872530pbc.5.1337936919134; Fri, 25 May 2012 02:08:39 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id in7sm8439477pbc.23.2012.05.25.02.08.35 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 25 May 2012 02:08:38 -0700 (PDT) From: Sachin Kamat To: linux-samsung-soc@vger.kernel.org Cc: kgene.kim@samsung.com, sachin.kamat@linaro.org, patches@linaro.org Subject: [PATCH 1/1] ARM: EXYNOS: Add touchscreen support to SMDK4X12 Date: Fri, 25 May 2012 14:28:08 +0530 Message-Id: <1337936288-25246-1-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 X-Gm-Message-State: ALoCoQm54eSqO2IMPU8/LFjf1Un2i0VKsbYvEAHon6pwH94VZ731cf2wxDre3HFQ+XIAHwCww+FO Pixcir touchscreen device support is added to SMDK4X12 boards. Signed-off-by: Sachin Kamat --- arch/arm/mach-exynos/mach-smdk4x12.c | 32 +++++++++++++++++++++++++++++++- 1 files changed, 31 insertions(+), 1 deletions(-) diff --git a/arch/arm/mach-exynos/mach-smdk4x12.c b/arch/arm/mach-exynos/mach-smdk4x12.c index fe772d8..0af6088 100644 --- a/arch/arm/mach-exynos/mach-smdk4x12.c +++ b/arch/arm/mach-exynos/mach-smdk4x12.c @@ -9,10 +9,12 @@ * published by the Free Software Foundation. */ +#include #include #include #include #include +#include #include #include #include @@ -203,8 +205,34 @@ static struct i2c_board_info smdk4x12_i2c_devs3[] __initdata = { /* nothing here yet */ }; +static void smdk4x12_ts_gpio_setup(void) +{ + int gpio_reset = EXYNOS4_GPM3(4); + + gpio_request_one(gpio_reset, GPIOF_OUT_INIT_LOW, "TOUCH RESET"); + mdelay(20); + gpio_direction_output(gpio_reset, 1); + mdelay(30); + s3c_gpio_setpull(EXYNOS4_GPX2(6), S3C_GPIO_PULL_NONE); +} + +static int smdk4x12_ts_get_value(void) +{ + return gpio_get_value(EXYNOS4_GPX2(6)); +} + +static struct pixcir_ts_platform_data smdk4x12_ts_data = { + .attb_read_val = smdk4x12_ts_get_value, + .x_max = 480, + .y_max = 800, +}; + static struct i2c_board_info smdk4x12_i2c_devs7[] __initdata = { - /* nothing here yet */ + { + I2C_BOARD_INFO("pixcir_ts", 0x5C), + .irq = IRQ_EINT(22), + .platform_data = &smdk4x12_ts_data, + } }; static struct samsung_bl_gpio_info smdk4x12_bl_gpio_info = { @@ -293,6 +321,8 @@ static void __init smdk4x12_machine_init(void) s3c_sdhci2_set_platdata(&smdk4x12_hsmmc2_pdata); s3c_sdhci3_set_platdata(&smdk4x12_hsmmc3_pdata); + smdk4x12_ts_gpio_setup(); + platform_add_devices(smdk4x12_devices, ARRAY_SIZE(smdk4x12_devices)); }