Re: [PATCH 1/2] gpio: shared-proxy: track direction instead of reading it back

From: Bartosz Golaszewski

Date: Wed Sep 16 2026 - 04:51:36 EST


On Tue, 15 Sep 2026 03:44:46 +0200, Shawn Guo
<shengchao.guo@xxxxxxxxxxxxxxxx> said:
> On boards where more than one consumer shares a Qualcomm SPMI PMIC GPIO,
> all but the first consumer fail to configure the line as output:
>
> reg-fixed-voltage regulator-wcn-core-vm-1p35: setup of GPIO (default) failed: -1
> reg-fixed-voltage regulator-wcn-core-vm-1p35: error -EPERM: can't get GPIO
>
> The first consumer takes the usecnt == 1 branch and really does set the
> underlying line to output. Later consumers instead read the direction
> back with gpiod_get_direction() and refuse with -EPERM if it reports
> input. pmic_gpio_get_direction() derives the direction from the pad's
> input buffer (pad->input_enabled), which pmic_gpio_direction_output()
> never clears, so a pad whose input buffer is enabled at power-up reports
> input forever and the proxy rejects every consumer after the first.
>

Do we still even need this with patch 2/2 applied?

Bart