From patchwork Thu Dec 3 03:17:09 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 64402 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nB33HHUm030890 for ; Thu, 3 Dec 2009 03:17:18 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752914AbZLCDRK (ORCPT ); Wed, 2 Dec 2009 22:17:10 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752947AbZLCDRK (ORCPT ); Wed, 2 Dec 2009 22:17:10 -0500 Received: from mail-pw0-f42.google.com ([209.85.160.42]:49793 "EHLO mail-pw0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752914AbZLCDRI (ORCPT ); Wed, 2 Dec 2009 22:17:08 -0500 Received: by pwi3 with SMTP id 3so704929pwi.21 for ; Wed, 02 Dec 2009 19:17:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=9W9v8R73LYZy/X9wP5cFmtbuu0u+2sMamgIHbIr7xfo=; b=fRF+Ll7H1DSGAVLdvxvw3KMDlODYqnLAOk2i22etjxwwB9Gzlf6S/QFqg/paM+nN9l O1XQwmVrRbWYZ1hbnPnCv9K1VNyU7PiXANRdHGHmMuC93UxEmcxi2QmOWrk/QLF7REkU SWiV06+qN+ShmdLlKPjubeNDGWzUNXXHuoSsU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=Kwkaq1dZlnNofUL1xAnIky6GqfttST9Kr0csH+EaAn3EHICuWJckuRit1llP4hhpC5 Va2p4gvNPUushVb0NbucoOw4saNeV0hRzLpbLlIRBtYjCSQU3LkJPr1xbogzQxk2riCH YuA/FQBdTB24VOv8tgcpHElNH7GTvXFvLfCFM= Received: by 10.115.86.3 with SMTP id o3mr1608898wal.206.1259810234362; Wed, 02 Dec 2009 19:17:14 -0800 (PST) Received: from mailhub.coreip.homeip.net (c-24-6-153-137.hsd1.ca.comcast.net [24.6.153.137]) by mx.google.com with ESMTPS id 22sm1325353pzk.14.2009.12.02.19.17.11 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 02 Dec 2009 19:17:11 -0800 (PST) Date: Wed, 2 Dec 2009 19:17:09 -0800 From: Dmitry Torokhov To: Pavel Machek Cc: Eric Miao , rpurdie@rpsys.net, lenz@cs.wisc.edu, kernel list , Dirk@opfer-online.de, arminlitzel@web.de, Cyril Hrubis , thommycheck@gmail.com, linux-arm-kernel , dbaryshkov@gmail.com, omegamoon@gmail.com, utx@penguin.cz, linux-input@vger.kernel.org, "Rafael J. Wysocki" Subject: Re: 32-rc1 aka 32-rc2: warning at manage.c:361 (set_irq_wake), matrix-keypad related? Message-ID: <20091203031709.GE9121@core.coreip.homeip.net> References: <20090930200746.GA1384@ucw.cz> <20091006050649.GH27881@core.coreip.homeip.net> <20091006075816.GA1362@ucw.cz> <20091007043603.GC10204@core.coreip.homeip.net> <20091007163327.GA12053@core.coreip.homeip.net> <20091007211225.GB17805@elf.ucw.cz> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20091007211225.GB17805@elf.ucw.cz> User-Agent: Mutt/1.5.19 (2009-01-05) Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org diff --git a/drivers/input/keyboard/matrix_keypad.c b/drivers/input/keyboard/matrix_keypad.c index 91cfe51..a1152ba 100644 --- a/drivers/input/keyboard/matrix_keypad.c +++ b/drivers/input/keyboard/matrix_keypad.c @@ -29,11 +29,13 @@ struct matrix_keypad { unsigned short *keycodes; unsigned int row_shift; + DECLARE_BITMAP(disabled_gpios, MATRIX_MAX_ROWS); + uint32_t last_key_state[MATRIX_MAX_COLS]; struct delayed_work work; + spinlock_t lock; bool scan_pending; bool stopped; - spinlock_t lock; }; /* @@ -221,9 +223,16 @@ static int matrix_keypad_suspend(struct platform_device *pdev, pm_message_t stat matrix_keypad_stop(keypad->input_dev); - if (device_may_wakeup(&pdev->dev)) - for (i = 0; i < pdata->num_row_gpios; i++) - enable_irq_wake(gpio_to_irq(pdata->row_gpios[i])); + if (device_may_wakeup(&pdev->dev)) { + for (i = 0; i < pdata->num_row_gpios; i++) { + if (!test_bit(i, keypad->disabled_gpios)) { + unsigned int gpio = pdata->row_gpios[i]; + + if (enable_irq_wake(gpio_to_irq(gpio)) == 0) + __set_bit(i, keypad->disabled_gpios); + } + } + } return 0; } @@ -234,9 +243,15 @@ static int matrix_keypad_resume(struct platform_device *pdev) const struct matrix_keypad_platform_data *pdata = keypad->pdata; int i; - if (device_may_wakeup(&pdev->dev)) - for (i = 0; i < pdata->num_row_gpios; i++) - disable_irq_wake(gpio_to_irq(pdata->row_gpios[i])); + if (device_may_wakeup(&pdev->dev)) { + for (i = 0; i < pdata->num_row_gpios; i++) { + if (test_and_clear_bit(i, keypad->disabled_gpios)) { + unsigned int gpio = pdata->row_gpios[i]; + + disable_irq_wake(gpio_to_irq(gpio)); + } + } + } matrix_keypad_start(keypad->input_dev);