Skip to content

Commit 01a9f1a

Browse files
shentokMichael Tokarev
authored andcommitted
hw/gpio/imx_gpio: Fix interpretation of GDIR polarity
According to the i.MX 8M Plus reference manual, a GPIO pin is configured as an output when the corresponding bit in the GDIR register is set. The function imx_gpio_set_int_line() is intended to be a no-op if the pin is configured as an output, returning early in such cases. However, it inverts the condition. Fix this by returning early when the bit is set. cc: [email protected] Fixes: f442728 ("i.MX: Add GPIO device") Signed-off-by: Bernhard Beschow <[email protected]> Message-id: [email protected] Reviewed-by: Peter Maydell <[email protected]> Signed-off-by: Peter Maydell <[email protected]> (cherry picked from commit eba837a) Signed-off-by: Michael Tokarev <[email protected]>
1 parent be7b08e commit 01a9f1a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

hw/gpio/imx_gpio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ static void imx_gpio_update_int(IMXGPIOState *s)
7272
static void imx_gpio_set_int_line(IMXGPIOState *s, int line, IMXGPIOLevel level)
7373
{
7474
/* if this signal isn't configured as an input signal, nothing to do */
75-
if (!extract32(s->gdir, line, 1)) {
75+
if (extract32(s->gdir, line, 1)) {
7676
return;
7777
}
7878

0 commit comments

Comments
 (0)