Linux GPIO subsystem development
 help / color / mirror / Atom feed
From: Mehmet Fide <mehmet.fide@gmail.com>
To: Bartosz Golaszewski <brgl@kernel.org>
Cc: linux-gpio@vger.kernel.org
Subject: Re: [PATCH] gpiolib: return quietly from gpiod_get_direction() without .get_direction()
Date: Thu, 27 Aug 2026 22:12:59 +0200	[thread overview]
Message-ID: <20260827201259.3647152-1-mehmet.fide@gmail.com> (raw)
In-Reply-To: <CAMRc=MeCeGDEGbDMtHZXGuiPQV-QBYfNW50MmiJ0ke=De2_nVQ@mail.gmail.com>

Hi Bartosz,

On 26/08/2026 at 17:06, Bartosz Golaszewski wrote:

> I would rather implement the missing callback in gpio-mmio. We already call
> into pinctrl if needed when setting direction, could we call
> pinctrl_gpio_get_config() here and read the direction from the underlying
> pinctrl driver?

I agree that is the better place, and I am happy to drop this patch in
favour of it. One wrinkle I ran into while prototyping: for the config
road to work, the pinctrl driver has to report the direction as a
generic parameter, and pinctrl-imx (which serves vf610) does not - its
pin_config_get() returns the raw pad register value, not
pinconf-generic parameters, so gpio-mmio cannot decode it generically
(on vf610 the buffer enables are bits 1:0 of the shared mux/conf
register).

So my plan would be two small steps:

 1. teach the vf610 pinconf side to report PIN_CONFIG_OUTPUT_ENABLE
    (and PIN_CONFIG_INPUT_ENABLE) from the pad register;
 2. give gpio-mmio a get_direction() that is only installed when the
    chip has no direction registers, asking pinctrl for
    PIN_CONFIG_OUTPUT_ENABLE, as you suggest.

Does that match what you had in mind? If so I will send that series
instead of this patch. Enjoy the rest of your time off - September is
fine for me.

Thanks,
Mehmet

      reply	other threads:[~2026-08-27 20:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-13 19:37 [PATCH] gpiolib: return quietly from gpiod_get_direction() without .get_direction() Mehmet Fide
2026-08-20 11:12 ` Mehmet Fide
2026-08-26 15:06   ` Bartosz Golaszewski
2026-08-27 20:12     ` Mehmet Fide [this message]

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=20260827201259.3647152-1-mehmet.fide@gmail.com \
    --to=mehmet.fide@gmail.com \
    --cc=brgl@kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    /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