hw/arm: Support machine-default audiodev with fallback

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Martin Kletzander 2023-09-22 17:21:39 +02:00 committed by Paolo Bonzini
parent 7a2c7da644
commit b8ab0303de
12 changed files with 92 additions and 9 deletions

View file

@ -27,6 +27,7 @@
#include "sysemu/reset.h"
#include "ui/console.h"
#include "hw/arm/omap.h" /* For I2SCodec */
#include "hw/boards.h" /* for current_machine */
#include "hw/input/tsc2xxx.h"
#include "hw/irq.h"
#include "migration/vmstate.h"
@ -1097,6 +1098,10 @@ static void tsc210x_init(TSC210xState *s,
qemu_add_mouse_event_handler(tsc210x_touchscreen_event, s, 1, name);
if (current_machine->audiodev) {
s->card.name = g_strdup(current_machine->audiodev);
s->card.state = audio_state_by_name(s->card.name, &error_fatal);
}
AUD_register_card(s->name, &s->card);
qemu_register_reset((void *) tsc210x_reset, s);