From patchwork Wed Aug 22 11:19:25 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Patil, Rachna" X-Patchwork-Id: 1361011 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id CB3C33FC71 for ; Wed, 22 Aug 2012 11:35:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752763Ab2HVLfj (ORCPT ); Wed, 22 Aug 2012 07:35:39 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:35469 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752257Ab2HVLfi (ORCPT ); Wed, 22 Aug 2012 07:35:38 -0400 Received: from dbdp20.itg.ti.com ([172.24.170.38]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id q7MBZT4G001674; Wed, 22 Aug 2012 06:35:30 -0500 Received: from DBDE71.ent.ti.com (localhost [127.0.0.1]) by dbdp20.itg.ti.com (8.13.8/8.13.8) with ESMTP id q7MBZTRD023768; Wed, 22 Aug 2012 17:05:29 +0530 (IST) Received: from dbdp32.itg.ti.com (172.24.170.251) by DBDE71.ent.ti.com (172.24.170.149) with Microsoft SMTP Server id 14.1.323.3; Wed, 22 Aug 2012 17:05:29 +0530 Received: from ucmsshproxy.india.ext.ti.com (dbdp20.itg.ti.com [172.24.170.38]) by dbdp32.itg.ti.com (8.13.8/8.13.8) with SMTP id q7MBZSdX031746; Wed, 22 Aug 2012 17:05:28 +0530 Received: from symphony.india.ext.ti.com (unknown [192.168.247.13]) by ucmsshproxy.india.ext.ti.com (Postfix) with ESMTP id D2EBE158002; Wed, 22 Aug 2012 17:05:28 +0530 (IST) Received: from linux-psp-server.india.ext.ti.com (linux-psp-server [192.168.247.76]) by symphony.india.ext.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id q7MBZSI21609; Wed, 22 Aug 2012 17:05:28 +0530 (IST) From: "Patil, Rachna" To: CC: Dmitry Torokhov , Dmitry Torokhov , "Patil, Rachna" Subject: [PATCH 3/4] input: TSC: ti_tscadc: set FIFO0 threshold Interrupt Date: Wed, 22 Aug 2012 16:49:25 +0530 Message-ID: <1345634365-29893-1-git-send-email-rachna@ti.com> X-Mailer: git-send-email 1.7.1 MIME-Version: 1.0 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Code currently uses FIFO1 threshold interrupt. since this is a MFD, Dedicating FIFO0 to touchscreen and making way for other devices to use FIFO1 as well. The FIFO can be shared between 2 devices but since the interrupt used is threshold interrupt on FIFO1, we would end up having wrong interrupts. Hence changing the same. Signed-off-by: Patil, Rachna --- drivers/input/touchscreen/ti_tscadc.c | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/input/touchscreen/ti_tscadc.c b/drivers/input/touchscreen/ti_tscadc.c index c1bd8e5..2cc19b0 100644 --- a/drivers/input/touchscreen/ti_tscadc.c +++ b/drivers/input/touchscreen/ti_tscadc.c @@ -42,6 +42,7 @@ #define REG_STEPCONFIG(n) (0x64 + ((n - 1) * 8)) #define REG_STEPDELAY(n) (0x68 + ((n - 1) * 8)) #define REG_FIFO0CNT 0xE4 +#define REG_FIFO0THR 0xE8 #define REG_FIFO1THR 0xF4 #define REG_FIFO0 0x100 #define REG_FIFO1 0x200 @@ -55,6 +56,7 @@ #define STPENB_STEPENB STEPENB(0x7FFF) /* IRQ enable */ +#define IRQENB_FIFO0THRES BIT(2) #define IRQENB_FIFO1THRES BIT(5) #define IRQENB_PENUP BIT(9) @@ -277,7 +279,7 @@ static irqreturn_t tscadc_irq(int irq, void *dev) unsigned int fsm; status = tscadc_readl(ts_dev, REG_IRQSTATUS); - if (status & IRQENB_FIFO1THRES) { + if (status & IRQENB_FIFO0THRES) { tscadc_read_coordinates(ts_dev, &x, &y); z1 = tscadc_readl(ts_dev, REG_FIFO0) & 0xfff; @@ -303,7 +305,7 @@ static irqreturn_t tscadc_irq(int irq, void *dev) input_sync(input_dev); } } - irqclr |= IRQENB_FIFO1THRES; + irqclr |= IRQENB_FIFO0THRES; } /* @@ -446,9 +448,9 @@ static int __devinit tscadc_probe(struct platform_device *pdev) tscadc_writel(ts_dev, REG_CTRL, ctrl); tscadc_idle_config(ts_dev); - tscadc_writel(ts_dev, REG_IRQENABLE, IRQENB_FIFO1THRES); + tscadc_writel(ts_dev, REG_IRQENABLE, IRQENB_FIFO0THRES); tscadc_step_config(ts_dev); - tscadc_writel(ts_dev, REG_FIFO1THR, ts_dev->steps_to_configure); + tscadc_writel(ts_dev, REG_FIFO0THR, ts_dev->steps_to_configure); ctrl |= CNTRLREG_TSCSSENB; tscadc_writel(ts_dev, REG_CTRL, ctrl);