aboutsummaryrefslogtreecommitdiff
path: root/hw/misc/led.c
diff options
context:
space:
mode:
authorGlenn Miles <milesg@linux.vnet.ibm.com>2023-10-24 14:19:45 -0500
committerPeter Maydell <peter.maydell@linaro.org>2023-10-27 12:51:17 +0100
commit6f83dc67168d17856744275e2a0d7a6addf6cfb9 (patch)
tree21f91bac071092751587d371cd2c5c8cc374f6b9 /hw/misc/led.c
parentf0109f721e8994deabd35b69d96d6d0bdfec0425 (diff)
misc/led: LED state is set opposite of what is expected
Testing of the LED state showed that when the LED polarity was set to GPIO_POLARITY_ACTIVE_LOW and a low logic value was set on the input GPIO of the LED, the LED was being turn off when it was expected to be turned on. Fixes: ddb67f6402 ("hw/misc/led: Allow connecting from GPIO output") Signed-off-by: Glenn Miles <milesg@linux.vnet.ibm.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Andrew Jeffery <andrew@codeconstruct.com.au> Message-id: 20231024191945.4135036-1-milesg@linux.vnet.ibm.com Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/misc/led.c')
-rw-r--r--hw/misc/led.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/misc/led.c b/hw/misc/led.c
index f6d6d68bce..42bb43a39a 100644
--- a/hw/misc/led.c
+++ b/hw/misc/led.c
@@ -63,7 +63,7 @@ static void led_set_state_gpio_handler(void *opaque, int line, int new_state)
LEDState *s = LED(opaque);
assert(line == 0);
- led_set_state(s, !!new_state != s->gpio_active_high);
+ led_set_state(s, !!new_state == s->gpio_active_high);
}
static void led_reset(DeviceState *dev)