U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Webb <chris@arachsys.com>
To: Simon Glass <sjg@chromium.org>
Cc: u-boot@lists.denx.de, Tom Rini <trini@konsulko.com>,
	Marek Vasut <marex@denx.de>
Subject: Re: [PATCH RFC] gpio: Fix probing of gpio-hogs
Date: Mon, 29 Jul 2024 17:45:05 +0100	[thread overview]
Message-ID: <43228DC7-4184-4C63-9BBA-65F056ECC91F@arachsys.com> (raw)
In-Reply-To: <CAFLszTggwpCnhZ0xaPR2n=e+x+PDe-wP4WxnPE60BqyF1ms3UA@mail.gmail.com>

Hi Simon,

Simon Glass <sjg@chromium.org> wrote:

> Well, yes, mt7981_pinctrl is wrong since it is not actually binding
> the GPIO devices until it itself is probed. It should do it when it is
> bound.

Oh I see! Yes, I can see the mtk_gpiochip_register(dev) in  
mtk_pinctrl_common_probe() exactly as you say.

> Better still, those GPIO devices should be in the devicetree and bound
> automatically by driver model. But, sigh, I see that there is no
> compatible string in the gpio subnode of pinctrl@11d00000. It should
> really have one and avoid all this pointless code and problems.
>
> mtk_pinctrl_common_probe() is misnamed, as it actually binds and then  
> probes.
>
> So (unless Linux allows a patch to add a compatible string) it needs a
> new mtk_pinctrl_common_bind() (called from mtk_pinctrl_mt7981_bind())
> which calls mtk_gpiochip_register(). Then you won't need to add your
> dev_or_flags() into mtk_pinctrl_mt7981_bind().

Yes, that makes complete sense. Many thanks! I'm very happy to write that  
patch and grab back the physical hardware to double-check on if you like?  
(Or equally happy to leave it if you'd prefer to fix yourself?)

Presumably it needs to apply to every mtk soc that uses  
mtk_pinctrl_common_probe() as they'll all be affected by this problem.

Best wishes,

Chris.

  reply	other threads:[~2024-07-29 16:45 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-13 10:59 [PATCH RFC] gpio: Fix probing of gpio-hogs Chris Webb
2024-06-20 20:16 ` Tom Rini
2024-06-22 11:04   ` Chris Webb
2024-07-03  9:49     ` Chris Webb
2024-07-29  7:45       ` Chris Webb
2024-07-29 15:25 ` Simon Glass
2024-07-29 15:44   ` Chris Webb
2024-07-29 16:18     ` Simon Glass
2024-07-29 16:45       ` Chris Webb [this message]
2024-07-29 17:21         ` Simon Glass
2024-07-31 10:14           ` Chris Webb
2024-07-31 14:38             ` Simon Glass
2024-07-31 18:14               ` Chris Webb

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=43228DC7-4184-4C63-9BBA-65F056ECC91F@arachsys.com \
    --to=chris@arachsys.com \
    --cc=marex@denx.de \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /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