All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: Drew Fustini <drew@beagleboard.org>
Cc: Haojian Zhuang <haojian.zhuang@linaro.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	linux-omap@vger.kernel.org,
	Jason Kridner <jkridner@beagleboard.org>,
	Robert Nelson <robertcnelson@gmail.com>
Subject: Re: [RFC PATCH] pinctrl-single: parse #pinctrl-cells = 2
Date: Tue, 16 Jun 2020 07:26:28 -0700	[thread overview]
Message-ID: <20200616142628.GX37466@atomide.com> (raw)
In-Reply-To: <20200615230906.GA3967771@x1>

* Drew Fustini <drew@beagleboard.org> [200615 23:10]:
> These changes are based on feedback from Tony [1] concerning changing
> pinctrl-single to be able to handle pinctrl-cells = 2 for for the 
> "pinctrl-single,pins" property.

Hey this is great! Thanks for sorting it out.

> --- a/drivers/pinctrl/pinctrl-single.c
> +++ b/drivers/pinctrl/pinctrl-single.c
> @@ -1017,11 +1017,21 @@ static int pcs_parse_one_pinctrl_entry(struct pcs_device *pcs,
>  			break;
>  		}
>  
> -		/* Index plus one value cell */
>  		offset = pinctrl_spec.args[0];
>  		vals[found].reg = pcs->base + offset;
> -		vals[found].val = pinctrl_spec.args[1];
>  
> +		pr_info("%s: args_count=%d offset=0x%x", __func__,
> +				pinctrl_spec.args_count, offset);
> +		pr_info("%s: args[1]=0x%x", __func__, pinctrl_spec.args[1]);
> +
> +		if (pinctrl_spec.args_count == 2) {
> +			vals[found].val = pinctrl_spec.args[1];
> +		} else if (pinctrl_spec.args_count == 3) {
> +			pr_info("%s: args[2]=0x%x", __func__, pinctrl_spec.args[2]);
> +			vals[found].val = (pinctrl_spec.args[1] | pinctrl_spec.args[2]);
> +		}

Maybe do the above with a switch? And leave out the pr_info for the
final version :) Also please do a separate patch for pinctrl-singl.c,
and then another patch for the define and dts change.

Hmm so now the conf and mux values are still register masks in the dts
which is not ideal in all cases. But that's a separate issue and could
be sorted out as needed later on with adding separate conf and mux
shifts and masks. Not sure if we want to do that for the existing use
cases though.

Regards,

Tony

  reply	other threads:[~2020-06-16 14:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-15 23:09 [RFC PATCH] pinctrl-single: parse #pinctrl-cells = 2 Drew Fustini
2020-06-16 14:26 ` Tony Lindgren [this message]
2020-06-16 16:53   ` Drew Fustini
2020-06-17 16:54     ` Tony Lindgren

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=20200616142628.GX37466@atomide.com \
    --to=tony@atomide.com \
    --cc=drew@beagleboard.org \
    --cc=haojian.zhuang@linaro.org \
    --cc=jkridner@beagleboard.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=robertcnelson@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.