All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: Nikita Yushchenko <nikita.yoush@cogentembedded.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	Andrey Smirnov <andrew.smirnov@gmail.com>,
	Chris Healy <Chris.Healy@zii.aero>,
	Jeff White <Jeff.White@zii.aero>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Geert Uytterhoeven <geert+renesas@glider.be>
Subject: Re: pinctrl-sx150x.c broken in 4.11
Date: Thu, 11 May 2017 09:36:15 -0700	[thread overview]
Message-ID: <20170511163615.GU3489@atomide.com> (raw)
In-Reply-To: <252b379a-d3fe-8020-5209-f1de43004b08@cogentembedded.com>

* Nikita Yushchenko <nikita.yoush@cogentembedded.com> [170511 09:27]:
> > Hmm maybe yeah. I don't quite follow the above the "pinctrl-0 property
> > of sx150x device tree node, is misinterpreted as hog" part though.
> 
> sx150x is i2c-gpio device.  It has 16 GPIO lines that are communicated
> with via i2c bus, and an interrupt line.
> 
> Interrupt line is typically connected to SoC's pin.
> This pin has to be configured.
> This is done by providing appropriate subnode in SoC's pinmux node, with
> information with pin configuration, and pinctrl-0 property in sx150x's
> node with phandle to that subnode:
> 
> ...
> &i2c0 {
> 	sx1503@20 {
> 		compatible = "semtech,sx1503q";
> 		pinctrl-names = "default";
> 		pinctrl-0 = <&pinctrl_sx1503_20>;
> 		...
> 	};
> };
> ...
> &iomuxc {
> 	pinctrl_sx1503_20: pinctrl-sx1503-20 {
> 		fsl,pins = <
> 			VF610_PAD_PTB1__GPIO_23         0x219d
> 		>;
> 	};
> };
> 
> This pin configuration is handled by driver core, i.e. before probe()
> for sx150x is called, core applies pin configuration.
> 
> However sx150x driver is currently implemented as a pinctrl driver.
> 
> When it initializes, pinctrl searches for "hog", i.e. pin config that
> should be applied at driver registration time.
> 
> While doing so, core searches for any registered pinctrl_map for device
> being register. Search loop is in create_pinctrl().
> 
> In this case, this loop finds map that is defined above.
> 
> This is *not* hog.  This is pin setting already applied in SoC's pinmux
> controller for sx1503 device.
> 
> However code in create_pinctrl() tries to apply it, and use sx1503's
> methods to do so. Which is plain wrong and errors out.

Maybe create_pinctrl() could check if the pin controller device
for a potential hog points to the device itself and bail out
if that's not the case?

> > But at least with updating the probe to use pinctrl_register_and_init()
> > and pinctrl_enable() the driver can do something before the hogs are
> > claimed. I just don't know what the driver would here as I don't
> > understand the "misinterpreted as hog" part :)
> 
> Tried to explain above :)

Yup OK based on that this seems like a pinctrl core issue.

Regards,

Tony

  reply	other threads:[~2017-05-11 16:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-10 19:32 pinctrl-sx150x.c broken in 4.11 Nikita Yushchenko
2017-05-11  7:23 ` Linus Walleij
2017-05-11 15:16   ` Tony Lindgren
2017-05-11 16:24     ` Nikita Yushchenko
2017-05-11 16:36       ` Tony Lindgren [this message]
2017-05-11 16:57         ` Nikita Yushchenko
2017-05-11 17:51           ` Tony Lindgren
2017-05-11 19:11             ` Nikita Yushchenko
2017-05-12  9:29             ` 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=20170511163615.GU3489@atomide.com \
    --to=tony@atomide.com \
    --cc=Chris.Healy@zii.aero \
    --cc=Jeff.White@zii.aero \
    --cc=andrew.smirnov@gmail.com \
    --cc=geert+renesas@glider.be \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nikita.yoush@cogentembedded.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.