diff mbox series

[12/12,RFC] audio: try use onboard audiodev for pcspk

Message ID 20200429110214.29037-13-kraxel@redhat.com
State New
Headers show
Series None | expand

Commit Message

Gerd Hoffmann April 29, 2020, 11:02 a.m. UTC
New naming convention:  Use "onboard" audiodev for onboard audio
devices.

This patchs implements it for pcspk.  If we want go this route we should
do the same for other onboard audio devices too (arm boards, ...).

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/audio/pcspk.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/hw/audio/pcspk.c b/hw/audio/pcspk.c
index 72e7234d5f65..102cac21b3be 100644
--- a/hw/audio/pcspk.c
+++ b/hw/audio/pcspk.c
@@ -190,6 +190,9 @@  static void pcspk_realizefn(DeviceState *dev, Error **errp)
 
     isa_register_ioport(isadev, &s->ioport, s->iobase);
 
+    if (!s->card.state) {
+        s->card.state = audio_state_by_name("onboard");
+    }
     if (s->card.state) {
         pcspk_audio_init(s);
     }