audio: remove the need for audio card CONFIG_* symbols

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1366303444-24620-3-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
diff --git a/hw/audio/ac97.c b/hw/audio/ac97.c
index ab68ec6..baf138b 100644
--- a/hw/audio/ac97.c
+++ b/hw/audio/ac97.c
@@ -1396,7 +1396,7 @@
     memory_region_destroy (&s->io_nabm);
 }
 
-int ac97_init (PCIBus *bus)
+static int ac97_init (PCIBus *bus)
 {
     pci_create_simple (bus, -1, "AC97");
     return 0;
@@ -1433,6 +1433,7 @@
 static void ac97_register_types (void)
 {
     type_register_static (&ac97_info);
+    pci_register_soundhw("ac97", "Intel 82801AA AC97 Audio", ac97_init);
 }
 
 type_init (ac97_register_types)
diff --git a/hw/audio/adlib.c b/hw/audio/adlib.c
index fb41f9d..fc20857 100644
--- a/hw/audio/adlib.c
+++ b/hw/audio/adlib.c
@@ -372,7 +372,7 @@
     .class_init    = adlib_class_initfn,
 };
 
-int Adlib_init (ISABus *bus)
+static int Adlib_init (ISABus *bus)
 {
     isa_create_simple (bus, TYPE_ADLIB);
     return 0;
@@ -381,6 +381,7 @@
 static void adlib_register_types (void)
 {
     type_register_static (&adlib_info);
+    isa_register_soundhw("adlib", ADLIB_DESC, Adlib_init);
 }
 
 type_init (adlib_register_types)
diff --git a/hw/audio/cs4231a.c b/hw/audio/cs4231a.c
index 5711b62..cc605e5 100644
--- a/hw/audio/cs4231a.c
+++ b/hw/audio/cs4231a.c
@@ -659,7 +659,7 @@
     return 0;
 }
 
-int cs4231a_init (ISABus *bus)
+static int cs4231a_init (ISABus *bus)
 {
     isa_create_simple (bus, "cs4231a");
     return 0;
@@ -692,6 +692,7 @@
 static void cs4231a_register_types (void)
 {
     type_register_static (&cs4231a_info);
+    isa_register_soundhw("cs4231a", "CS4231A", cs4231a_init);
 }
 
 type_init (cs4231a_register_types)
diff --git a/hw/audio/es1370.c b/hw/audio/es1370.c
index 9fe5708..c1cd169 100644
--- a/hw/audio/es1370.c
+++ b/hw/audio/es1370.c
@@ -1051,7 +1051,7 @@
     memory_region_destroy (&s->io);
 }
 
-int es1370_init (PCIBus *bus)
+static int es1370_init (PCIBus *bus)
 {
     pci_create_simple (bus, -1, "ES1370");
     return 0;
@@ -1083,6 +1083,7 @@
 static void es1370_register_types (void)
 {
     type_register_static (&es1370_info);
+    pci_register_soundhw("es1370", "ENSONIQ AudioPCI ES1370", es1370_init);
 }
 
 type_init (es1370_register_types)
diff --git a/hw/audio/gus.c b/hw/audio/gus.c
index 0604d6e..a91921c 100644
--- a/hw/audio/gus.c
+++ b/hw/audio/gus.c
@@ -293,7 +293,7 @@
     return 0;
 }
 
-int GUS_init (ISABus *bus)
+static int GUS_init (ISABus *bus)
 {
     isa_create_simple (bus, "gus");
     return 0;
@@ -327,6 +327,7 @@
 static void gus_register_types (void)
 {
     type_register_static (&gus_info);
+    isa_register_soundhw("gus", "Gravis Ultrasound GF1", GUS_init);
 }
 
 type_init (gus_register_types)
diff --git a/hw/audio/intel-hda.c b/hw/audio/intel-hda.c
index 3d8077a..1016af0 100644
--- a/hw/audio/intel-hda.c
+++ b/hw/audio/intel-hda.c
@@ -1300,21 +1300,11 @@
     .class_init = hda_codec_device_class_init,
 };
 
-static void intel_hda_register_types(void)
-{
-    type_register_static(&hda_codec_bus_info);
-    type_register_static(&intel_hda_info_ich6);
-    type_register_static(&intel_hda_info_ich9);
-    type_register_static(&hda_codec_device_type_info);
-}
-
-type_init(intel_hda_register_types)
-
 /*
  * create intel hda controller with codec attached to it,
  * so '-soundhw hda' works.
  */
-int intel_hda_and_codec_init(PCIBus *bus)
+static int intel_hda_and_codec_init(PCIBus *bus)
 {
     PCIDevice *controller;
     BusState *hdabus;
@@ -1327,3 +1317,13 @@
     return 0;
 }
 
+static void intel_hda_register_types(void)
+{
+    type_register_static(&hda_codec_bus_info);
+    type_register_static(&intel_hda_info_ich6);
+    type_register_static(&intel_hda_info_ich9);
+    type_register_static(&hda_codec_device_type_info);
+    pci_register_soundhw("hda", "Intel HD Audio", intel_hda_and_codec_init);
+}
+
+type_init(intel_hda_register_types)
diff --git a/hw/audio/pcspk.c b/hw/audio/pcspk.c
index d844e85..3a7285f 100644
--- a/hw/audio/pcspk.c
+++ b/hw/audio/pcspk.c
@@ -25,6 +25,7 @@
 #include "hw/hw.h"
 #include "hw/i386/pc.h"
 #include "hw/isa/isa.h"
+#include "hw/audio/audio.h"
 #include "audio/audio.h"
 #include "qemu/timer.h"
 #include "hw/timer/i8254.h"
@@ -108,7 +109,7 @@
     }
 }
 
-int pcspk_audio_init(ISABus *bus)
+static int pcspk_audio_init(ISABus *bus)
 {
     PCSpkState *s = pcspk_state;
     struct audsettings as = {PCSPK_SAMPLE_RATE, 1, AUD_FMT_U8, 0};
@@ -200,5 +201,6 @@
 static void pcspk_register(void)
 {
     type_register_static(&pcspk_info);
+    isa_register_soundhw("pcspk", "PC speaker", pcspk_audio_init);
 }
 type_init(pcspk_register)
diff --git a/hw/audio/sb16.c b/hw/audio/sb16.c
index 61583bc..6ddc0ac 100644
--- a/hw/audio/sb16.c
+++ b/hw/audio/sb16.c
@@ -1386,7 +1386,7 @@
     return 0;
 }
 
-int SB16_init (ISABus *bus)
+static int SB16_init (ISABus *bus)
 {
     isa_create_simple (bus, TYPE_SB16);
     return 0;
@@ -1421,6 +1421,7 @@
 static void sb16_register_types (void)
 {
     type_register_static (&sb16_info);
+    isa_register_soundhw("sb16", "Creative Sound Blaster 16", SB16_init);
 }
 
 type_init (sb16_register_types)