]> git.itanic.dy.fi Git - linux-stable/commit
net: rfkill: gpio: set GPIO direction
authorRouven Czerwinski <r.czerwinski@pengutronix.de>
Thu, 7 Dec 2023 07:58:36 +0000 (08:58 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 1 Jan 2024 12:42:41 +0000 (12:42 +0000)
commitd2821864c744373ead89204c22dca781f5b60fad
tree0dbcef249896433cc1ee16f2d6aeb5e63c772021
parent506ef81c993c7c19b7281d096aa3fba60e7f202e
net: rfkill: gpio: set GPIO direction

commit 23484d817082c3005252d8edfc8292c8a1006b5b 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: b2f750c3a80b ("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>
net/rfkill/rfkill-gpio.c