[PATCH 2/2] RFC: pinctrl: apple: Implement GPIO func check callback
Sven Peter
sven at kernel.org
Sun Jan 11 14:25:10 PST 2026
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 at 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 at kernel.org>
Sven
More information about the linux-arm-kernel
mailing list