aboutsummaryrefslogtreecommitdiff
path: root/hw/arm/omap2.c
diff options
context:
space:
mode:
authorMartin Kletzander <mkletzan@redhat.com>2023-09-22 17:21:39 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2023-10-03 10:29:39 +0200
commitb8ab0303de5a72d89da5ab25d8fe817d8797888f (patch)
tree0609ead6c7f95ccb566ff221369e3f7466077af0 /hw/arm/omap2.c
parent7a2c7da6448eb8538bccbbc288508bde69bc4c2d (diff)
hw/arm: Support machine-default audiodev with fallback
Signed-off-by: Martin Kletzander <mkletzan@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/arm/omap2.c')
-rw-r--r--hw/arm/omap2.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/hw/arm/omap2.c b/hw/arm/omap2.c
index d5a2ae7af6..41b1f596dc 100644
--- a/hw/arm/omap2.c
+++ b/hw/arm/omap2.c
@@ -37,6 +37,7 @@
#include "hw/block/flash.h"
#include "hw/arm/soc_dma.h"
#include "hw/sysbus.h"
+#include "hw/boards.h"
#include "audio/audio.h"
/* Enhanced Audio Controller (CODEC only) */
@@ -609,6 +610,10 @@ static struct omap_eac_s *omap_eac_init(struct omap_target_agent_s *ta,
s->codec.txdrq = *drq;
omap_eac_reset(s);
+ if (current_machine->audiodev) {
+ s->codec.card.name = g_strdup(current_machine->audiodev);
+ s->codec.card.state = audio_state_by_name(s->codec.card.name, &error_fatal);
+ }
AUD_register_card("OMAP EAC", &s->codec.card);
memory_region_init_io(&s->iomem, NULL, &omap_eac_ops, s, "omap.eac",