]> git.ipfire.org Git - thirdparty/qemu.git/commit
hw/gpio/imx_gpio: Fix interpretation of GDIR polarity
authorBernhard Beschow <shentey@gmail.com>
Thu, 1 May 2025 18:34:45 +0000 (20:34 +0200)
committerMichael Tokarev <mjt@tls.msk.ru>
Thu, 8 May 2025 09:18:57 +0000 (12:18 +0300)
commit01a9f1a6c5ea7275f35fbdfe60401ff4d21ec609
tree8105c4baa954d920c62a87e92252ff3927f5a30a
parentbe7b08eb9f5b352f8e805fc8eca07d186e3fff15
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: qemu-stable@nongnu.org
Fixes: f44272809779 ("i.MX: Add GPIO device")
Signed-off-by: Bernhard Beschow <shentey@gmail.com>
Message-id: 20250501183445.2389-4-shentey@gmail.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
(cherry picked from commit eba837a31b9579e30cc6d7ecb4b5c2662a6ffaba)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
hw/gpio/imx_gpio.c