From patchwork Mon Sep 20 08:18:49 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Wang X-Patchwork-Id: 194392 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 o8K8F8xH004158 for ; Mon, 20 Sep 2010 08:15:08 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751636Ab0ITIPH (ORCPT ); Mon, 20 Sep 2010 04:15:07 -0400 Received: from mail.windriver.com ([147.11.1.11]:63867 "EHLO mail.windriver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750778Ab0ITIPH (ORCPT ); Mon, 20 Sep 2010 04:15:07 -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 o8K8F2RU000398; Mon, 20 Sep 2010 01:15:02 -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); Mon, 20 Sep 2010 01:15:01 -0700 Message-ID: <4C9718E9.5040104@gmail.com> Date: Mon, 20 Sep 2010 16:18:49 +0800 From: Jason Wang User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Dmitry Torokhov CC: Jason Wang , 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> In-Reply-To: <20100917160709.GC14186@core.coreip.homeip.net> X-OriginalArrivalTime: 20 Sep 2010 08:15:02.0109 (UTC) FILETIME=[EC7EA8D0:01CB589B] 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]); Mon, 20 Sep 2010 08:15:09 +0000 (UTC) --- a/drivers/input/touchscreen/ads7846.c +++ b/drivers/input/touchscreen/ads7846.c @@ -253,10 +253,11 @@ 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; + } else + 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);