Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp9042526ybl; Fri, 17 Jan 2020 05:29:02 -0800 (PST) X-Google-Smtp-Source: APXvYqzyiu6ZdHc/UVVaH6N41yubplQvztmbrcYq3KwYWzucEl8ORBQt0QwI/2cLtIHlknQy4h1u X-Received: by 2002:a9d:7305:: with SMTP id e5mr5892740otk.64.1579267742809; Fri, 17 Jan 2020 05:29:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579267742; cv=none; d=google.com; s=arc-20160816; b=JrjjWmoNLFukBcJsZCVCmtJ3si9ZlbvKLDzgLBE8ipDvRjeG5xT7FyJCGeJN9xa+V4 gBUdmTAhEzBTGoE+K6gFcyoQFCrhYTHnS2vuExm2w3dDU1ph60F+RwzZCyY+NeVF4zDA RodyJ8qdrSts+NkWGQd7NHQNyHT5dr5d70aJE0zvYIxH5HBwRXe3XZZWg36mIoGuHGxq 2Y+vbnHf3IChMlIWZ934+U6BihJazlndy3gZRgMQsLjoT1ZuW7Q+OPVvdzwPiKRihlVw KVoc6rgSTbJcvXEvukGTW1kEe95VdTkoW7ktiXfkX5AFpNvg87nQpR0woNIcXBoFd2F3 7LmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=PIqkqiKX2cwutNpB3IcDLeAmmYCpWIuuH/Xtq02/cXc=; b=qa3hXJDgZi0T6/oPhdu+cqgs32GQsh2m7/ozKz8Cbbzw08qq+c0QKSb43i+t8skvEq Xl15yRosxJTKpQoSFRFi8iVfteOQoZqLKoQDJVZUf+oQyFKxkpJhiEaBzhaFkMCmIO5Q ekgs8a/EuC74Qss7Jt34pE815dc2UGA6Dpt2pcrQ35d/sYAgJ6I+64e7hurVS/bLtrjy JYCxyKGIT/gclUE2s5OLaaVpsmDT0YKv88hHhTO9G0nrvdbtUN8t7HeoT/HcPQi6LMrq YFOrPnVefsSKO5C9oGYbihKOCVbByNxW3/MWj7/FtVTbEAF4ICXXFG1ROIsTJ3ij+oKD ECnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rR1Q3rqr; 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 w26si13871639otl.213.2020.01.17.05.28.50; Fri, 17 Jan 2020 05:29:02 -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=@linaro.org header.s=google header.b=rR1Q3rqr; 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 S1726896AbgAQN1w (ORCPT + 99 others); Fri, 17 Jan 2020 08:27:52 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:40650 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726329AbgAQN1w (ORCPT ); Fri, 17 Jan 2020 08:27:52 -0500 Received: by mail-wm1-f66.google.com with SMTP id t14so7597386wmi.5 for ; Fri, 17 Jan 2020 05:27:50 -0800 (PST) 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 :user-agent; bh=PIqkqiKX2cwutNpB3IcDLeAmmYCpWIuuH/Xtq02/cXc=; b=rR1Q3rqrJ4cKKTCGDv/Z5+Fo1P+ZQtT/d7HqveOFr2Au2QjnsmLyAcKww57wxeyek7 IDhvOR1mjP1PmvxC24D1g98xZRBLBIs2S3sytFPHpb/HB31VXeCbATmp0zVZcs6pCuMz DogN4CFJDVX7+OBllKBz9dv2Nf2d0sjjzfmE74lsXPoLmjab8IYGS5wMq2QujmY5QZvX EJod2nowDsluwI78/vmERLmUYCdLQoGGQgIHLOGVsiPdOy/HIGkUNZt4Gv+1ntsjDuny M6klJkdgaegyCE96+DWOZI/8TIISXYlYWTYpr0RIDgP8llz6OVRGGke85ZJJUNJWoD3P mdyg== 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:user-agent; bh=PIqkqiKX2cwutNpB3IcDLeAmmYCpWIuuH/Xtq02/cXc=; b=q8V8OtjowjEMAHa25sx+kzPXmAlv4Jcar94ked2wn2fJ5Lm3SgGMLoBO14pZMlUj6/ cj+kyHi3g4mpJyXRqlDbLj7ZwSbKrbpfibViuY2aC6rGvejykB3GTJTRH2bY41oHYmxU 9zDbpht5YCMZXWo5nDpwnTRW1zAfwvvd5p/OTpgxvH74QvPM2jsoh68kyXYhQTFpHbTH HadGlIJCHEpEY4rGUqQvk3dSeq6BTGHjKmr2zZQjvkceI1gD+SnDvBu1zD6KQbWYTMcl NGChYzUez9/jKOBqWjohAAvY1auzWvocUbsCnWvRQaPEQMPF+zFG4qrQl2wh1bFmVeX+ +KVw== X-Gm-Message-State: APjAAAUmWYpgMtp++xSoo5l5SRW2HfA0knVG8WIIQgB/vmnL36JEsYpm 5CUmS3H7nFJ6HxZwqQSwMOT01PiESgU= X-Received: by 2002:a1c:4884:: with SMTP id v126mr4360261wma.64.1579267669959; Fri, 17 Jan 2020 05:27:49 -0800 (PST) Received: from dell ([2.27.35.221]) by smtp.gmail.com with ESMTPSA id s128sm9847090wme.39.2020.01.17.05.27.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2020 05:27:49 -0800 (PST) Date: Fri, 17 Jan 2020 13:28:07 +0000 From: Lee Jones To: Orson Zhai Cc: Arnd Bergmann , linux-kernel@vger.kernel.org, baolin.wang@unisoc.com, chunyan.zhang@unisoc.com Subject: Re: [PATCH v3] mfd: syscon: Add arguments support for syscon reference Message-ID: <20200117132807.GL15507@dell> References: <1579259812-27186-1-git-send-email-orson.zhai@unisoc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1579259812-27186-1-git-send-email-orson.zhai@unisoc.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 17 Jan 2020, Orson Zhai wrote: > There are a lot of similar global registers being used across multiple SoCs > from Unisoc. But most of these registers are assigned with different offset > for different SoCs. It is hard to handle all of them in an all-in-one > kernel image. > > Add a helper function to get regmap with arguments where we could put some > extra information such as the offset value. > > Signed-off-by: Orson Zhai > Tested-by: Baolin Wang > Reviewed-by: Arnd Bergmann > Acked-by: Lee Jones > --- > > V3 Change: > Rebase on latest kernel v5.5-rc6 for Lee. Still not applying. I think it's a problem with the patch itself. It looks like all of the tabs have been replaced with spaces also. How are you sending the patch? Arnd, Are you able to apply this? > drivers/mfd/syscon.c | 29 +++++++++++++++++++++++++++++ > include/linux/mfd/syscon.h | 14 ++++++++++++++ > 2 files changed, 43 insertions(+) > > diff --git a/drivers/mfd/syscon.c b/drivers/mfd/syscon.c > index e22197c..2918b05 100644 > --- a/drivers/mfd/syscon.c > +++ b/drivers/mfd/syscon.c > @@ -224,6 +224,35 @@ 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_phandle_args(struct device_node *np, > + const char *property, > + int arg_count, > + unsigned int *out_args) > +{ > + struct device_node *syscon_np; > + struct of_phandle_args args; > + struct regmap *regmap; > + unsigned int index; > + int rc; > + > + rc = of_parse_phandle_with_fixed_args(np, property, arg_count, > + 0, &args); > + if (rc) > + return ERR_PTR(rc); > + > + syscon_np = args.np; > + if (!syscon_np) > + return ERR_PTR(-ENODEV); > + > + regmap = syscon_node_to_regmap(syscon_np); > + for (index = 0; index < arg_count; index++) > + out_args[index] = args.args[index]; > + of_node_put(syscon_np); > + > + return regmap; > +} > +EXPORT_SYMBOL_GPL(syscon_regmap_lookup_by_phandle_args); > + > static int syscon_probe(struct platform_device *pdev) > { > struct device *dev = &pdev->dev; > diff --git a/include/linux/mfd/syscon.h b/include/linux/mfd/syscon.h > index 112dc66..714cab1 100644 > --- a/include/linux/mfd/syscon.h > +++ b/include/linux/mfd/syscon.h > @@ -23,6 +23,11 @@ extern struct regmap *syscon_regmap_lookup_by_compatible(const char *s); > extern struct regmap *syscon_regmap_lookup_by_phandle( > struct device_node *np, > const char *property); > +extern struct regmap *syscon_regmap_lookup_by_phandle_args( > + struct device_node *np, > + const char *property, > + int arg_count, > + unsigned int *out_args); > #else > static inline struct regmap *device_node_to_regmap(struct device_node *np) > { > @@ -45,6 +50,15 @@ static inline struct regmap *syscon_regmap_lookup_by_phandle( > { > return ERR_PTR(-ENOTSUPP); > } > + > +static struct regmap *syscon_regmap_lookup_by_phandle_args( > + struct device_node *np, > + const char *property, > + int arg_count, > + unsigned int *out_args) > +{ > + return ERR_PTR(-ENOTSUPP); > +} > #endif > > #endif /* __LINUX_MFD_SYSCON_H__ */ -- Lee Jones [李琼斯] Linaro Services Technical Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog