From patchwork Tue May 10 11:35:07 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Hennerich, Michael" X-Patchwork-Id: 774092 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p4ABii0p014173 for ; Tue, 10 May 2011 11:44:45 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755389Ab1EJLoj (ORCPT ); Tue, 10 May 2011 07:44:39 -0400 Received: from tx2ehsobe001.messaging.microsoft.com ([65.55.88.11]:43980 "EHLO TX2EHSOBE002.bigfish.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755811Ab1EJLoh (ORCPT ); Tue, 10 May 2011 07:44:37 -0400 Received: from mail32-tx2-R.bigfish.com (10.9.14.235) by TX2EHSOBE002.bigfish.com (10.9.40.22) with Microsoft SMTP Server id 14.1.225.8; Tue, 10 May 2011 11:44:36 +0000 Received: from mail32-tx2 (localhost.localdomain [127.0.0.1]) by mail32-tx2-R.bigfish.com (Postfix) with ESMTP id 6C88325037B; Tue, 10 May 2011 11:44:36 +0000 (UTC) X-SpamScore: 0 X-BigFish: VPS0(zzzz1202hzz8275bhz2dh2a8h668h839h62h) X-Spam-TCS-SCL: 1:0 X-Forefront-Antispam-Report: KIP:(null); UIP:(null); IPVD:NLI; H:NWD2EDG1.analog.com; RD:none; EFVD:NLI Received: from mail32-tx2 (localhost.localdomain [127.0.0.1]) by mail32-tx2 (MessageSwitch) id 1305027876117561_10063; Tue, 10 May 2011 11:44:36 +0000 (UTC) Received: from TX2EHSMHS020.bigfish.com (unknown [10.9.14.241]) by mail32-tx2.bigfish.com (Postfix) with ESMTP id 13E4A148005B; Tue, 10 May 2011 11:44:36 +0000 (UTC) Received: from NWD2EDG1.analog.com (137.71.25.53) by TX2EHSMHS020.bigfish.com (10.9.99.120) with Microsoft SMTP Server (TLS) id 14.1.225.8; Tue, 10 May 2011 11:44:32 +0000 Received: from NWD2HUBCAS1.ad.analog.com (10.64.73.29) by NWD2EDG1.analog.com (137.71.25.53) with Microsoft SMTP Server (TLS) id 8.1.240.5; Tue, 10 May 2011 07:44:02 -0400 Received: from zeus.spd.analog.com (10.64.82.11) by NWD2HUBCAS1.ad.analog.com (10.64.73.29) with Microsoft SMTP Server id 8.1.358.0; Tue, 10 May 2011 07:44:30 -0400 Received: from localhost.localdomain ([10.44.2.88]) by zeus.spd.analog.com (8.14.1/8.14.1) with ESMTP id p4ABiPtI023644; Tue, 10 May 2011 07:44:29 -0400 (EDT) From: To: CC: , , , , Michael Hennerich Subject: [PATCH 3/5] input: misc: AD714x: Fix thresh and completion interrupt mask and unmask functions Date: Tue, 10 May 2011 13:35:07 +0200 Message-ID: <1305027309-17637-3-git-send-email-michael.hennerich@analog.com> X-Mailer: git-send-email 1.6.0.2 In-Reply-To: <1305027309-17637-1-git-send-email-michael.hennerich@analog.com> References: <1305027309-17637-1-git-send-email-michael.hennerich@analog.com> MIME-Version: 1.0 X-OriginatorOrg: analog.com 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.6 (demeter1.kernel.org [140.211.167.41]); Tue, 10 May 2011 11:44:45 +0000 (UTC) From: Michael Hennerich Fix two issues in the thresh and completion interrupt mask and unmask functions. According to the AD714x datasheets the highest stage completion interrupt should be enabled. Fix mask computation. Signed-off-by: Michael Hennerich --- drivers/input/misc/ad714x.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/input/misc/ad714x.c b/drivers/input/misc/ad714x.c index 9d95397..89554eb 100644 --- a/drivers/input/misc/ad714x.c +++ b/drivers/input/misc/ad714x.c @@ -160,10 +160,10 @@ static void ad714x_use_com_int(struct ad714x_chip *ad714x, unsigned short data; unsigned short mask; - mask = ((1 << (end_stage + 1)) - 1) - (1 << start_stage); + mask = ((1 << (end_stage + 1)) - 1) - ((1 << start_stage) - 1); ad714x->read(ad714x->dev, STG_COM_INT_EN_REG, &data); - data |= 1 << start_stage; + data |= 1 << end_stage; ad714x->write(ad714x->dev, STG_COM_INT_EN_REG, data); ad714x->read(ad714x->dev, STG_HIGH_INT_EN_REG, &data); @@ -177,10 +177,10 @@ static void ad714x_use_thr_int(struct ad714x_chip *ad714x, unsigned short data; unsigned short mask; - mask = ((1 << (end_stage + 1)) - 1) - (1 << start_stage); + mask = ((1 << (end_stage + 1)) - 1) - ((1 << start_stage) - 1); ad714x->read(ad714x->dev, STG_COM_INT_EN_REG, &data); - data &= ~(1 << start_stage); + data &= ~(1 << end_stage); ad714x->write(ad714x->dev, STG_COM_INT_EN_REG, data); ad714x->read(ad714x->dev, STG_HIGH_INT_EN_REG, &data);