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>
This commit is contained in:
Isaku Yamahata 2011-01-21 19:53:45 +09:00 committed by Aurelien Jarno
parent bec43cc3b6
commit 0dfa5ef90d
8 changed files with 41 additions and 80 deletions

View file

@ -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)