From patchwork Tue Oct 21 17:38:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 5126951 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A3FEC9F387 for ; Tue, 21 Oct 2014 17:49:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D48182021F for ; Tue, 21 Oct 2014 17:49:23 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0BA6320109 for ; Tue, 21 Oct 2014 17:49:23 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XgdW3-0003jF-EP; Tue, 21 Oct 2014 17:46:39 +0000 Received: from merlin.infradead.org ([2001:4978:20e::2]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XgdUn-0003ER-Ck for linux-arm-kernel@bombadil.infradead.org; Tue, 21 Oct 2014 17:45:21 +0000 Received: from mail-lb0-x232.google.com ([2a00:1450:4010:c04::232]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XgdUl-0000f4-M2 for linux-arm-kernel@lists.infradead.org; Tue, 21 Oct 2014 17:45:20 +0000 Received: by mail-lb0-f178.google.com with SMTP id w7so1465762lbi.9 for ; Tue, 21 Oct 2014 10:44:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=gHMrapyA+rz1oVgJvO3aBcNFAGvv+Q857xafmdWfQao=; b=brcTkIfetUIDMDjfnvGC55cio11tc1Rc0gsggSeNybMYDlQrlFCpptjxn8iEUnezdH JTZc+CHtyI0ta2ZfVIvIpHdspP4OiUp7IFPxV3r2LZSSUsQ66rSFnBReEPAWIkaOLIb9 wkCGJQOcrXDP5eUOY6bOj8atD0RbRLkbTEdaB0autbtCQ09Pq9h+qONHGTnzXvW7HTx+ rLLiIOvF2PsU/nx/Lo0SE5cZHnX30ZUfzkeYAygCUn2CNlp540bEg4YjR/7Zo0S0L8+g tBqf6FDnWKAN7tTKGwEh96YTGAHGMZ/ecdDRrX33jt2P+3tbBHh0497VRGLw3FxaAJlO gYoQ== X-Received: by 10.152.3.168 with SMTP id d8mr36548653lad.34.1413913494975; Tue, 21 Oct 2014 10:44:54 -0700 (PDT) Received: from xi.terra (s83-177-171-8.cust.tele2.se. [83.177.171.8]) by mx.google.com with ESMTPSA id eg2sm4806161lbb.29.2014.10.21.10.44.50 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Oct 2014 10:44:52 -0700 (PDT) X-Google-Original-Sender: Received: from johan by xi.terra with local (Exim 4.84) (envelope-from ) id 1XgdRO-0003O4-Is; Tue, 21 Oct 2014 19:41:50 +0200 From: Johan Hovold To: Alessandro Zummo , Tony Lindgren , =?UTF-8?q?Beno=C3=AEt=20Cousson?= , Felipe Balbi Subject: [PATCH v2 16/20] rtc: omap: enable wake-up from power off Date: Tue, 21 Oct 2014 19:38:02 +0200 Message-Id: <1413913086-12730-17-git-send-email-johan@kernel.org> X-Mailer: git-send-email 2.0.4 In-Reply-To: <1413913086-12730-1-git-send-email-johan@kernel.org> References: <1412881594-25678-1-git-send-email-johan@kernel.org> <1413913086-12730-1-git-send-email-johan@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141021_134519_912129_2ED61DEB X-CRM114-Status: GOOD ( 14.08 ) X-Spam-Score: -1.9 (-) Cc: devicetree@vger.kernel.org, rtc-linux@googlegroups.com, Lokesh Vutla , j-keerthy@ti.com, nsekhar@ti.com, linux-kernel@vger.kernel.org, Johan Hovold , t-kristo@ti.com, linux-arm-kernel@lists.infradead.org, Andrew Morton , linux-omap@vger.kernel.org, Guenter Roeck X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The ALARM interrupt must not be disabled during shutdown in order to be able to power up the system using an RTC alarm. Signed-off-by: Johan Hovold --- drivers/rtc/rtc-omap.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/rtc/rtc-omap.c b/drivers/rtc/rtc-omap.c index f6c93f877857..cb5ef3c845d1 100644 --- a/drivers/rtc/rtc-omap.c +++ b/drivers/rtc/rtc-omap.c @@ -687,8 +687,15 @@ static SIMPLE_DEV_PM_OPS(omap_rtc_pm_ops, omap_rtc_suspend, omap_rtc_resume); static void omap_rtc_shutdown(struct platform_device *pdev) { struct omap_rtc *rtc = platform_get_drvdata(pdev); + u8 mask; - rtc_write(rtc, OMAP_RTC_INTERRUPTS_REG, 0); + /* + * Keep the ALARM interrupt enabled to allow the system to power up on + * alarm events. + */ + mask = rtc_read(rtc, OMAP_RTC_INTERRUPTS_REG); + mask &= OMAP_RTC_INTERRUPTS_IT_ALARM; + rtc_write(rtc, OMAP_RTC_INTERRUPTS_REG, mask); } static struct platform_driver omap_rtc_driver = {