From patchwork Mon Jul 16 06:42:56 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 9998 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 0C9A323E2F for ; Mon, 16 Jul 2012 06:43:24 +0000 (UTC) Received: from mail-yw0-f52.google.com (mail-yw0-f52.google.com [209.85.213.52]) by fiordland.canonical.com (Postfix) with ESMTP id C5E2CA18824 for ; Mon, 16 Jul 2012 06:43:23 +0000 (UTC) Received: by yhpp61 with SMTP id p61so5209540yhp.11 for ; Sun, 15 Jul 2012 23:43:23 -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=oqpFjDlP9EM07ubMdAqsJg0nQ4K3kjo1iJgCF8kMFGk=; b=DGVaY+8nAek7t4DSV1F8QALHqplEQxTkJ7ZFeaaI7PA53cMX57cWmdnxw/+WAVaeyb KJK6/B/7ik/cQfUQxkh1EhNzUn7xaHWR0kWPtfG5h0iH9i28p16z+UNJAJTZw1qndMK4 jb7lypU38/Qmjiyfa6CA0N72J4/1x3cljremmnatZP7lGlcA6/uP7ARiJ+9cOJsCX6iK XEt+Iu7QEPTToy4aJEOcCQOIBIG7OUqgyzcgZ+w2NgqHPIx3zdO7fL3PTsz+y8CzV4BF Ep0XkOEmcVfUpDMuEhYaJTmXKT+t0QNOXndnpzf2D+oNiwHQ4mOhgAzmUTWJBKVxxrgP pD9g== Received: by 10.50.195.234 with SMTP id ih10mr4550556igc.0.1342421003053; Sun, 15 Jul 2012 23:43:23 -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.241.2 with SMTP id lc2csp5215ibb; Sun, 15 Jul 2012 23:43:22 -0700 (PDT) Received: by 10.236.79.35 with SMTP id h23mr8477201yhe.60.1342421001691; Sun, 15 Jul 2012 23:43:21 -0700 (PDT) Received: from mail-gg0-f178.google.com (mail-gg0-f178.google.com [209.85.161.178]) by mx.google.com with ESMTPS id p10si5670164ann.9.2012.07.15.23.43.21 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 15 Jul 2012 23:43:21 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.161.178 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.161.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.161.178 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) smtp.mail=sachin.kamat@linaro.org Received: by mail-gg0-f178.google.com with SMTP id q6so5534035ggc.37 for ; Sun, 15 Jul 2012 23:43:21 -0700 (PDT) Received: by 10.66.86.199 with SMTP id r7mr20677975paz.1.1342421000991; Sun, 15 Jul 2012 23:43:20 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id hw6sm11291709pbc.73.2012.07.15.23.43.18 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 15 Jul 2012 23:43:20 -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 v2] ARM: EXYNOS: Add touchscreen support to SMDK4X12 Date: Mon, 16 Jul 2012 12:12:56 +0530 Message-Id: <1342420976-25068-1-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 X-Gm-Message-State: ALoCoQnGSu2leiGiWaWWiNYudEZWWaxn7vB3ep9rNvUbv4DgeaFb4qbU/ppHNbByGRCCNgo4l1Qy Pixcir touchscreen device support is added to SMDK4X12 boards. Signed-off-by: Sachin Kamat --- This patch is based on Kukjin Kim's latest for-next branch. Changes since v1: Incorporated Kukjin's review comments -reduced mdelay -removed a unnecessary gpio --- arch/arm/mach-exynos/mach-smdk4x12.c | 31 ++++++++++++++++++++++++++++++- 1 files changed, 30 insertions(+), 1 deletions(-) diff --git a/arch/arm/mach-exynos/mach-smdk4x12.c b/arch/arm/mach-exynos/mach-smdk4x12.c index 2623f3b..b3207ea 100644 --- a/arch/arm/mach-exynos/mach-smdk4x12.c +++ b/arch/arm/mach-exynos/mach-smdk4x12.c @@ -9,9 +9,11 @@ * published by the Free Software Foundation. */ +#include #include #include #include +#include #include #include #include @@ -207,8 +209,33 @@ 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(2); + gpio_direction_output(gpio_reset, 1); + mdelay(30); +} + +static int smdk4x12_ts_get_value(void) +{ + return 1; +} + +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 = { @@ -336,6 +363,8 @@ static void __init smdk4x12_machine_init(void) s5p_fimd0_set_platdata(&smdk4x12_lcd_pdata); + smdk4x12_ts_gpio_setup(); + platform_add_devices(smdk4x12_devices, ARRAY_SIZE(smdk4x12_devices)); }