hw/audio: drop audio_model.isa

That's no longer necessary, the code is bus-agnostic.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
This commit is contained in:
Marc-André Lureau 2025-10-27 17:44:10 +04:00
parent b181226e4e
commit 5fb347dea0
9 changed files with 9 additions and 15 deletions

View file

@ -1362,7 +1362,7 @@ static const TypeInfo ac97_info = {
static void ac97_register_types(void)
{
type_register_static(&ac97_info);
audio_register_model("ac97", "Intel 82801AA AC97 Audio", 0, TYPE_AC97);
audio_register_model("ac97", "Intel 82801AA AC97 Audio", TYPE_AC97);
}
type_init(ac97_register_types)

View file

@ -323,7 +323,7 @@ static const TypeInfo adlib_info = {
static void adlib_register_types (void)
{
type_register_static (&adlib_info);
audio_register_model("adlib", ADLIB_DESC, 1, TYPE_ADLIB);
audio_register_model("adlib", ADLIB_DESC, TYPE_ADLIB);
}
type_init (adlib_register_types)

View file

@ -723,7 +723,7 @@ static const TypeInfo cs4231a_info = {
static void cs4231a_register_types (void)
{
type_register_static (&cs4231a_info);
audio_register_model("cs4231a", "CS4231A", 1, TYPE_CS4231A);
audio_register_model("cs4231a", "CS4231A", TYPE_CS4231A);
}
type_init (cs4231a_register_types)

View file

@ -905,7 +905,7 @@ static const TypeInfo es1370_info = {
static void es1370_register_types (void)
{
type_register_static (&es1370_info);
audio_register_model("es1370", "ENSONIQ AudioPCI ES1370", 0, TYPE_ES1370);
audio_register_model("es1370", "ENSONIQ AudioPCI ES1370", TYPE_ES1370);
}
type_init (es1370_register_types)

View file

@ -320,7 +320,7 @@ static const TypeInfo gus_info = {
static void gus_register_types (void)
{
type_register_static (&gus_info);
audio_register_model("gus", "Gravis Ultrasound GF1", 1, TYPE_GUS);
audio_register_model("gus", "Gravis Ultrasound GF1", TYPE_GUS);
}
type_init (gus_register_types)

View file

@ -26,16 +26,13 @@
#include "monitor/qdev.h"
#include "qemu/error-report.h"
#include "qapi/error.h"
#include "qom/object.h"
#include "hw/qdev-properties.h"
#include "hw/isa/isa.h"
#include "hw/audio/model.h"
struct audio_model {
const char *name;
const char *descr;
const char *typename;
int isa;
void (*init)(const char *audiodev);
};
@ -48,18 +45,16 @@ void audio_register_model_with_cb(const char *name, const char *descr,
assert(audio_models_count < ARRAY_SIZE(audio_models) - 1);
audio_models[audio_models_count].name = name;
audio_models[audio_models_count].descr = descr;
audio_models[audio_models_count].isa = 0;
audio_models[audio_models_count].init = init_audio_model;
audio_models_count++;
}
void audio_register_model(const char *name, const char *descr,
int isa, const char *typename)
const char *typename)
{
assert(audio_models_count < ARRAY_SIZE(audio_models) - 1);
audio_models[audio_models_count].name = name;
audio_models[audio_models_count].descr = descr;
audio_models[audio_models_count].isa = isa;
audio_models[audio_models_count].typename = typename;
audio_models_count++;
}
@ -120,7 +115,6 @@ void audio_model_init(void)
qdev_prop_set_string(dev, "audiodev", audiodev_id);
qdev_realize_and_unref(dev, bus, &error_fatal);
} else {
assert(!c->isa);
c->init(audiodev_id);
}
}

View file

@ -1470,7 +1470,7 @@ static const TypeInfo sb16_info = {
static void sb16_register_types (void)
{
type_register_static (&sb16_info);
audio_register_model("sb16", "Creative Sound Blaster 16", 1, TYPE_SB16);
audio_register_model("sb16", "Creative Sound Blaster 16", TYPE_SB16);
}
type_init (sb16_register_types)

View file

@ -74,7 +74,7 @@ static const VirtioPCIDeviceTypeInfo virtio_snd_pci_info = {
static void virtio_snd_pci_register(void)
{
virtio_pci_types_register(&virtio_snd_pci_info);
audio_register_model("virtio", "Virtio Sound", 0, TYPE_VIRTIO_SND_PCI);
audio_register_model("virtio", "Virtio Sound", TYPE_VIRTIO_SND_PCI);
}
type_init(virtio_snd_pci_register);

View file

@ -5,7 +5,7 @@
void audio_register_model_with_cb(const char *name, const char *descr,
void (*init_audio_model)(const char *audiodev));
void audio_register_model(const char *name, const char *descr,
int isa, const char *typename);
const char *typename);
void audio_model_init(void);
void audio_print_available_models(void);