From patchwork Mon Oct 12 01:17:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wenyou Yang X-Patchwork-Id: 528877 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail-oi0-x23c.google.com (mail-oi0-x23c.google.com [IPv6:2607:f8b0:4003:c06::23c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 0E27B140281 for ; Mon, 12 Oct 2015 12:21:39 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.b=Nw6Po6Tk; dkim-atps=neutral Received: by oiaj5 with SMTP id j5sf2750404oia.0 for ; Sun, 11 Oct 2015 18:21:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=from:to:cc:subject:date:message-id:mime-version:content-type :x-original-sender:x-original-authentication-results:reply-to :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:sender:list-subscribe:list-unsubscribe; bh=/cmcRc98coXJWGgvPvOJkzVI1KtrIe3oltvLWCfco9o=; b=Nw6Po6TkiGxzQCQvDa7v8QRI+NdN/lFIphFqegcEtqeQkKFtJJBACsBgwSj1tZZMYV KgUMgbyamk/avUm3LQ55nK4qnWdl9mr5r7oDSgKNeozgFZLgoV+uhaeAUOd1vcBB8rJX uoMiZZvhn3ltCc5GBY8HGg0Ngtis9qxv6BzkJIemjzf7XV3VaX68n56PBwJXES8UOjA+ ww68aRY//O1njDr6tYAGu7PG3Gch6hTgPEpmK4bfF4UL0Y284g3sHPuTwrZu3Ht38k7p 7sOpQog8PrMy1EzH6Zcl3C97gX/jiyijNxOe6cp9FiH74giSlvwXMGtbjsVESG8Xkkgt bL0w== X-Received: by 10.50.43.229 with SMTP id z5mr103133igl.8.1444612897653; Sun, 11 Oct 2015 18:21:37 -0700 (PDT) X-BeenThere: rtc-linux@googlegroups.com Received: by 10.107.11.138 with SMTP id 10ls249015iol.10.gmail; Sun, 11 Oct 2015 18:21:37 -0700 (PDT) X-Received: by 10.107.25.201 with SMTP id 192mr23330329ioz.21.1444612897351; Sun, 11 Oct 2015 18:21:37 -0700 (PDT) Received: from SJOEDG01.corp.atmel.com (nasmtp02.atmel.com. [204.2.163.16]) by gmr-mx.google.com with ESMTPS id cj2si482854igb.1.2015.10.11.18.21.37 for (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 11 Oct 2015 18:21:37 -0700 (PDT) Received-SPF: pass (google.com: domain of wenyou.yang@atmel.com designates 204.2.163.16 as permitted sender) client-ip=204.2.163.16; Received: from apsmtp01.atmel.com (10.168.254.30) by sjoedg01.corp.atmel.com (10.64.253.30) with Microsoft SMTP Server (TLS) id 14.3.235.1; Sun, 11 Oct 2015 18:29:02 -0700 Received: from shaarm01.corp.atmel.com (10.168.254.13) by apsmtp01.corp.atmel.com (10.168.254.30) with Microsoft SMTP Server id 14.3.235.1; Mon, 12 Oct 2015 09:21:02 +0800 From: Wenyou Yang To: Alessandro Zummo , Alexandre Belloni CC: Nicolas Ferre , Ludovic Desroches , , , , Wenyou Yang Subject: [rtc-linux] [PATCH] rtc: at91rm9200: clear RTC alarm status flag prior to suspending Date: Mon, 12 Oct 2015 09:17:57 +0800 Message-ID: <1444612677-26178-1-git-send-email-wenyou.yang@atmel.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 X-Original-Sender: wenyou.yang@atmel.com X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of wenyou.yang@atmel.com designates 204.2.163.16 as permitted sender) smtp.mailfrom=wenyou.yang@atmel.com Reply-To: rtc-linux@googlegroups.com Precedence: list Mailing-list: list rtc-linux@googlegroups.com; contact rtc-linux+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: rtc-linux@googlegroups.com X-Google-Group-Id: 712029733259 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , This patch is to clear the RTC alarm status flag prior to suspending to avoid the erroneous wake-up activity. Signed-off-by: Wenyou Yang --- drivers/rtc/rtc-at91rm9200.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/rtc/rtc-at91rm9200.c b/drivers/rtc/rtc-at91rm9200.c index cb62e21..b60fd47 100644 --- a/drivers/rtc/rtc-at91rm9200.c +++ b/drivers/rtc/rtc-at91rm9200.c @@ -495,6 +495,8 @@ static int at91_rtc_suspend(struct device *dev) /* this IRQ is shared with DBGU and other hardware which isn't * necessarily doing PM like we are... */ + at91_rtc_write(AT91_RTC_SCCR, AT91_RTC_ALARM); + at91_rtc_imr = at91_rtc_read_imr() & (AT91_RTC_ALARM|AT91_RTC_SECEV); if (at91_rtc_imr) {