Skip to content
Snippets Groups Projects
Commit 6f83dc67 authored by Glenn Miles's avatar Glenn Miles Committed by Peter Maydell
Browse files

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: ddb67f64 ("hw/misc/led: Allow connecting from GPIO output")
Signed-off-by: default avatarGlenn Miles <milesg@linux.vnet.ibm.com>
Reviewed-by: default avatarPeter Maydell <peter.maydell@linaro.org>
Reviewed-by: default avatarAndrew Jeffery <andrew@codeconstruct.com.au>
Message-id: 20231024191945.4135036-1-milesg@linux.vnet.ibm.com
Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
parent f0109f72
No related branches found
No related tags found
No related merge requests found
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment