diff options
author | Isaku Yamahata <yamahata@valinux.co.jp> | 2011-01-21 19:53:45 +0900 |
---|---|---|
committer | Aurelien Jarno <aurelien@aurel32.net> | 2011-01-25 09:18:00 +0100 |
commit | 0dfa5ef90d0b4eebaf810a897459a009e4b1cef2 (patch) | |
tree | c1a786583824fb1f382eda76db648bca988a3461 /arch_init.c | |
parent | bec43cc3b61d025841d550800d3835986446061d (diff) |
audio: consolidate audio_init()
consolidate audio_init() and remove references to shoundhw.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Acked-by: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Diffstat (limited to 'arch_init.c')
-rw-r--r-- | arch_init.c | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/arch_init.c b/arch_init.c index e32e289c8f..cc56f0f998 100644 --- a/arch_init.c +++ b/arch_init.c @@ -461,7 +461,18 @@ void qemu_service_io(void) } #ifdef HAS_AUDIO -struct soundhw soundhw[] = { +struct soundhw { + const char *name; + const char *descr; + int enabled; + int isa; + union { + int (*init_isa) (qemu_irq *pic); + int (*init_pci) (PCIBus *bus); + } init; +}; + +static struct soundhw soundhw[] = { #ifdef HAS_AUDIO_CHOICE #if defined(TARGET_I386) || defined(TARGET_MIPS) { @@ -610,10 +621,32 @@ void select_soundhw(const char *optarg) } } } + +void audio_init(qemu_irq *isa_pic, PCIBus *pci_bus) +{ + struct soundhw *c; + + for (c = soundhw; c->name; ++c) { + if (c->enabled) { + if (c->isa) { + if (isa_pic) { + c->init.init_isa(isa_pic); + } + } else { + if (pci_bus) { + c->init.init_pci(pci_bus); + } + } + } + } +} #else void select_soundhw(const char *optarg) { } +void audio_init(qemu_irq *isa_pic, PCIBus *pci_bus) +{ +} #endif int qemu_uuid_parse(const char *str, uint8_t *uuid) |