Linux-OMAP Archive on lore.kernel.org
 help / color / Atom feed
From: Trent Piepho <tpiepho@gmail.com>
To: linux-arm-kernel@lists.infradead.org
Cc: Drew Fustini <drew@beagleboard.org>,
	Tony Lindgren <tony@atomide.com>,
	Rob Herring <robh+dt@kernel.org>,
	linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-gpio@vger.kernel.org,
	Linus Walleij <linus.walleij@linaro.org>,
	Haojian Zhuang <haojian.zhuang@linaro.org>,
	devicetree@vger.kernel.org, bcousson@baylibre.com,
	Jason Kridner <jkridner@beagleboard.org>,
	Robert Nelson <robertcnelson@gmail.com>
Subject: Re: [PATCH v4 1/2] pinctrl: single: parse #pinctrl-cells = 2
Date: Tue, 08 Sep 2020 16:52:58 -0700
Message-ID: <3139716.CMS8C0sQ7x@zen.local> (raw)
In-Reply-To: <20200701013320.130441-2-drew@beagleboard.org>

On Tuesday, June 30, 2020 6:33:19 PM PDT Drew Fustini wrote:
> If "pinctrl-single,pins" has 3 arguments (offset, conf, mux), then
> pcs_parse_one_pinctrl_entry() does an OR operation on conf and mux to
> get the value to store in the register.


> -		vals[found].val = pinctrl_spec.args[1];
> +
> +		switch (pinctrl_spec.args_count) {
> +		case 2:
> +			vals[found].val = pinctrl_spec.args[1];
> +			break;
> +		case 3:
> +			vals[found].val = (pinctrl_spec.args[1] | 
pinctrl_spec.args[2]);
> +			break;
> +		}
> 
>  		dev_dbg(pcs->dev, "%pOFn index: 0x%x value: 0x%x\n",
>  			pinctrl_spec.np, offset, 
pinctrl_spec.args[1]);

If #pinctrl-cells value is greater than 2, nothing will set vals[found].val to 
anything other than zero (from when it's calloc'ed) and the pinctrl will 
silently be programmed to zero.

The debug printout was not change to print vals[found].val, so it will 
continue to print the value of the 2nd cell.

The result is that a #pinctrl-cells of 3 will produce no warning or error, 
program the pinctrl to zero, whilst at the same time emit debug log messages 
that it is programming the expected values.

The device tree documentation still states that #pinctrl-cells must be 1 when 
using pinctrl-single,pins.  This new special case of ORing two values is not 
documented.




  reply index

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-01  1:33 [PATCH v4 0/2] pinctrl: single: support " Drew Fustini
2020-07-01  1:33 ` [PATCH v4 1/2] pinctrl: single: parse " Drew Fustini
2020-09-08 23:52   ` Trent Piepho [this message]
2020-09-13 19:42     ` Drew Fustini
2020-09-13 23:27       ` Drew Fustini
2020-07-01  1:33 ` [PATCH v4 2/2] ARM: dts: am33xx-l4: change #pinctrl-cells from 1 to 2 Drew Fustini
2020-09-09  0:34   ` Trent Piepho
2020-07-02 17:36 ` [PATCH v4 0/2] pinctrl: single: support #pinctrl-cells = 2 Tony Lindgren
2020-07-05  9:01 ` Haojian Zhuang
2020-07-07 10:59 ` Linus Walleij
2020-07-07 11:02   ` Drew Fustini
2020-07-11 21:12     ` Linus Walleij

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=3139716.CMS8C0sQ7x@zen.local \
    --to=tpiepho@gmail.com \
    --cc=bcousson@baylibre.com \
    --cc=devicetree@vger.kernel.org \
    --cc=drew@beagleboard.org \
    --cc=haojian.zhuang@linaro.org \
    --cc=jkridner@beagleboard.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=robertcnelson@gmail.com \
    --cc=robh+dt@kernel.org \
    --cc=tony@atomide.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

Linux-OMAP Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-omap/0 linux-omap/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-omap linux-omap/ https://lore.kernel.org/linux-omap \
		linux-omap@vger.kernel.org
	public-inbox-index linux-omap

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-omap


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git