Skip to content

Commit b2f750c

Browse files
Josua-SRjmberg-intel
authored andcommitted
net: rfkill: gpio: prevent value glitch during probe
When either reset- or shutdown-gpio have are initially deasserted, e.g. after a reboot - or when the hardware does not include pull-down, there will be a short toggle of both IOs to logical 0 and back to 1. It seems that the rfkill default is unblocked, so the driver should not glitch to output low during probe. It can lead e.g. to unexpected lte modem reconnect: [1] root@localhost:~# dmesg | grep "usb 2-1" [ 2.136124] usb 2-1: new SuperSpeed USB device number 2 using xhci-hcd [ 21.215278] usb 2-1: USB disconnect, device number 2 [ 28.833977] usb 2-1: new SuperSpeed USB device number 3 using xhci-hcd The glitch has been discovered on an arm64 board, now that device-tree support for the rfkill-gpio driver has finally appeared :). Change the flags for devm_gpiod_get_optional from GPIOD_OUT_LOW to GPIOD_ASIS to avoid any glitches. The rfkill driver will set the intended value during rfkill_sync_work. Fixes: 7176ba2 ("net: rfkill: add generic gpio rfkill driver") Signed-off-by: Josua Mayer <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Johannes Berg <[email protected]>
1 parent 02e0e42 commit b2f750c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

net/rfkill/rfkill-gpio.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,13 @@ static int rfkill_gpio_probe(struct platform_device *pdev)
108108

109109
rfkill->clk = devm_clk_get(&pdev->dev, NULL);
110110

111-
gpio = devm_gpiod_get_optional(&pdev->dev, "reset", GPIOD_OUT_LOW);
111+
gpio = devm_gpiod_get_optional(&pdev->dev, "reset", GPIOD_ASIS);
112112
if (IS_ERR(gpio))
113113
return PTR_ERR(gpio);
114114

115115
rfkill->reset_gpio = gpio;
116116

117-
gpio = devm_gpiod_get_optional(&pdev->dev, "shutdown", GPIOD_OUT_LOW);
117+
gpio = devm_gpiod_get_optional(&pdev->dev, "shutdown", GPIOD_ASIS);
118118
if (IS_ERR(gpio))
119119
return PTR_ERR(gpio);
120120

0 commit comments

Comments
 (0)