From patchwork Tue Aug 2 12:46:45 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Hennerich, Michael" X-Patchwork-Id: 1029362 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p72ClpbD008205 for ; Tue, 2 Aug 2011 12:47:51 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754431Ab1HBMru (ORCPT ); Tue, 2 Aug 2011 08:47:50 -0400 Received: from ch1ehsobe006.messaging.microsoft.com ([216.32.181.186]:50641 "EHLO ch1outboundpool.messaging.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754424Ab1HBMru (ORCPT ); Tue, 2 Aug 2011 08:47:50 -0400 Received: from mail102-ch1-R.bigfish.com (216.32.181.171) by CH1EHSOBE006.bigfish.com (10.43.70.56) with Microsoft SMTP Server id 14.1.225.22; Tue, 2 Aug 2011 12:47:48 +0000 Received: from mail102-ch1 (localhost.localdomain [127.0.0.1]) by mail102-ch1-R.bigfish.com (Postfix) with ESMTP id B064310200F6; Tue, 2 Aug 2011 12:47:48 +0000 (UTC) X-SpamScore: 0 X-BigFish: VPS0(zzzz1202hzz8275bhz2dh2a8h668h839h63h) X-Spam-TCS-SCL: 2:0 X-Forefront-Antispam-Report: CIP:137.71.25.55; KIP:(null); UIP:(null); IPVD:NLI; H:nwd2mta1.analog.com; RD:nwd2mail10.analog.com; EFVD:NLI Received: from mail102-ch1 (localhost.localdomain [127.0.0.1]) by mail102-ch1 (MessageSwitch) id 1312289268417430_8940; Tue, 2 Aug 2011 12:47:48 +0000 (UTC) Received: from CH1EHSMHS003.bigfish.com (snatpool1.int.messaging.microsoft.com [10.43.68.242]) by mail102-ch1.bigfish.com (Postfix) with ESMTP id 61A24310051; Tue, 2 Aug 2011 12:47:48 +0000 (UTC) Received: from nwd2mta1.analog.com (137.71.25.55) by CH1EHSMHS003.bigfish.com (10.43.70.3) with Microsoft SMTP Server (TLS) id 14.1.225.22; Tue, 2 Aug 2011 12:47:43 +0000 Received: from NWD2HUBCAS2.ad.analog.com (nwd2hubcas2.ad.analog.com [10.64.73.30]) by nwd2mta1.analog.com (8.13.8/8.13.8) with ESMTP id p72CjTX2012691 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL); Tue, 2 Aug 2011 08:45:33 -0400 Received: from zeus.spd.analog.com (10.64.82.11) by NWD2HUBCAS2.ad.analog.com (10.64.73.30) with Microsoft SMTP Server id 8.3.83.0; Tue, 2 Aug 2011 08:47:40 -0400 Received: from localhost.localdomain ([10.44.2.88]) by zeus.spd.analog.com (8.14.1/8.14.1) with ESMTP id p72CldkB004278; Tue, 2 Aug 2011 08:47:39 -0400 (EDT) From: To: CC: , , , Michael Hennerich Subject: [PATCH] input: touchscreen: ad7879: Fix deficient device disable Date: Tue, 2 Aug 2011 14:46:45 +0200 Message-ID: <1312289205-9936-1-git-send-email-michael.hennerich@analog.com> X-Mailer: git-send-email 1.7.0.4 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 (demeter2.kernel.org [140.211.167.43]); Tue, 02 Aug 2011 12:47:51 +0000 (UTC) From: Michael Hennerich Input close or device disable should not interact with the exported gpiolib functionality. However that's the case. __ad7879_disable() clears the entire AD7879_REG_CTRL2, while it should just power down the ADC and its reference. Signed-off-by: Michael Hennerich --- drivers/input/touchscreen/ad7879.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/drivers/input/touchscreen/ad7879.c b/drivers/input/touchscreen/ad7879.c index bc3b518..131f9d1 100644 --- a/drivers/input/touchscreen/ad7879.c +++ b/drivers/input/touchscreen/ad7879.c @@ -249,12 +249,14 @@ static void __ad7879_enable(struct ad7879 *ts) static void __ad7879_disable(struct ad7879 *ts) { + u16 reg = (ts->cmd_crtl2 & ~AD7879_PM(-1)) | + AD7879_PM(AD7879_PM_SHUTDOWN); disable_irq(ts->irq); if (del_timer_sync(&ts->timer)) ad7879_ts_event_release(ts); - ad7879_write(ts, AD7879_REG_CTRL2, AD7879_PM(AD7879_PM_SHUTDOWN)); + ad7879_write(ts, AD7879_REG_CTRL2, reg); }