Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp433485ybl; Fri, 23 Aug 2019 03:08:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqwr5r5AEtGO0ZpLhnpgp3vmrCcZ/h4LZbx/Wsz7fZxxo7BU2Hkbrtvfj1+XsuAAvhFBXilp X-Received: by 2002:a17:902:a58c:: with SMTP id az12mr3932134plb.129.1566554907947; Fri, 23 Aug 2019 03:08:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566554907; cv=none; d=google.com; s=arc-20160816; b=N4KpgZnvNkDOCgWZS6qFFVtxO305ShZq+AbHhalaNuIo3d6Z0M7IMZlrDH3bQYpBjA JZPsEHxY62DIzcI9ydJjM90hPCRIhz/gb/sfBc+FMtvwIH5Otm4luec05WRKrVcoVHAb JG4qf8dpJHnyq+bVlxxEqu0ScQnWk0DrJJxduYDvtlxQmopjVS21g4SDk8SgemIPHkj7 1mOQHYAx2m/ouL20u1DuHaPlfBcnmrFHmQ6WUQDgr3UkMU7DVecdWz8tKsbSvTASl7Gq /3w2VfWAklp0+co/PzLdw0ACZCdPXaiO/Up/TbuaOk+33bZUWv+lCbdKGH1uajfQTmvM MhlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id; bh=9TWUDG2aQJxYhiKilJwh7VxOmIydRLlVsZU6n2aQM4k=; b=wBAM+fMXSNX8wh4SPc7PjduFXwNVIKwC13p3p3KrK+uhbnclMSqPv2x2amj3/8FhNO xad15w/pmP/0d7GzYmVfagTwnTdWApFldyOQ7tbdRRl1UVQAe/naH9YEemQg7txMBL/7 fX0YBpGjchJwebktf4VWmM24CmVwxIiHh8UrcHaGRcdgBOABpdpR3T+9B784SNS9L2DE wb9h2j/cqCahVTHkNW3Pw9yWXqojWasYuXQ78p1woG+pEXeeG+OmzQd0SrYA25gNqp8u lB9T0nfTe01gnftVloA/U7SOCfdBUF8e3bgCWL2M7Fea5ialB5Y1dYwAaRHW1uphCtbQ /RAQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g24si2186408pfi.119.2019.08.23.03.08.12; Fri, 23 Aug 2019 03:08:27 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404635AbfHWGh3 (ORCPT + 99 others); Fri, 23 Aug 2019 02:37:29 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:42055 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S2404002AbfHWGh3 (ORCPT ); Fri, 23 Aug 2019 02:37:29 -0400 X-UUID: 0fd848586a7c48bc827217bc605e4756-20190823 X-UUID: 0fd848586a7c48bc827217bc605e4756-20190823 Received: from mtkexhb02.mediatek.inc [(172.21.101.103)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0707 with TLS) with ESMTP id 1445397444; Fri, 23 Aug 2019 14:37:23 +0800 Received: from MTKCAS32.mediatek.inc (172.27.4.184) by mtkmbs07n1.mediatek.inc (172.21.101.16) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Fri, 23 Aug 2019 14:37:16 +0800 Received: from [10.17.3.153] (172.27.4.253) by MTKCAS32.mediatek.inc (172.27.4.170) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Fri, 23 Aug 2019 14:37:15 +0800 Message-ID: <1566542240.12318.53.camel@mhfsdcap03> Subject: Re: [PATCH v2 2/4] rtc: Add support for the MediaTek MT2712 RTC From: Ran Bi To: Alexandre Belloni CC: Rob Herring , Matthias Brugger , Alessandro Zummo , "Mark Rutland" , Mauro Carvalho Chehab , "David S . Miller" , Greg Kroah-Hartman , Jonathan Cameron , Linus Walleij , Nicolas Ferre , , , , , , , YT Shen , Eddie Huang , Yingjoe Chen , "Flora Fu" , Sean Wang Date: Fri, 23 Aug 2019 14:37:20 +0800 In-Reply-To: <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> <20190822133649.GT27031@piout.net> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4-0ubuntu2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2019-08-22 at 15:36 +0200, Alexandre Belloni wrote: > 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 > > Ok, I will change it at next patch. Best Regards, Ran