]> git.ipfire.org Git - thirdparty/qemu.git/commit
hw/misc/led: Allow connecting from GPIO output
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>
Tue, 16 Jun 2020 04:23:50 +0000 (06:23 +0200)
committerPhilippe Mathieu-Daudé <f4bug@amsat.org>
Mon, 26 Oct 2020 12:44:58 +0000 (13:44 +0100)
commitddb67f6402b8096f70ca68e3cffaddfd588b384d
tree013b0fcb0a0ddfe94cd7c88d8c4d1ed2be82455a
parentc1b29826279b7405990ccb521d1fb5a24db2e58e
hw/misc/led: Allow connecting from GPIO output

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>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Luc Michel <luc.michel@greensocs.com>
Message-Id: <20200912134041.946260-3-f4bug@amsat.org>
hw/misc/led.c
include/hw/misc/led.h
include/hw/qdev-core.h