[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH v2 5/5] hw/arm/tosa: Use LED device for the Bluetooth led
From: |
Philippe Mathieu-Daudé |
Subject: |
[RFC PATCH v2 5/5] hw/arm/tosa: Use LED device for the Bluetooth led |
Date: |
Fri, 12 Jun 2020 19:54:40 +0200 |
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
hw/arm/tosa.c | 7 +++----
hw/arm/Kconfig | 1 +
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/hw/arm/tosa.c b/hw/arm/tosa.c
index 5dee2d76c6..86d7e0283a 100644
--- a/hw/arm/tosa.c
+++ b/hw/arm/tosa.c
@@ -24,6 +24,7 @@
#include "hw/irq.h"
#include "hw/ssi/ssi.h"
#include "hw/sysbus.h"
+#include "hw/misc/led.h"
#include "exec/address-spaces.h"
#define TOSA_RAM 0x04000000
@@ -68,9 +69,6 @@ static void tosa_microdrive_attach(PXA2xxState *cpu)
static void tosa_out_switch(void *opaque, int line, int level)
{
switch (line) {
- case 0:
- fprintf(stderr, "blue LED %s.\n", level ? "on" : "off");
- break;
case 1:
fprintf(stderr, "green LED %s.\n", level ? "on" : "off");
break;
@@ -119,7 +117,6 @@ static void tosa_gpio_setup(PXA2xxState *cpu,
qdev_get_gpio_in(cpu->gpio, TOSA_GPIO_JC_CF_IRQ),
NULL);
- qdev_connect_gpio_out(scp1, TOSA_GPIO_BT_LED, outsignals[0]);
qdev_connect_gpio_out(scp1, TOSA_GPIO_NOTE_LED, outsignals[1]);
qdev_connect_gpio_out(scp1, TOSA_GPIO_CHRG_ERR_LED, outsignals[2]);
qdev_connect_gpio_out(scp1, TOSA_GPIO_WLAN_LED, outsignals[3]);
@@ -234,6 +231,8 @@ static void tosa_init(MachineState *machine)
scp0 = sysbus_create_simple("scoop", 0x08800000, NULL);
scp1 = sysbus_create_simple("scoop", 0x14800040, NULL);
+ create_led_by_gpio_id(OBJECT(machine), DEVICE(scp1),
+ TOSA_GPIO_BT_LED, "blue LED");
tosa_gpio_setup(mpu, scp0, scp1, tmio);
diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig
index 2afaa7c8e9..009336cac8 100644
--- a/hw/arm/Kconfig
+++ b/hw/arm/Kconfig
@@ -150,6 +150,7 @@ config TOSA
select ZAURUS # scoop
select MICRODRIVE
select PXA2XX
+ select LED
config SPITZ
bool
--
2.21.3
- Re: [RFC PATCH v2 1/5] hw/misc: Add a LED device, (continued)
[RFC PATCH v2 2/5] hw/misc/led: Add LED_STATUS_CHANGED QAPI event, Philippe Mathieu-Daudé, 2020/06/12
[RFC PATCH v2 3/5] hw/misc/led: Add create_led_by_gpio_id() helper, Philippe Mathieu-Daudé, 2020/06/12
[RFC PATCH v2 4/5] hw/arm/microbit: Add a fake LED to use as proof-of-concept with Zephyr, Philippe Mathieu-Daudé, 2020/06/12
[RFC PATCH v2 5/5] hw/arm/tosa: Use LED device for the Bluetooth led,
Philippe Mathieu-Daudé <=