From patchwork Wed Apr 1 14:39:20 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 15701 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 n31EgAMZ016267 for ; Wed, 1 Apr 2009 14:42:10 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761752AbZDAOmK (ORCPT ); Wed, 1 Apr 2009 10:42:10 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1763455AbZDAOmK (ORCPT ); Wed, 1 Apr 2009 10:42:10 -0400 Received: from ti-out-0910.google.com ([209.85.142.189]:44843 "EHLO ti-out-0910.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761752AbZDAOmI (ORCPT ); Wed, 1 Apr 2009 10:42:08 -0400 Received: by ti-out-0910.google.com with SMTP id i7so52172tid.23 for ; Wed, 01 Apr 2009 07:42:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:date:message-id :subject; bh=xcVz0p3yd1o4eHr7yL9Lbf/dSo41rcbSxST+sa+QEMs=; b=oJ/4kv8B0xv0SGxIjAwIMI/aWiFtFhZViJ9Qy+I3LczaB8gfMhLchnNV6FWGYYPwUv 7rZFAAgLLMBPaonSLFYX+CNrbU4XdP1T/XTEagArh3Mo4IZicj83mjc0U33uU/Qi0FmL X/+W4aJFLr1R8q9xty8R7JBiuorInSBaurcHs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:date:message-id:subject; b=B12Jy+6dMkN7n2j5NJ/BXTaDq0iFvmwAvibyrywjdcrNZd/zz9CVORR3ALdqdKg2jW l/f6dFxmNC2WQ1Ap3w3jYvxRBnl+23+wWnFVTBvChN1LL1e58k81kbHkYwb2En2jiG2g Y8vt8VNcFWmC38WQ6pdQhoPr2QKIDLPglw2eg= Received: by 10.110.63.17 with SMTP id l17mr999440tia.16.1238596923953; Wed, 01 Apr 2009 07:42:03 -0700 (PDT) Received: from rx1.opensource.se (210.5.32.202.bf.2iij.net [202.32.5.210]) by mx.google.com with ESMTPS id w12sm56568tib.20.2009.04.01.07.41.57 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 01 Apr 2009 07:41:59 -0700 (PDT) From: Magnus Damm To: linux-sh@vger.kernel.org Cc: Magnus Damm , lethal@linux-sh.org Date: Wed, 01 Apr 2009 23:39:20 +0900 Message-Id: <20090401143920.32738.82373.sendpatchset@rx1.opensource.se> Subject: [PATCH] sh_keysc: use enable/disable_irq_wake() Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org From: Magnus Damm Modify the sh_keysc driver to use enable/disable_irq_wake() during suspend and resume. These functions are used to enable the sh_keysc interrupt in the interrupt controller so the keypad can be used to wakeup the system from suspend. Signed-off-by: Magnus Damm --- Tested with wakeup disabled and enabled on a Migo-R board. drivers/input/keyboard/sh_keysc.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- 0001/drivers/input/keyboard/sh_keysc.c +++ work/drivers/input/keyboard/sh_keysc.c 2009-04-01 22:55:59.000000000 +0900 @@ -259,12 +259,15 @@ static int sh_keysc_suspend(struct devic { struct platform_device *pdev = to_platform_device(dev); struct sh_keysc_priv *priv = platform_get_drvdata(pdev); + int irq = platform_get_irq(pdev, 0); unsigned short value; value = ioread16(priv->iomem_base + KYCR1_OFFS); - if (device_may_wakeup(dev)) + if (device_may_wakeup(dev)) { value |= 0x80; + enable_irq_wake(irq); + } else value &= ~0x80; @@ -272,8 +275,20 @@ static int sh_keysc_suspend(struct devic return 0; } +static int sh_keysc_resume(struct device *dev) +{ + struct platform_device *pdev = to_platform_device(dev); + int irq = platform_get_irq(pdev, 0); + + if (device_may_wakeup(dev)) + disable_irq_wake(irq); + + return 0; +} + static struct dev_pm_ops sh_keysc_dev_pm_ops = { .suspend = sh_keysc_suspend, + .resume = sh_keysc_resume, }; struct platform_driver sh_keysc_device_driver = {