Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp1408164ybh; Fri, 13 Mar 2020 00:23:49 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvXXg8RhAlTZ2d57ERaRuopCZsU3+Dtwkgl/ku9FaoucctZUYIW8dP2gWcUSPx2X6TPdpTI X-Received: by 2002:a9d:7f07:: with SMTP id j7mr10130611otq.54.1584084228886; Fri, 13 Mar 2020 00:23:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584084228; cv=none; d=google.com; s=arc-20160816; b=ZsXnmZPtamZEdDLY6a6AppyYQwSwXSxgU0W3WQaB2HIobDiMRN4hvzCBJE+MRD6y30 5A4O4JDFAwGshJfFczYpF5lIHA4tXQiqyvwHlBiCkXPfbHowsQGT9IooBzsuqi6Sq6g3 wswhJfieypOFjiSfecZjmx134cRTriFd4P8D9fJb5Xv/UOfnsZwLjsA2A221cq52Lp1q tPUWrSEn6j0MGzV8icchW8FT2zC6vSiLsQR5DJuBqxSq3PKtf+V2XAF/n3V/G5U0KsqM XnImv3qLKFhjXcx4vfHpdqF9R1O8xoeYc2PaeH/Vf7JXa9lKLfzynYlVcunLwLyDBok1 1oMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=sQxXi9CRhC6J1JA72O4VCpde45a5cXX2Zji3I69uQo4=; b=RjAcTBfm0qDNEEXZU+7x2lsIoqG5TYIR3oUHby1zJmYLEAFv7wD9Z7o4ZRMUgG1FeX xyMoYnrkVDLLHC2tGmfRCuS6Lj+u1WcW/yeLb2NjM0auh/4Qi60Vu8VCHTF4HLv2cmGi irK0kReXXCIiOhKBCvu0txUAEv3Pc2h7iouF/lIpViyRt9+iHuF57s4EK4lfmRfBk/pI y9i8yVKjr2YyD8I6rNVAdTj9JeJZUpFLQdkwljBy4WphmhFRgiAb8IpU3eInFSyYn56U ccDz7B9826epqVt4wtjhyq9EcC4zQ9b5ACD8pp/UWb0WAcR8vHn1XYyIMhnrpL1aVonQ VwVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=j4zuqFUo; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v18si4236393oth.1.2020.03.13.00.23.36; Fri, 13 Mar 2020 00:23:48 -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; dkim=pass header.i=@linaro.org header.s=google header.b=j4zuqFUo; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726462AbgCMHVu (ORCPT + 99 others); Fri, 13 Mar 2020 03:21:50 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:40637 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726060AbgCMHVt (ORCPT ); Fri, 13 Mar 2020 03:21:49 -0400 Received: by mail-wr1-f65.google.com with SMTP id f3so3723859wrw.7 for ; Fri, 13 Mar 2020 00:21:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=sQxXi9CRhC6J1JA72O4VCpde45a5cXX2Zji3I69uQo4=; b=j4zuqFUo45Vugz82Ecfgizma7gF6A9D6+QHJCcpEJLOtWyy782IHdt5nRr2S0vYWrl tCd5QlOFhGEqUCOORfc5U40kPbWKiSMoQxTpqONDLpqIHBiQFBGoAmm9Yy+Yr9YgizWJ fsMC4KUgBQqdxCLj4Z7VtqLTVroMe1Q7nKS2ecVcjc0feUY8R8u2yFzWkVY2/uDRJPYG tIyb/7nj1iiVKEq7DzZgN/Z41e/T+oMiwjQ/f+M1WoZ1GeZUZN987rLGKqyhgNeL8GHU 9OjOEVZaJ/ulyf98yV3CxVR6qr0lnKhuMOTWpuZKnFxIwNmDDyH5V+SjdJcur7pxXaOf UjHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=sQxXi9CRhC6J1JA72O4VCpde45a5cXX2Zji3I69uQo4=; b=mc95f5iDVxV8J7IcONyEXYsKmbFlSfL0kCD2EcXPcQqe/Qquz/oHovDkblcv6hBLrJ HVDtARXWJ4MEOclL3fixehHm8WgN5jz+cDf1KearVOnDxWc9SRhlRAldQ5kGMsUUMuFF NZ64WtM3lwIuDpXFqSCVWfZCeGWcefEnev53xwr/H3NT6Eu0WHaWdGLiBIxH/v0VeI8R WKghu3JaV70gu61A7B2r0yr0Ad8Y3UVmWJu/HSLyfZdGbjIcbDKXQdZltutcRUBYqvjy koqE78f5r7iZWqd7vRC1LdI60CxyFZZP04HlsJ6uCWkaGtzBYupICXhUs9RRaljvNKc+ tBDA== X-Gm-Message-State: ANhLgQ2AoHXtJ8otZYk7+jx+NjyxXKHJMGmgFEkviyrmccSxniNC4/6I uSjuTNXx4Vgv/FIaiXOqx2LP9Q== X-Received: by 2002:a5d:6082:: with SMTP id w2mr16016232wrt.300.1584084108142; Fri, 13 Mar 2020 00:21:48 -0700 (PDT) Received: from dell ([2.27.167.19]) by smtp.gmail.com with ESMTPSA id x8sm68094533wro.55.2020.03.13.00.21.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2020 00:21:47 -0700 (PDT) Date: Fri, 13 Mar 2020 07:22:30 +0000 From: Lee Jones To: Ran Bi Cc: Hsin-Hsiung Wang , Rob Herring , Alexandre Belloni , Matthias Brugger , Mark Rutland , Sean Wang , Sebastian Reichel , Eddie Huang , Alessandro Zummo , Frank Wunderlich , Thomas Gleixner , Richard Fontana , Josef Friedl , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-rtc@vger.kernel.org, Nicolas Boichat , srv_heupstream@mediatek.com Subject: Re: [PATCH v10 4/5] rtc: mt6397: Add support for the MediaTek MT6358 RTC Message-ID: <20200313072230.GC3142@dell> References: <1583918223-22506-1-git-send-email-hsin-hsiung.wang@mediatek.com> <1583918223-22506-5-git-send-email-hsin-hsiung.wang@mediatek.com> <20200312074407.GA3142@dell> <1584003477.6269.8.camel@mhfsdcap03> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1584003477.6269.8.camel@mhfsdcap03> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 12 Mar 2020, Ran Bi wrote: > On Thu, 2020-03-12 at 07:44 +0000, Lee Jones wrote: > > On Wed, 11 Mar 2020, Hsin-Hsiung Wang wrote: > > > > > From: Ran Bi > > > > > > This add support for the MediaTek MT6358 RTC. Driver using > > > compatible data to store different RTC_WRTGR address offset. > > > This replace RTC_WRTGR to RTC_WRTGR_MT6323 in mt6323-poweroff > > > driver which only needed by armv7 CPU without ATF. > > > > > > Signed-off-by: Ran Bi > > > Signed-off-by: Hsin-Hsiung Wang > > > --- > > > drivers/power/reset/mt6323-poweroff.c | 2 +- > > > drivers/rtc/rtc-mt6397.c | 32 ++++++++++++++++++++++++-------- > > > include/linux/mfd/mt6397/rtc.h | 9 ++++++++- > > > 3 files changed, 33 insertions(+), 10 deletions(-) > > > > > <...> > > > > > > > #define RTC_IRQ_STA 0x0002 > > > #define RTC_IRQ_STA_AL BIT(0) > > > @@ -65,6 +67,10 @@ > > > #define MTK_RTC_POLL_DELAY_US 10 > > > #define MTK_RTC_POLL_TIMEOUT (jiffies_to_usecs(HZ)) > > > > > > +struct mtk_rtc_data { > > > + u32 wrtgr; > > > +}; > > > > Do you expect to add more properties to this struct? > > > > If not, it seems a bit overkill. > > > > Yes, we would add more properties here in future patches. > > > > struct mt6397_rtc { > > > struct device *dev; > > > struct rtc_device *rtc_dev; > > > @@ -74,6 +80,7 @@ struct mt6397_rtc { > > > struct regmap *regmap; > > > int irq; > > > u32 addr_base; > > > + const struct mtk_rtc_data *data; > > > > 'data' is a terrible variable name. > > > > Why do you need to store this? > > > > It's one variable which is used once AFAICT. > > I would rename 'data' to 'config'. > > This struct will be extended in future patches to achieve more PMIC chip > compatibility. On closer inspection, it looks like wrtgr (also not a great name for a variable by the way) is a register address. Is that correct? Initially I thought it was a model number, which would have been a suitable candidate for entry into OF .data. However, describing register addresses in OF .data does not sound like good practice. It is usually used to identify a platform in the cases where platforms cannot be otherwise dynamically interrogated for model number via a register read. Describing register maps via 'config' data is a slippery slope. -- Lee Jones [李琼斯] Linaro Services Technical Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog