From: Richard Henderson <richard.henderson@linaro.org>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>, qemu-devel@nongnu.org
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
"Daniel P. Berrangé" <berrange@redhat.com>,
"Eduardo Habkost" <ehabkost@redhat.com>,
"Andrew Jeffery" <andrew@aj.id.au>,
qemu-arm@nongnu.org, "Cédric Le Goater" <clg@kaod.org>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Luc Michel" <luc.michel@greensocs.com>,
"Joel Stanley" <joel@jms.id.au>
Subject: Re: [PATCH v5 2/7] hw/misc/led: Allow connecting from GPIO output
Date: Fri, 11 Sep 2020 15:44:22 -0700 [thread overview]
Message-ID: <071b68a6-58e4-0d68-e056-ee7ae19e2227@linaro.org> (raw)
In-Reply-To: <20200910205429.727766-3-f4bug@amsat.org>
On 9/10/20 1:54 PM, Philippe Mathieu-Daudé wrote:
> Some devices expose GPIO lines.
>
> Add a GPIO qdev input to our LED device, so we can
> connect a GPIO output using qdev_connect_gpio_out().
>
> When used with GPIOs, the intensity can only be either
> minium or maximum. This depends of the polarity of the
> GPIO (which can be inverted).
> Declare the GpioPolarity type to model the polarity.
>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> include/hw/misc/led.h | 8 ++++++++
> include/hw/qdev-core.h | 8 ++++++++
> hw/misc/led.c | 17 ++++++++++++++++-
> 3 files changed, 32 insertions(+), 1 deletion(-)
>
> diff --git a/include/hw/misc/led.h b/include/hw/misc/led.h
> index f5afaa34bfb..71c9b8c59bf 100644
> --- a/include/hw/misc/led.h
> +++ b/include/hw/misc/led.h
> @@ -38,10 +38,16 @@ typedef struct LEDState {
> /* Public */
>
> uint8_t intensity_percent;
> + qemu_irq irq;
>
> /* Properties */
> char *description;
> char *color;
> + /*
> + * When used with GPIO, the intensity at reset is related
> + * to the GPIO polarity.
> + */
> + bool inverted_polarity;
Why are you not using the GpioPolarity enum that you added?
r~
next prev parent reply other threads:[~2020-09-11 22:45 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-10 20:54 [PATCH v5 0/7] hw/misc: Add LED device Philippe Mathieu-Daudé
2020-09-10 20:54 ` [PATCH v5 1/7] hw/misc/led: Add a " Philippe Mathieu-Daudé
2020-09-11 19:42 ` Luc Michel
2020-09-11 22:37 ` Richard Henderson
2020-09-10 20:54 ` [PATCH v5 2/7] hw/misc/led: Allow connecting from GPIO output Philippe Mathieu-Daudé
2020-09-11 19:42 ` Luc Michel
2020-09-12 9:02 ` Philippe Mathieu-Daudé
2020-09-12 9:14 ` Philippe Mathieu-Daudé
2020-09-11 22:44 ` Richard Henderson [this message]
2020-09-12 8:50 ` Philippe Mathieu-Daudé
2020-09-12 13:32 ` Philippe Mathieu-Daudé
2020-09-14 7:27 ` Markus Armbruster
2020-09-14 7:48 ` Philippe Mathieu-Daudé
2020-09-14 14:03 ` Eduardo Habkost
2020-09-14 15:05 ` Philippe Mathieu-Daudé
2020-09-14 15:56 ` Philippe Mathieu-Daudé
2020-09-10 20:54 ` [PATCH v5 3/7] hw/misc/led: Emit a trace event when LED intensity has changed Philippe Mathieu-Daudé
2020-09-11 19:43 ` Luc Michel
2020-09-10 20:54 ` [PATCH v5 4/7] hw/arm/aspeed: Add the 3 front LEDs drived by the PCA9552 #1 Philippe Mathieu-Daudé
2020-09-11 19:57 ` Luc Michel
2020-09-10 20:54 ` [PATCH v5 5/7] hw/misc/mps2-fpgaio: Use the LED device Philippe Mathieu-Daudé
2020-09-11 20:12 ` Luc Michel
2020-09-12 8:06 ` Philippe Mathieu-Daudé
2020-09-11 22:46 ` Richard Henderson
2020-09-10 20:54 ` [PATCH v5 6/7] hw/misc/mps2-scc: " Philippe Mathieu-Daudé
2020-09-11 20:15 ` Luc Michel
2020-09-11 22:47 ` Richard Henderson
2020-09-10 20:54 ` [PATCH v5 7/7] hw/arm/tosa: Replace fprintf() calls by LED devices Philippe Mathieu-Daudé
2020-09-11 19:55 ` Luc Michel
2020-09-11 22:48 ` Richard Henderson
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=071b68a6-58e4-0d68-e056-ee7ae19e2227@linaro.org \
--to=richard.henderson@linaro.org \
--cc=andrew@aj.id.au \
--cc=berrange@redhat.com \
--cc=clg@kaod.org \
--cc=ehabkost@redhat.com \
--cc=f4bug@amsat.org \
--cc=joel@jms.id.au \
--cc=luc.michel@greensocs.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@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).