linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Andersson <andersson@kernel.org>
To: Richard Acayan <mailingradian@gmail.com>
Cc: linux-arm-msm@vger.kernel.org, Andy Gross <agross@kernel.org>,
	Konrad Dybcio <konrad.dybcio@somainline.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Lee Jones <lee@kernel.org>,
	linux-gpio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	~postmarketos/upstreaming@lists.sr.ht
Subject: Re: [PATCH v8 2/3] pinctrl: qcom: do not reinitialize gpio valid mask
Date: Thu, 6 Oct 2022 21:24:06 -0500	[thread overview]
Message-ID: <20221007022406.kggtrbh52iamn2dv@builder.lan> (raw)
In-Reply-To: <20221006232219.37505-3-mailingradian@gmail.com>

On Thu, Oct 06, 2022 at 07:22:18PM -0400, Richard Acayan wrote:
> It may be necessary for some devices to specify reserved gpios in the
> device-specific DTS, in addition to the reserved gpios common to all
> devices with a given SoC. Remove this bitmap_fill() call so that the
> settings applied to the gpio valid mask by DTS are not overridden by
> the driver's reserved gpios.
> 
> Signed-off-by: Richard Acayan <mailingradian@gmail.com>
> ---
>  drivers/pinctrl/qcom/pinctrl-msm.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/pinctrl/qcom/pinctrl-msm.c b/drivers/pinctrl/qcom/pinctrl-msm.c
> index a2abfe987ab1..f697e9f64360 100644
> --- a/drivers/pinctrl/qcom/pinctrl-msm.c
> +++ b/drivers/pinctrl/qcom/pinctrl-msm.c
> @@ -687,9 +687,8 @@ static int msm_gpio_init_valid_mask(struct gpio_chip *gc,
>  	const int *reserved = pctrl->soc->reserved_gpios;
>  	u16 *tmp;
>  
> -	/* Driver provided reserved list overrides DT and ACPI */
> +	/* Driver provided reserved list overrides other settings here */

IMHO this no longer overrides things, how about changing it to:

	/* Remove driver-provided reserved GPIOs from valid_mask */


The rest of the change looks good and the commit message looks good. So
please consider updating the comment and feel free to add my

Reviewed-by: Bjorn Andersson <andersson@kernel.org>

Regards,
Bjorn

>  	if (reserved) {
> -		bitmap_fill(valid_mask, ngpios);
>  		for (i = 0; reserved[i] >= 0; i++) {
>  			if (i >= ngpios || reserved[i] >= ngpios) {
>  				dev_err(pctrl->dev, "invalid list of reserved GPIOs\n");
> -- 
> 2.38.0
> 

  reply	other threads:[~2022-10-07  2:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-06 23:22 [PATCH v8 0/3] SDM670 Pin Control Driver Richard Acayan
2022-10-06 23:22 ` [PATCH v8 1/3] dt-bindings: pinctrl: qcom: add sdm670 pinctrl Richard Acayan
2022-10-07  7:09   ` Krzysztof Kozlowski
2022-10-06 23:22 ` [PATCH v8 2/3] pinctrl: qcom: do not reinitialize gpio valid mask Richard Acayan
2022-10-07  2:24   ` Bjorn Andersson [this message]
2022-10-07 21:04     ` Richard Acayan
2022-10-06 23:22 ` [PATCH v8 3/3] pinctrl: qcom: add sdm670 pinctrl Richard Acayan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221007022406.kggtrbh52iamn2dv@builder.lan \
    --to=andersson@kernel.org \
    --cc=agross@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=konrad.dybcio@somainline.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=lee@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mailingradian@gmail.com \
    --cc=robh+dt@kernel.org \
    --cc=~postmarketos/upstreaming@lists.sr.ht \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).