qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: qemu-devel@nongnu.org
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
	"Michael Roth" <mdroth@linux.vnet.ibm.com>,
	"Philippe Mathieu-Daudé" <philmd@redhat.com>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	"Dr . David Alan Gilbert" <dgilbert@redhat.com>,
	"Markus Armbruster" <armbru@redhat.com>,
	"Esteban Bosse" <estebanbosse@gmail.com>,
	qemu-arm@nongnu.org, "Gerd Hoffmann" <kraxel@redhat.com>,
	"Joel Stanley" <joel@jms.id.au>
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	[thread overview]
Message-ID: <20200612175440.9901-6-f4bug@amsat.org> (raw)
In-Reply-To: <20200612175440.9901-1-f4bug@amsat.org>

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



  parent reply	other threads:[~2020-06-12 17:58 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-12 17:54 [RFC PATCH v2 0/5] hw/misc: Add LED device Philippe Mathieu-Daudé
2020-06-12 17:54 ` [RFC PATCH v2 1/5] hw/misc: Add a " Philippe Mathieu-Daudé
2020-06-12 18:44   ` Stefan Weil
2020-06-15 10:55   ` Dr. David Alan Gilbert
2020-06-15 11:19     ` Philippe Mathieu-Daudé
2020-06-15 11:50       ` Dr. David Alan Gilbert
2020-06-12 17:54 ` [RFC PATCH v2 2/5] hw/misc/led: Add LED_STATUS_CHANGED QAPI event Philippe Mathieu-Daudé
2020-06-15 16:05   ` Peter Maydell
2020-06-12 17:54 ` [RFC PATCH v2 3/5] hw/misc/led: Add create_led_by_gpio_id() helper Philippe Mathieu-Daudé
2020-06-12 17:54 ` [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-15 16:02   ` Peter Maydell
2020-06-15 16:10     ` Philippe Mathieu-Daudé
2020-06-12 17:54 ` Philippe Mathieu-Daudé [this message]
2020-06-15 16:00   ` [RFC PATCH v2 5/5] hw/arm/tosa: Use LED device for the Bluetooth led Peter Maydell
2020-06-15 16:18     ` Philippe Mathieu-Daudé

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=20200612175440.9901-6-f4bug@amsat.org \
    --to=f4bug@amsat.org \
    --cc=armbru@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=estebanbosse@gmail.com \
    --cc=joel@jms.id.au \
    --cc=kraxel@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@redhat.com \
    --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).