mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-28 21:33:52 +00:00
net: rfkill: gpio: set GPIO direction
commit23484d8170
upstream. Fix the undefined usage of the GPIO consumer API after retrieving the GPIO description with GPIO_ASIS. The API documentation mentions that GPIO_ASIS won't set a GPIO direction and requires the user to set a direction before using the GPIO. This can be confirmed on i.MX6 hardware, where rfkill-gpio is no longer able to enabled/disable a device, presumably because the GPIO controller was never configured for the output direction. Fixes:b2f750c3a8
("net: rfkill: gpio: prevent value glitch during probe") Cc: stable@vger.kernel.org Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de> Link: https://msgid.link/20231207075835.3091694-1-r.czerwinski@pengutronix.de Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
21d33e353f
commit
73bee12093
1 changed files with 8 additions and 0 deletions
|
@ -129,6 +129,14 @@ static int rfkill_gpio_probe(struct platform_device *pdev)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ret = gpiod_direction_output(rfkill->reset_gpio, true);
|
||||||
|
if (ret)
|
||||||
|
return ret;
|
||||||
|
|
||||||
|
ret = gpiod_direction_output(rfkill->shutdown_gpio, true);
|
||||||
|
if (ret)
|
||||||
|
return ret;
|
||||||
|
|
||||||
rfkill->rfkill_dev = rfkill_alloc(rfkill->name, &pdev->dev,
|
rfkill->rfkill_dev = rfkill_alloc(rfkill->name, &pdev->dev,
|
||||||
rfkill->type, &rfkill_gpio_ops,
|
rfkill->type, &rfkill_gpio_ops,
|
||||||
rfkill);
|
rfkill);
|
||||||
|
|
Loading…
Reference in a new issue