Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1027233ybl; Thu, 22 Aug 2019 08:19:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqwz/mtBBfNX+N6skeOgeObXxjLeKOqDO+fQNB8CIXQa5luW8FHMgD45ZnJX6dvlIBjwSx0X X-Received: by 2002:a62:37c5:: with SMTP id e188mr24691342pfa.207.1566487180654; Thu, 22 Aug 2019 08:19:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566487180; cv=none; d=google.com; s=arc-20160816; b=UqU9CsHs6bZZ81CWcfSg3cj425hFoCMJAWGZAgmQuXQkZ4xylZiio75HgMQBgSHgIq oDLYS8r70gbkCfhVIWE+w/h7vo/cDEQWATuoKRQ1Xq7cYlwFwLUV5xui9PawATFpErSg ZvxeSxYKg9xWZIbPD68d3hV87Wx36oz+Ch55SLtm7OsV4NFE+Fd3NjX+lNmY0cHAz5l7 pIzjUgw7ORVyCT9YM+uLwLbYfwditCsu7HiLEQ/pmmk0qsnHCa/lB6MThCJKmv6dcYww rhaD+00LuawQ1/4ieTsI2nmDbvglTAr56lzcz61qTgFbjkeeW2sC4ykAYNDQqOxvznuO 1aBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=YZTi+uNALh1pr0st1+OdsdHCy1+YxQqR8MbgLdWYKRE=; b=wmq8eIhNyj7Vbn9yk6Yh1/lmuGfov2hhdsWoS9/Q5OxbnVi94qidjX/ljC6AJ/uVLC 57qtq9xm9NaWpRrHvAEmCw2Z5O4hgMvRxja+h+81jXMdgFOAi1MWiHTBUnIXwyGiZFcV /2TPfiEybmQoBD3TecDFM7dqihT3cCCaf1/zjtKCZNBO5KSU+vol8Ot1fmWrLOnIQm1J uQCvu/ysNwcCdqeUZbcA2zCMCGrr0mVX5DV6zOqPEzc79fBAvZY1YlK274VfcZ6fi+iE aR3tCCyDkgZAuK45cvbsuGw7Xz+cOatjM5RBe2p+KOwsLmzeBrH+BTLioLu/GSvlQ/7r Wqfg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c4si18132311pfn.71.2019.08.22.08.19.24; Thu, 22 Aug 2019 08:19:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389039AbfHVNgz (ORCPT + 99 others); Thu, 22 Aug 2019 09:36:55 -0400 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:50595 "EHLO relay5-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725797AbfHVNgz (ORCPT ); Thu, 22 Aug 2019 09:36:55 -0400 X-Originating-IP: 86.207.98.53 Received: from localhost (aclermont-ferrand-651-1-259-53.w86-207.abo.wanadoo.fr [86.207.98.53]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id BDE321C000D; Thu, 22 Aug 2019 13:36:50 +0000 (UTC) Date: Thu, 22 Aug 2019 15:36:49 +0200 From: Alexandre Belloni To: Ran Bi Cc: Rob Herring , Matthias Brugger , Alessandro Zummo , Mark Rutland , Mauro Carvalho Chehab , "David S . Miller" , Greg Kroah-Hartman , Jonathan Cameron , Linus Walleij , Nicolas Ferre , linux-rtc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, srv_heupstream@mediatek.com, YT Shen , Eddie Huang , Yingjoe Chen , Flora Fu , Sean Wang Subject: Re: [PATCH v2 2/4] rtc: Add support for the MediaTek MT2712 RTC Message-ID: <20190822133649.GT27031@piout.net> References: <20190801110122.26834-1-ran.bi@mediatek.com> <20190801110122.26834-3-ran.bi@mediatek.com> <20190820201744.GZ3545@piout.net> <1566477254.12318.41.camel@mhfsdcap03> <20190822124628.GS27031@piout.net> <1566480361.12318.50.camel@mhfsdcap03> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1566480361.12318.50.camel@mhfsdcap03> User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 22/08/2019 21:26:01+0800, Ran Bi wrote: > On Thu, 2019-08-22 at 14:46 +0200, Alexandre Belloni wrote: > > On 22/08/2019 20:34:14+0800, Ran Bi wrote: > > > > > + /* RTC need POWERKEY1/2 match, then goto normal work mode */ > > > > > + mt2712_writel(rtc, MT2712_POWERKEY1, MT2712_POWERKEY1_KEY); > > > > > + mt2712_writel(rtc, MT2712_POWERKEY2, MT2712_POWERKEY2_KEY); > > > > > > > > This should be written when setting the time after power was lost. > > > > > > > > > > I suppose we can move this into mt2712_rtc_read_time function's "if > > > (p1 != MT2712_POWERKEY1_KEY || p2 != MT2712_POWERKEY2_KEY)" condition > > > which will be added at next patch. We need additional flag to mark this > > > condition or another if condition in mt2712_rtc_set_time fucntion if we > > > put these code in mt2712_rtc_set_time function. > > > > > > > It is fine to test both in read_time and in set_time. > > > > Do you mean that we can test powerkey and then set powerkey both in > read_time and in set_time? > I mean that can test in read_time and test and set in set_time -- Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com