From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexandre Belloni Subject: Re: [PATCH v2 2/4] rtc: Add support for the MediaTek MT2712 RTC Date: Thu, 22 Aug 2019 15:36:49 +0200 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 Return-path: Content-Disposition: inline In-Reply-To: <1566480361.12318.50.camel@mhfsdcap03> Sender: linux-kernel-owner@vger.kernel.org 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 List-Id: devicetree@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