Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp2146896ybc; Wed, 20 Nov 2019 09:33:29 -0800 (PST) X-Google-Smtp-Source: APXvYqz/VmBPHtby+y8D9yeP00hO29deKvkqlDZx9TyCzZg2azYJaHI3P4w3MIxU25hU8z/1dEEG X-Received: by 2002:a19:820e:: with SMTP id e14mr3945095lfd.29.1574271208888; Wed, 20 Nov 2019 09:33:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574271208; cv=none; d=google.com; s=arc-20160816; b=F2a0BAfE+pk1yUmrmgeCxxA+v1PWOswgIoFJjry/slMmYSHSN9fFuj749ftn4U+eup mmOm4vMQ6i2m1xinDMmED/nF38u6n37sngXRusGjhmHWEbka7i0Tm2tolun+64Y4WMBN GtEuDlyzGjNgBEtewPs6i3sYFqcMKCavOYejdhk1u7QXM1RznthRG5FcPACVefadhzL8 rGubI3SEiuXkraXhl1wTYK2uGALY+IGxJK+c6o+lSvmXSTinn4idPpRiVzB9B1i/reM+ HGiwM0Wqt/DEXp1qu616Tl0qdq3Nk/XFiVAx2fwGM9+KfBvk4ZDSjR28KOHYJHYv+CPh BDRw== 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:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=42lgNs8Dd+e7oGd0Cqmp5EZx/adTmgAHjJ9HWa12KBs=; b=uGQgiHxN0hWY14sMbxISzufjAoReU9zRVcETOWr9H4CKozJXaFpFKz/HhTDOHM103q YVQDyDKwrSU7j182+lr8zVQuMpItBXXIL2CPmtpLk7HoHnWfHGbGVEOYgiM+fph9hrqm e8LaCGbi2p8mARxeHiJXzGnGwYbaIk9c83lfSp91hzEidyv7G2D+EXfMqKOR+LNaAm+V 9FndjAP37Go2bB2WJsbi5WZxPWO4Fr19UrksS77sr7k8UcU6SwSpyf7lWsxRtQqk3r4T RimRZDHZy0LIxwDdU+Gvf4NgID+g3QNxgG82TKbL13kh7KkrtB7Z6Pd2NZ6+GLxuEtLr WXHA== 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 14si17005377eja.294.2019.11.20.09.33.04; Wed, 20 Nov 2019 09:33:28 -0800 (PST) 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 S1731321AbfKTPxa convert rfc822-to-8bit (ORCPT + 99 others); Wed, 20 Nov 2019 10:53:30 -0500 Received: from mx1.unisoc.com ([222.66.158.135]:32237 "EHLO SHSQR01.spreadtrum.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728453AbfKTPx3 (ORCPT ); Wed, 20 Nov 2019 10:53:29 -0500 Received: from ig2.spreadtrum.com (bjmbx02.spreadtrum.com [10.0.64.8]) by SHSQR01.spreadtrum.com with ESMTPS id xAKFplbr095330 (version=TLSv1 cipher=AES256-SHA bits=256 verify=NO); Wed, 20 Nov 2019 23:51:47 +0800 (CST) (envelope-from Orson.Zhai@unisoc.com) Received: from spreadtrum.com (10.0.74.112) by BJMBX02.spreadtrum.com (10.0.64.8) with Microsoft SMTP Server (TLS) id 15.0.847.32; Wed, 20 Nov 2019 23:51:36 +0800 Date: Wed, 20 Nov 2019 23:49:28 +0800 From: Orson Zhai To: Arnd Bergmann CC: Orson Zhai , Lee Jones , Rob Herring , Mark Rutland , DTML , "linux-kernel@vger.kernel.org" , Subject: Re: [PATCH 1/2] dt-bindings: Add syscon-names support Message-ID: <20191120154928.GC6039@spreadtrum.com> References: <20191114114525.12675-1-orson.zhai@unisoc.com> <20191114114525.12675-2-orson.zhai@unisoc.com> <20191118083952.GB6039@spreadtrum.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.18.0 X-Originating-IP: [10.0.74.112] X-ClientProxiedBy: SHCAS03.spreadtrum.com (10.0.1.207) To BJMBX02.spreadtrum.com (10.0.64.8) Content-Transfer-Encoding: 8BIT X-MAIL: SHSQR01.spreadtrum.com xAKFplbr095330 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Arnd, On Tue, Nov 19, 2019 at 03:46:09PM +0100, Arnd Bergmann wrote: > On Mon, Nov 18, 2019 at 9:42 AM Orson Zhai wrote: > > > > Hi Arnd, > > > > On Fri, Nov 15, 2019 at 10:33:30AM +0100, Arnd Bergmann wrote: > > > On Thu, Nov 14, 2019 at 12:48 PM Orson Zhai wrote: > > > > > > > > > > > > Make life easier when syscon consumer want to access multiple syscon > > > > nodes. > > > > Add syscon-names and relative properties to help manage complicated > > > > cases when accessing more one syscon node. > > > > > > > > Signed-off-by: Orson Zhai > > > > > > Hi Orson, > > > > > > Can you explain why the number of cells in this binding is specific > > > to the syscon node rather than the node referencing it? > > > > The story is like this. I found there are too many global registers in > > Unisoc(former Spreadtrum) chips. Dozens of offset with dozens of modules > > were needed to be specified. So I thought the dts files would seem "horrible" > > with a big chunk of syscon-xxx (say more than 20 lines) > > > > I learned from reg-names way which might look clean to hold all these mess things. > > But to implement this, the users need to konw the cell-size if we add arguments to syscon node. > > I thought to add cell-size into every syscon consumer node is a duplicated work and > > I wanted to take advantage of of_parse_phandle_with_args. > > So the bindings were created then. > > Ok, that makes sense. > > > > The way would otherwise handle the example from your binding > > > would be with two separate properties in the display node, like > > > > > > syscon-enable = <&ap_apb_regs 0x4 0xf00>; > > > syscon-power = <&aon_regs 0x8>; > > > > This is an option for consumers all the time. > > Acturally my patches are not going to replace this. > > I'd like to provide another option to save people like desperate engineers in Spreadtrum :) > > > > > > > > in which case, the syscon driver does not need to know anything > > > > Whould it be better if I add syscon-cells into consumer's node? > > As I see it, there is no reason to put the syscon-cells property into any node, > as this is implied by the driver binding using the syscon reference. I would > only use the #xyz-cells style property if there are multiple interpretations > that all make sense for the same binding. > > > Then I could read the cell size and use "of_parse_phandle_with_fixed_args()" instead. > > This will not involve syscon node itself at all. > > This sounds better to me, yes. I had not even remembered this function > exists, but I think this is a good idea. > > I can also see a point in favor of adding more infrastructure around this, > possibly naming the entries in a syscon-names property as you suggested, > combining of_parse_phandle_with_fixed_args() with a name, or > combining with syscon_regmap_lookup_by_phandle() for convenience. > > This should all be possible without adding complexity to the syscon > DT binding itself, and it would give more structure to the way it > is used by drivers. V2 has been sent out per as you suggested. Free free to review please. Best Regards, -Orson > > Arnd ________________________________ This email (including its attachments) is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. Unauthorized use, dissemination, distribution or copying of this email or the information herein or taking any action in reliance on the contents of this email or the information herein, by anyone other than the intended recipient, or an employee or agent responsible for delivering the message to the intended recipient, is strictly prohibited. If you are not the intended recipient, please do not read, copy, use or disclose any part of this e-mail to others. Please notify the sender immediately and permanently delete this e-mail and any attachments if you received it in error. Internet communications cannot be guaranteed to be timely, secure, error-free or virus-free. The sender does not accept liability for any errors or omissions. 本邮件及其附件具有保密性质,受法律保护不得泄露,仅发送给本邮件所指特定收件人。严禁非经授权使用、宣传、发布或复制本邮件或其内容。若非该特定收件人,请勿阅读、复制、 使用或披露本邮件的任何内容。若误收本邮件,请从系统中永久性删除本邮件及所有附件,并以回复邮件的方式即刻告知发件人。无法保证互联网通信及时、安全、无误或防毒。发件人对任何错漏均不承担责任。