From patchwork Fri Jul 26 23:51:13 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zubair Lutfullah X-Patchwork-Id: 2834566 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 0DF45C0319 for ; Fri, 26 Jul 2013 23:51:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 316C720467 for ; Fri, 26 Jul 2013 23:51:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4067C20453 for ; Fri, 26 Jul 2013 23:51:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760476Ab3GZXvZ (ORCPT ); Fri, 26 Jul 2013 19:51:25 -0400 Received: from mail-ea0-f179.google.com ([209.85.215.179]:42455 "EHLO mail-ea0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757695Ab3GZXvV (ORCPT ); Fri, 26 Jul 2013 19:51:21 -0400 Received: by mail-ea0-f179.google.com with SMTP id b15so1807778eae.38 for ; Fri, 26 Jul 2013 16:51:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=rpT/CCsJhGI8i/8DK8pnsnYGd5CAbUNeig4mFgAG8gY=; b=YEwwLA6G0AM5tgc+1eWnFmmGpBrpjcKI88rTUZM/9L2+3W8ZrSNl35v8sCBqfbxo93 BUDYWjO47SD18tdxQfXL6fPMNUtRlnFGnyDpkRuzrftAEviEzr3ZmftK0knswb7wJEl5 hVV2MIYYDKqcgOgQ1XeBcyGjH2ddDfx7oTjQPsS7xcH3MEziqiVIHdyvh5TgHHOYBjOi KcZl5UdLGN0gAYjNKC5mhrSPu7xPyj8wE1dZweATE+2VFHY4e9va+l3GdJhDllTiILHt mTspcfBOhAy97taK2kTLjOGrc2m8pPAZkfaPsMF7N0xFI2eabePGwV316hUxIVb84Trb nh2Q== X-Received: by 10.14.199.134 with SMTP id x6mr49494742een.114.1374882679760; Fri, 26 Jul 2013 16:51:19 -0700 (PDT) Received: from localhost.localdomain (cpc3-seac14-0-0-cust157.7-2.cable.virginmedia.com. [81.97.204.158]) by mx.google.com with ESMTPSA id p49sm84261455eeu.2.2013.07.26.16.51.17 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 26 Jul 2013 16:51:18 -0700 (PDT) From: Zubair Lutfullah To: jic23@cam.ac.uk Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, gregkh@linuxfoundation.org, Russ.Dill@ti.com Subject: [PATCH 1/2] input: ti_tsc: Enable shared IRQ for TSC Date: Sat, 27 Jul 2013 00:51:13 +0100 Message-Id: <1374882674-18403-2-git-send-email-zubair.lutfullah@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1374882674-18403-1-git-send-email-zubair.lutfullah@gmail.com> References: <1374882674-18403-1-git-send-email-zubair.lutfullah@gmail.com> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-8.2 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: "Patil, Rachna" Touchscreen and ADC share the same IRQ line from parent MFD core. Previously only Touchscreen was interrupt based. With continuous mode support added in ADC driver, driver requires interrupt to process the ADC samples, so enable shared IRQ flag bit for touchscreen. Signed-off-by: Patil, Rachna Acked-by: Vaibhav Hiremath Signed-off-by: Zubair Lutfullah Acked-by: Greg Kroah-Hartman --- drivers/input/touchscreen/ti_am335x_tsc.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/drivers/input/touchscreen/ti_am335x_tsc.c b/drivers/input/touchscreen/ti_am335x_tsc.c index e1c5300..68d1250 100644 --- a/drivers/input/touchscreen/ti_am335x_tsc.c +++ b/drivers/input/touchscreen/ti_am335x_tsc.c @@ -260,8 +260,18 @@ static irqreturn_t titsc_irq(int irq, void *dev) unsigned int fsm; status = titsc_readl(ts_dev, REG_IRQSTATUS); - if (status & IRQENB_FIFO0THRES) { - + /* + * ADC and touchscreen share the IRQ line. + * FIFO1 threshold, FIFO1 Overrun and FIFO1 underflow + * interrupts are used by ADC, + * hence return from touchscreen IRQ handler if FIFO1 + * related interrupts occurred. + */ + if ((status & IRQENB_FIFO1THRES) || + (status & IRQENB_FIFO1OVRRUN) || + (status & IRQENB_FIFO1UNDRFLW)) + return IRQ_NONE; + else if (status & IRQENB_FIFO0THRES) { titsc_read_coordinates(ts_dev, &x, &y, &z1, &z2); if (ts_dev->pen_down && z1 != 0 && z2 != 0) { @@ -315,7 +325,7 @@ static irqreturn_t titsc_irq(int irq, void *dev) } if (irqclr) { - titsc_writel(ts_dev, REG_IRQSTATUS, irqclr); + titsc_writel(ts_dev, REG_IRQSTATUS, (status | irqclr)); am335x_tsc_se_update(ts_dev->mfd_tscadc); return IRQ_HANDLED; } @@ -389,7 +399,7 @@ static int titsc_probe(struct platform_device *pdev) } err = request_irq(ts_dev->irq, titsc_irq, - 0, pdev->dev.driver->name, ts_dev); + IRQF_SHARED, pdev->dev.driver->name, ts_dev); if (err) { dev_err(&pdev->dev, "failed to allocate irq.\n"); goto err_free_mem;