PCI/pwrctrl: tc9563: Allow RESX reset assertion to sleep

The RESX GPIO may be provided by a sleeping GPIO controller, such as an I2C
or SPI I/O expander. Calling gpiod_set_value() for such a GPIO triggers the
following warning:

  WARNING: ... drivers/gpio/gpiolib.c:4030 at gpiod_set_value()

The TC9563 power-on and power-off callbacks already sleep while enabling or
disabling regulators and while waiting for oscillator stabilization.  Use
gpiod_set_value_cansleep() for RESX so it can be driven without triggering
the warning.

Fixes: 4c9c7be473 ("PCI: pwrctrl: Add power control driver for TC9563")
Signed-off-by: Abel Vesa <abel.vesa@oss.qualcomm.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Link: https://patch.msgid.link/20260825-pci-pwrctl-tc9563-use-cansleep-for-resx-v1-1-0dbe7cfd8200@oss.qualcomm.com
This commit is contained in:
Abel Vesa 2026-08-25 14:41:31 +03:00 committed by Bjorn Helgaas
parent 854fc493df
commit 028f86457e

View File

@ -398,7 +398,7 @@ static int tc9563_pwrctrl_power_off(struct pci_pwrctrl *pwrctrl)
struct tc9563_pwrctrl *tc9563 = container_of(pwrctrl,
struct tc9563_pwrctrl, pwrctrl);
gpiod_set_value(tc9563->reset_gpio, 1);
gpiod_set_value_cansleep(tc9563->reset_gpio, 1);
regulator_bulk_disable(ARRAY_SIZE(tc9563->supplies), tc9563->supplies);
@ -418,7 +418,7 @@ static int tc9563_pwrctrl_power_on(struct pci_pwrctrl *pwrctrl)
if (ret < 0)
return dev_err_probe(dev, ret, "cannot enable regulators\n");
gpiod_set_value(tc9563->reset_gpio, 0);
gpiod_set_value_cansleep(tc9563->reset_gpio, 0);
fsleep(TC9563_OSC_STAB_DELAY_US);