public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Sven Peter <sven@kernel.org>
To: Linus Walleij <linusw@kernel.org>, Janne Grunau <j@jannau.net>,
	Neal Gompa <neal@gompa.dev>,
	Bartosz Golaszewski <brgl@kernel.org>
Cc: asahi@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
	linux-gpio@vger.kernel.org
Subject: Re: [PATCH 2/2] RFC: pinctrl: apple: Implement GPIO func check callback
Date: Sun, 11 Jan 2026 23:25:10 +0100	[thread overview]
Message-ID: <b53286ec-5c3a-4f8e-93d4-de5ea37f645a@kernel.org> (raw)
In-Reply-To: <20260111-apple-req-gpio-func-v1-2-6deb1b695371@kernel.org>

On 11.01.26 21:29, Linus Walleij wrote:
> This function will check if the indicated function enumerator
> i.e. the value set into bits 5 and 6 of the pin configuration
> register, is zero and thus corresponds to the GPIO mode of the
> pin.
> 
> This may be necessary to know since the pin controller is
> flagged as "strict": once you set a pin *explicitly* to GPIO
> mode using function 0, the core is unaware that this is
> actually the GPIO mode, and clients may be denied to
> retrieve the pin as a GPIO.
> 
> Currently none of the in-kernel device trees sets any pin to
> GPIO mode, but this may happen any day.
> 
> Signed-off-by: Linus Walleij <linusw@kernel.org>
> ---

Just took a quick look: When we use them as GPIO we always set those two 
bits to zero and all "special" functions (like i2c or spi) always start 
at 1. As far as I can tell we can still read the pin value even when bit 
5/6 aren't zero (and e.g. observe i2c traffic that way) but we can't 
drive them anymore.

Since we don't have any documentation for this hardware that's probably 
as good as it'll get:

Reviewed-by: Sven Peter <sven@kernel.org>


Sven




  reply	other threads:[~2026-01-11 22:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-11 20:29 [PATCH 0/2] pinctrl: apple: Fixup and RFC GPIO mode patch Linus Walleij
2026-01-11 20:29 ` [PATCH 1/2] pinctrl: apple: Use unsigned int instead of unsigned Linus Walleij
2026-01-11 22:17   ` Sven Peter
2026-01-11 20:29 ` [PATCH 2/2] RFC: pinctrl: apple: Implement GPIO func check callback Linus Walleij
2026-01-11 22:25   ` Sven Peter [this message]
2026-01-12  9:42 ` [PATCH 0/2] pinctrl: apple: Fixup and RFC GPIO mode patch Bartosz Golaszewski

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=b53286ec-5c3a-4f8e-93d4-de5ea37f645a@kernel.org \
    --to=sven@kernel.org \
    --cc=asahi@lists.linux.dev \
    --cc=brgl@kernel.org \
    --cc=j@jannau.net \
    --cc=linusw@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=neal@gompa.dev \
    /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