From patchwork Tue Oct 12 09:58:36 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Wang X-Patchwork-Id: 247351 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 o9C9sSNq018377 for ; Tue, 12 Oct 2010 09:54:28 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757076Ab0JLJy1 (ORCPT ); Tue, 12 Oct 2010 05:54:27 -0400 Received: from mail.windriver.com ([147.11.1.11]:43766 "EHLO mail.windriver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756970Ab0JLJy1 (ORCPT ); Tue, 12 Oct 2010 05:54:27 -0400 Received: from ALA-MAIL03.corp.ad.wrs.com (ala-mail03 [147.11.57.144]) by mail.windriver.com (8.14.3/8.14.3) with ESMTP id o9C9sNmh025543; Tue, 12 Oct 2010 02:54:23 -0700 (PDT) Received: from [128.224.163.220] ([128.224.163.220]) by ALA-MAIL03.corp.ad.wrs.com with Microsoft SMTPSVC(6.0.3790.1830); Tue, 12 Oct 2010 02:54:22 -0700 Message-ID: <4CB4314C.7050308@gmail.com> Date: Tue, 12 Oct 2010 17:58:36 +0800 From: Jason Wang User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Dmitry Torokhov CC: notasas@gmail.com, vapier@gentoo.org, linux-input@vger.kernel.org Subject: Re: [PATCH 4/4] Input: ads7846 - modificatons of _stop()/_disable() conditions References: <1284634286-8871-1-git-send-email-jason77.wang@gmail.com> <1284634286-8871-4-git-send-email-jason77.wang@gmail.com> <1284634286-8871-5-git-send-email-jason77.wang@gmail.com> <201009162339.06395.dmitry.torokhov@gmail.com> <4C9332CE.6040905@gmail.com> <20100917160709.GC14186@core.coreip.homeip.net> <4C9718E9.5040104@gmail.com> In-Reply-To: <4C9718E9.5040104@gmail.com> X-OriginalArrivalTime: 12 Oct 2010 09:54:22.0576 (UTC) FILETIME=[724C3F00:01CB69F3] 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 (demeter1.kernel.org [140.211.167.41]); Tue, 12 Oct 2010 09:54:28 +0000 (UTC) diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c index eab8b0b..25333db 100644 --- a/drivers/input/touchscreen/ads7846.c +++ b/drivers/input/touchscreen/ads7846.c @@ -253,9 +253,10 @@ static void ads7846_enable(struct ads7846 *ts) { mutex_lock(&ts->lock); - if (ts->disabled && !ts->suspended) + if (ts->disabled && !ts->suspended) { + ts->disabled = false; __ads7846_enable(ts); - + } ts->disabled = false; mutex_unlock(&ts->lock); @@ -919,10 +920,10 @@ static int ads7846_resume(struct spi_device *spi) if (device_may_wakeup(&ts->spi->dev)) disable_irq_wake(ts->spi->irq); + ts->suspended = false; + if (!ts->disabled) __ads7846_enable(ts); - - ts->suspended = false; } mutex_unlock(&ts->lock);