From patchwork Thu May 6 09:50:29 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maurus Cuelenaere X-Patchwork-Id: 97323 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o46AfFp4024690 for ; Thu, 6 May 2010 10:45:48 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756674Ab0EFJuf (ORCPT ); Thu, 6 May 2010 05:50:35 -0400 Received: from mail-ew0-f220.google.com ([209.85.219.220]:52689 "EHLO mail-ew0-f220.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756555Ab0EFJue (ORCPT ); Thu, 6 May 2010 05:50:34 -0400 Received: by ewy20 with SMTP id 20so1612720ewy.1 for ; Thu, 06 May 2010 02:50:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:cc:subject:content-type :content-transfer-encoding; bh=78BTU/RK3kl6gbgL0q+Tvekqf5NYrDUTCpBq6tJlxOE=; b=hE/rcLy4hZmvH9F16HL62N8q725w0Cy8sqzil5FbdKgq4Nse0eEYVEGO/H3rd5UM8w 1aALfz7OchbhAGc7cvpzm0Qu74e0JVZ9MUqQCfbeZp2aRI1sahCkVpvnuiixw8XNHliB oDsVH8gGmrJWuqieDSa7DCQ4mDNthYLZ0dnKM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding; b=JokAt+gT9gzHBY3CyC/Ky1mfV7ONFy5EgkcS2IcnUkfFDAoap8x0MNA/lGYXE9WL+T S2Y3TlnlQfUUjhX8TGUhM2I8e+lQ2H5us9mspO1sKeHdgBgoJEX4HYaJDzwI8zvtCmyA cV6BYpbmtTGsPID4qZvii1dyAZcibbp/s6iNc= Received: by 10.213.49.66 with SMTP id u2mr7833991ebf.52.1273139431181; Thu, 06 May 2010 02:50:31 -0700 (PDT) Received: from [78.22.183.17] (78-22-183-17.access.telenet.be [78.22.183.17]) by mx.google.com with ESMTPS id 14sm446933ewy.2.2010.05.06.02.50.30 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 06 May 2010 02:50:30 -0700 (PDT) Message-ID: <4BE290E5.9050703@gmail.com> Date: Thu, 06 May 2010 11:50:29 +0200 From: Maurus Cuelenaere User-Agent: Mozilla/5.0 (X11; U; Linux i686; nl; rv:1.9.1.9) Gecko/20100317 Lightning/1.0b1 Thunderbird/3.0.4 MIME-Version: 1.0 To: linux-samsung-soc@vger.kernel.org, linux-input@vger.kernel.org CC: arnaud.patard@rtp-net.org, ben-linux@fluff.org Subject: [PATCH] ARM: S3C64XX: Add s3c64xx support to touchscreen driver Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Thu, 06 May 2010 10:45:48 +0000 (UTC) diff --git a/drivers/input/touchscreen/Kconfig b/drivers/input/touchscreen/Kconfig index 8a8fa4d..be8e9ba 100644 --- a/drivers/input/touchscreen/Kconfig +++ b/drivers/input/touchscreen/Kconfig @@ -158,11 +158,11 @@ config TOUCHSCREEN_FUJITSU module will be called fujitsu-ts. config TOUCHSCREEN_S3C2410 - tristate "Samsung S3C2410 touchscreen input driver" - depends on ARCH_S3C2410 + tristate "Samsung S3C touchscreen input driver" + depends on ARCH_S3C2410 || ARCH_S3C64XX select S3C24XX_ADC help - Say Y here if you have the s3c2410 touchscreen. + Say Y here if you have the s3c touchscreen. If unsure, say N. diff --git a/drivers/input/touchscreen/s3c2410_ts.c b/drivers/input/touchscreen/s3c2410_ts.c index 98a7d12..66d1c83 100644 --- a/drivers/input/touchscreen/s3c2410_ts.c +++ b/drivers/input/touchscreen/s3c2410_ts.c @@ -87,6 +87,12 @@ struct s3c2410ts { static struct s3c2410ts ts; +enum s3c_cpu_type { + TYPE_S3C2410, + TYPE_S3C2440, + TYPE_S3C64XX, +}; + /** * s3c2410_ts_connect - configure gpio for s3c2410 systems * @@ -96,10 +102,14 @@ static struct s3c2410ts ts; */ static inline void s3c2410_ts_connect(void) { +#ifdef PLAT_S3C24XX + /* As s3c2410_gpio_cfgpin() isn't defined for non-s3c24xx builds, + guard these with an ifdef. */ s3c2410_gpio_cfgpin(S3C2410_GPG(12), S3C2410_GPG12_XMON); s3c2410_gpio_cfgpin(S3C2410_GPG(13), S3C2410_GPG13_nXPON); s3c2410_gpio_cfgpin(S3C2410_GPG(14), S3C2410_GPG14_YMON); s3c2410_gpio_cfgpin(S3C2410_GPG(15), S3C2410_GPG15_nYPON); +#endif } /** @@ -170,6 +180,7 @@ static DEFINE_TIMER(touch_timer, touch_timer_fire, 0, 0); */ static irqreturn_t stylus_irq(int irq, void *dev_id) { + struct platform_device *pdev = to_platform_device(ts.dev); unsigned long data0; unsigned long data1; bool down; @@ -188,6 +199,12 @@ static irqreturn_t stylus_irq(int irq, void *dev_id) else dev_info(ts.dev, "%s: count=%d\n", __func__, ts.count); + + if (platform_get_device_id(pdev)->driver_data == TYPE_S3C64XX) { + /* Clear pen down/up interrupt */ + writel(0x0, ts.io + S3C64XX_ADCCLRINTPNDNUP); + } + return IRQ_HANDLED; } @@ -297,7 +314,7 @@ static int __devinit s3c2410ts_probe(struct platform_device *pdev) } /* Configure the touchscreen external FETs on the S3C2410 */ - if (!platform_get_device_id(pdev)->driver_data) + if (platform_get_device_id(pdev)->driver_data == TYPE_S3C2410) s3c2410_ts_connect(); ts.client = s3c_adc_register(pdev, s3c24xx_ts_select, @@ -420,15 +437,16 @@ static struct dev_pm_ops s3c_ts_pmops = { #endif static struct platform_device_id s3cts_driver_ids[] = { - { "s3c2410-ts", 0 }, - { "s3c2440-ts", 1 }, + { "s3c2410-ts", TYPE_S3C2410 }, + { "s3c2440-ts", TYPE_S3C2440 }, + { "s3c64xx-ts", TYPE_S3C64XX }, { } }; MODULE_DEVICE_TABLE(platform, s3cts_driver_ids); static struct platform_driver s3c_ts_driver = { .driver = { - .name = "s3c24xx-ts", + .name = "s3c-ts", .owner = THIS_MODULE, #ifdef CONFIG_PM .pm = &s3c_ts_pmops,