From patchwork Mon Mar 8 18:38:59 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maurus Cuelenaere X-Patchwork-Id: 84130 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 o28IdL2Z021602 for ; Mon, 8 Mar 2010 18:39:21 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755258Ab0CHSjV (ORCPT ); Mon, 8 Mar 2010 13:39:21 -0500 Received: from mail-bw0-f209.google.com ([209.85.218.209]:41075 "EHLO mail-bw0-f209.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755164Ab0CHSjU (ORCPT ); Mon, 8 Mar 2010 13:39:20 -0500 Received: by mail-bw0-f209.google.com with SMTP id 1so3099841bwz.21 for ; Mon, 08 Mar 2010 10:39:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:from:date:message-id :subject:to:cc:content-type; bh=C0fJ+AztPh+HAEHrRRsWdBKO8u7fyx3s6Gxsg0yGqgE=; b=MeOldsRqjoZRmhZB7Ci6oIQyi9BVGb4Rf5bPUsDb986hyf+e8JN+UssnE1R8TIuHOS Y3t/hrj/4FVME924BFYLUmmdoJbYpY0yFGR/K66L4rQPnDoykpUj7+3lfDDgnZBONDAX IJ3czH7oHj1quSXidpkTztBCJHVJ7u16JKLAQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:cc:content-type; b=JJEkYdwfEXlr5j60F7suzwgwE6OyrvGBuXU9APriMwITruWgvPj4C7tyr/N8FPBfqG WM0DUX8Ps02yKb1BPeqm1fztOkO4WXQnM/Cx1AIJvYXmCwqpSMn/EYMoSfNQVep8qR+L yAhxRCtYGPLwV+m7+qKtdB2/8LYYWOvVmWuHo= MIME-Version: 1.0 Received: by 10.204.144.130 with SMTP id z2mr5709096bku.55.1268073559246; Mon, 08 Mar 2010 10:39:19 -0800 (PST) From: Maurus Cuelenaere Date: Mon, 8 Mar 2010 19:38:59 +0100 Message-ID: Subject: [PATCH 5/7] ARM: S3C64XX: Add s3c64xx support to touchscreen driver To: linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-input@vger.kernel.org Cc: Ben Dooks 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]); Mon, 08 Mar 2010 18:39:21 +0000 (UTC) diff --git a/drivers/input/touchscreen/Kconfig b/drivers/input/touchscreen/Kconfig index dfafc76..0378b3d 100644 --- a/drivers/input/touchscreen/Kconfig +++ b/drivers/input/touchscreen/Kconfig @@ -146,11 +146,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 0cd0ca6..04c990e 100644 --- a/drivers/input/touchscreen/s3c2410_ts.c +++ b/drivers/input/touchscreen/s3c2410_ts.c @@ -40,7 +40,9 @@ #include #include +#ifdef PLAT_S3C24XX #include +#endif #define TSC_SLEEP (S3C2410_ADCTSC_PULL_UP_DISABLE | S3C2410_ADCTSC_XY_PST(0)) @@ -88,6 +90,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 * @@ -97,10 +105,12 @@ static struct s3c2410ts ts; */ static inline void s3c2410_ts_connect(void) { +#ifdef PLAT_S3C24XX 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 } /** @@ -169,6 +179,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; @@ -187,6 +198,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; } @@ -296,7 +313,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();