Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp3349244ybc; Thu, 21 Nov 2019 07:06:37 -0800 (PST) X-Google-Smtp-Source: APXvYqxmAOmwdHUswCDLYG2nd2+qngMzAMv+RYqvmV/7eC8/bCpukm/6env78CEKSL43QJ8M/k9S X-Received: by 2002:a05:600c:2105:: with SMTP id u5mr10253037wml.47.1574348797614; Thu, 21 Nov 2019 07:06:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574348797; cv=none; d=google.com; s=arc-20160816; b=nYqmqhMy4EFVeD/+gP/rQyi3BlqnZR1sRqq6/MM59xaQAbjSiJYKpezG6r+VB6qpr5 sLNB/ciyRm9wGl5nPr6yJB4G2QFINU9TVDR6qNhvMEJDZbfiMZ58s5vnOovgE70Ta+DU 4IIFSh83L+LNqYt33Bt8t/THxwnSeIdmo2sVxR7yX+4EbpgQzAI0EgwAut/PTAG8XY2i SCaDyJG7N/W5ibp1xAPr6RxXlWhxQ9YSSWMXFAOKavxa20YRDJk92fFZbR1TOlwbdByc XrLSFi9lKttMZloC00WWvY+g/CxxpDbYCCaxxs3OTIT91kg51YxD8yGM+zhbiK0FXIye HKbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=421RssEL8OD7lusc/6/u/H3C4eKX8Trq/adiBGtIiaE=; b=CfZF1yINrwRHd4V8MF18rqqmS4I6Ag4xbKJp2Bj0eKfxVHtpLzFAUGWuG6exc/3Alg lvDzVT52s+WgQJ7guMxAUsnunqHq+SkWlaY1zd9TsvQkUinPkKNUPXknCHM4XGZLGRvp RSb/2gZ49PkIZ5g8Fm+t/q28Ey3BwVJnxiVO8z1c//Cs7jeTb7Co4l+xFFnG0g/L4Zpx HSywCMXqhLR7HcPB4OJ/OX7abXsHiE2L/78AW/K8e7XDVLtdJXFukz9JcqYsx/NRspWU nHKY80DZQZZzYuw//2UIJaHFVtHtlk3T7HLcYyyX4wrofMKPlvq7ORhciNh9ry0VESKL 3Wgg== 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 g40si2436261edb.369.2019.11.21.07.06.12; Thu, 21 Nov 2019 07:06:37 -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 S1727080AbfKUPE3 (ORCPT + 99 others); Thu, 21 Nov 2019 10:04:29 -0500 Received: from mout.kundenserver.de ([212.227.17.10]:51765 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726358AbfKUPE2 (ORCPT ); Thu, 21 Nov 2019 10:04:28 -0500 Received: from mail-qk1-f172.google.com ([209.85.222.172]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.145]) with ESMTPSA (Nemesis) id 1Mj831-1htG3T0SLF-00fDgi; Thu, 21 Nov 2019 16:04:26 +0100 Received: by mail-qk1-f172.google.com with SMTP id d13so3315183qko.3; Thu, 21 Nov 2019 07:04:25 -0800 (PST) X-Gm-Message-State: APjAAAUlPN1Lq6sxvsjQfmesJDrJ6lW5aQoDVDHxXM8nXrBwac7SzXeP M5F83oBREua77wyFEJHjFV+VKDQ2oCsbexNo6vc= X-Received: by 2002:a37:58d:: with SMTP id 135mr8315195qkf.394.1574348664813; Thu, 21 Nov 2019 07:04:24 -0800 (PST) MIME-Version: 1.0 References: <20191120154148.22067-1-orson.zhai@unisoc.com> <20191120154148.22067-3-orson.zhai@unisoc.com> In-Reply-To: <20191120154148.22067-3-orson.zhai@unisoc.com> From: Arnd Bergmann Date: Thu, 21 Nov 2019 16:04:08 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH V2 2/2] mfd: syscon: Find syscon by names with arguments support To: Orson Zhai Cc: Lee Jones , Rob Herring , Mark Rutland , DTML , "linux-kernel@vger.kernel.org" , kevin.tang@unisoc.com, baolin.wang@unisoc.com, Chunyan Zhang Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K1:i7Fi3jqb2oWyL7zm58QewHygSnGhbG/TkqObcIm8ys8w/XUj1e6 k2A89BmcSlkolo+eiTl7TwnyM6wNC6tTul9r2b0pkzI2BoWpq1K5xnYaifcTcg3EpOOSwFg UYOgbT0E3uKw4j4AdEJNmM+PJziGmMLe0a8jZZH+qxKyHzkWuuGjZpy7XcqVxr8+LavEdJv lJVZ+9GlhvKMmTseAhEYg== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:7r2uaGhLX64=:HiwjsKZV/xP1P/3hzz3JgO LHGXHQAj3b0pOn5eJdGIR1gBzFP7iviCRoxLZhnBGhgxxpddRYqd5xuhyreUweRIBvcEiu1zd TeaHEQINoAEmBKAGTcFUDbqC+0wzhOR8ICCOgLkUnc4EfkqR2o5dylXoMGQK1WNlzEQI2gy5P UQA3WWBNtLkEM7UIzFdaRYlIb/wAcvXyMVCNvKd6gOBd+tnybxT7/B707/unlfffWH+AAoCuD zsiZZa1/+E1bhS2DWh+q6MuBKbr6CCabUM7jTIrUqFclgeWZZ4ZrknMyTYDs5Q/fB9YjmV8CF OPmgA8TiK6MxVx+86qjUajLGnEX9YIHQHWuFJt5OaMb2/jr+yhyo+q0t0a2LJ87TXgc2gsjf2 7pyeVd9bhzrTrtPs8TXB8HKnY+QmL30DkG8Xyutwz0hrqMvP33vajZuSNW8PO3pn+gBb8mFlD MwpH1VeiKDY8imHYQ0RQNJaH0XOfJcVWW3+J8pfww6gLfgIxPbPCWcF/XmqK10uRnEoy8ajRW UhVLZThf5m9lJDEHiY5JGf1EikAT8X/7DLdQZPyT4IssmsS0wUXZI1LnWYt+AGs9Nfz6+653K yhLm3UssnK1pEx4z3xxD/wbcOu4+JYtOOR5lvmavSvVLz6Fkco6OPeFoi3FefVUctw+ZBerb8 bLva1+3TGVhQ7wjC9yxQPcT/Y7KR1YVL2uPYdkbK7iN0s4mgHwkhIcThKEubvxe/E3y2j4AKn FBtG2gflWJemHLOz8skEHQVf8QmtIQepMtafHL+uqqhkJ7/6L/cCPSlk+1X+UjJ3oJ17v3KjE yI/CUpCQwc0PQK9k6FWmCLQD3IkKZ4tuU7ynZRQm06d8Bx67M3DTJRMeeoEIJXMxhKFcINTDf 53l2NFCzvL/dZcXJFtMQ== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 20, 2019 at 4:44 PM Orson Zhai wrote: > > There are a lot of global registers used across multiple similar SoCs > from Unisoc. It is not easy to manage all of them very well by current > syscon helper functions. > > Add helper functions to get regmap and arguments by syscon-names all > together. > > This patch does not affect original syscon code and usage. It may help > other SoC vendors if they have the same trouble as well. > > Signed-off-by: Orson Zhai > --- > drivers/mfd/syscon.c | 75 ++++++++++++++++++++++++++++++++++++++ > include/linux/mfd/syscon.h | 26 +++++++++++++ > 2 files changed, 101 insertions(+) > > diff --git a/drivers/mfd/syscon.c b/drivers/mfd/syscon.c > index 660723276481..e818decc7bf2 100644 > --- a/drivers/mfd/syscon.c > +++ b/drivers/mfd/syscon.c > @@ -225,6 +225,81 @@ struct regmap *syscon_regmap_lookup_by_phandle(struct device_node *np, > } > EXPORT_SYMBOL_GPL(syscon_regmap_lookup_by_phandle); > > +struct regmap *syscon_regmap_lookup_by_name(struct device_node *np, > + const char *list_name, > + const char *cell_name) > +{ According to the binding change I suggested, this would not take a 'cell_name' argument, but instead a an arg_count. > + > +int syscon_get_args_by_name(struct device_node *np, > + const char *list_name, > + const char *cell_name, > + int arg_count, > + unsigned int *out_args) > +{ and I think this could be combined with it, like struct regmap *syscon_regmap_lookup_by_name(struct device_node *np, const char *name, int arg_count, __u32 *out_args) Arnd