From: Glenn Miles <milesg@linux.vnet.ibm.com>
To: qemu-devel@nongnu.org
Cc: Glenn Miles <milesg@linux.vnet.ibm.com>,
qemu-arm@nongnu.org, clg@kaod.org, andrew@codeconstruct.com.au,
joel@jms.id.au, philmd@linaro.org
Subject: [PATCH v2] misc/led: LED state is set opposite of what is expected
Date: Tue, 24 Oct 2023 14:11:15 -0500 [thread overview]
Message-ID: <20231024191115.4134426-1-milesg@linux.vnet.ibm.com> (raw)
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.
Signed-off-by: Glenn Miles <milesg@linux.vnet.ibm.com>
---
Changes from v1:
- Changed logic for readability
hw/misc/led.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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)
--
2.31.1
next reply other threads:[~2023-10-24 19:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-24 19:11 Glenn Miles [this message]
2023-10-27 6:03 ` [PATCH v2] misc/led: LED state is set opposite of what is expected Andrew Jeffery
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231024191115.4134426-1-milesg@linux.vnet.ibm.com \
--to=milesg@linux.vnet.ibm.com \
--cc=andrew@codeconstruct.com.au \
--cc=clg@kaod.org \
--cc=joel@jms.id.au \
--cc=philmd@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).