Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp494085ybc; Fri, 22 Nov 2019 08:23:41 -0800 (PST) X-Google-Smtp-Source: APXvYqxQrv8Q3Y2TCPnI2SpR7PDvyCNoaZYvrsmMIMd0aTddxYgt851A/HqQFw3AvNFU1v2feaiS X-Received: by 2002:a17:906:c296:: with SMTP id r22mr6451801ejz.156.1574439821213; Fri, 22 Nov 2019 08:23:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574439821; cv=none; d=google.com; s=arc-20160816; b=Y0IFuroQywBh+qjbnaGFy6EJmsp+jxgIj2DyVVVWjY67WUbKs0ZGq4614HREVA+kV+ nAQlWRlhe0hULtozaJsdbpelVFcNumFvhDMnfgi8oijw57z8ZbplTS8BVbYSAefBgx4v wPW6c0GIRs7WceXTuIpaxq5+X8wh4ue62vZC9nY2Lr4HsBCHclvYqWaFcvXGZCBvwRlm +ghNvepbMgIuMjAkXpBCXExkRULjsopsMPDOjzHWID0mIJJdMpYkHbV6AYv8x+1pJJdm goNpMYSDj308ZCUqc1qhaOpL6xzFQ+4d4EYPhxlp39PCbpJd0pPTRF4hdE9vAvxbCCVN HSng== 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:dkim-signature; bh=ykwPMbHIRKgLrVpSpWF8yIw4jd/QEDDbiLYlnpgiqSI=; b=ihfGS53c7hakandyCq8cOwEQ9fq0UxITH/m9y2X8zW92lt+L2pw2bhcikNIwAixaI5 kKARALq5l4fJmJ5kHS5Cce32HxvxohnJDqvwAMKxTTaNFPbyTWm7i3isDgvB9imIhoeB bvsbxf65lfzgI2wvmIlBBmcXoKPoTeeU7JXjqTxWNc/Dv5MOPqfanO95QTpOsWm0I9nx 4q/vyrZKibamx4CiswhSA1QQP6yJeAEPVmwAg+e1kz4onUNN2HoPqsNBTi6oRSSIC7VP QPx9nACgkSOubKTL58gi+KtBufWL7A6rKLaSBMvztD5zX4mGjWVvRrOZQLtgVa0A0oaw 1W/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=aYyWEbnD; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t18si4323797eji.130.2019.11.22.08.23.15; Fri, 22 Nov 2019 08:23:41 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=aYyWEbnD; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727437AbfKVQWK (ORCPT + 99 others); Fri, 22 Nov 2019 11:22:10 -0500 Received: from mail-lj1-f194.google.com ([209.85.208.194]:41856 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726046AbfKVQWK (ORCPT ); Fri, 22 Nov 2019 11:22:10 -0500 Received: by mail-lj1-f194.google.com with SMTP id m4so8019301ljj.8; Fri, 22 Nov 2019 08:22:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ykwPMbHIRKgLrVpSpWF8yIw4jd/QEDDbiLYlnpgiqSI=; b=aYyWEbnDZW6Y3pbQjaivmMd8tp9cF7ULcfzumRtyQReRZXek4w0sbzD4eUBdg0JE3b sUVwwSqB/FOV7j7TQ7Tkww7sjnIRZTTUh6vVPHkg3cKfTA3o9EhkxYJQub+Tla0Tx/6G UI2nzfTzxrKMd+8KSEyORBtenIqbFwcSU0pDEhNjB8UwxuKBnyvLkQd2/OLnGk7o4Vgp 5GRNg7DttdKOkEBDVhLDKN6SJ6Ap3Pd6M2hBo7WnaSPy6L1Dhwk84+1/LJcvHx96+KA9 ze+6MMe4hgXwpKpGv7Z+4GBNvST7X36o7+HtxNaC3fuA3oo9aC0rY4/KwmAtmRmtvegK Yx6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ykwPMbHIRKgLrVpSpWF8yIw4jd/QEDDbiLYlnpgiqSI=; b=bWqfdtpuXtXU8MJxj8TUhkzQeBQZC9OOiOJCPeZwvZd5JGDAC+wY2f42WrTcJfQ9T2 bxou6DpD2CRTLrynuV3gJvQCqMRbicQCTDwj7sfSQkGaDntNYzznfYuujfeMFP/NPehT i6T+okhO4pq8cs9k7OkOdXIo4if6hZrpPfy1slM0AxTBkx9KjpYRLGwZIDTWYRrlZtjS uFS9E6204J71AwkwsHiSzjnEuFOYCQUjefgUxZCc3LXrVyj2qndCmSf1EshQ+O8Ze3VF rWwz+y+TEvf8Ne3iTwBs1EPAxJtGNwV0EU11Xk11TCk01Pfw2Jsu9J4z3RNGfUJgBhVp fRSw== X-Gm-Message-State: APjAAAXIFrFFsRIe+KKw8EBhwniDAGIdGrh8z0Crqlc08xyZRXcdC7i2 lIQyYTSq33xyI8bYKjmGzYWwqwJOAHIfwH1VPBA= X-Received: by 2002:a2e:9016:: with SMTP id h22mr12761538ljg.137.1574439727760; Fri, 22 Nov 2019 08:22:07 -0800 (PST) MIME-Version: 1.0 References: <20191120154148.22067-1-orson.zhai@unisoc.com> <20191120154148.22067-3-orson.zhai@unisoc.com> In-Reply-To: From: Orson Zhai Date: Sat, 23 Nov 2019 00:21:55 +0800 Message-ID: Subject: Re: [PATCH V2 2/2] mfd: syscon: Find syscon by names with arguments support To: Arnd Bergmann Cc: Orson Zhai , Lee Jones , Rob Herring , Mark Rutland , DTML , "linux-kernel@vger.kernel.org" , Kevin Tang , baolin.wang@unisoc.com, Chunyan Zhang Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 21, 2019 at 11:06 PM Arnd Bergmann wrote: > > 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. Got it. This is much convenient for caller. > > > + > > +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) Ok, I'll send V3 next week. Best, -Orson > > Arnd