aboutsummaryrefslogtreecommitdiff
path: root/hw/hda-audio.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2011-12-16 13:39:51 -0600
committerAnthony Liguori <aliguori@us.ibm.com>2012-01-27 10:50:48 -0600
commitdbaa790451c1962f7e639f4d6f98be6efdea26ce (patch)
tree6538d0f5280d64cd5911a2a6a52c618e25b9cabb /hw/hda-audio.c
parentb5ea932781954355a9880e2744722cd05cc496f9 (diff)
hda-codec: convert to QEMU Object Model
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/hda-audio.c')
-rw-r--r--hw/hda-audio.c58
1 files changed, 36 insertions, 22 deletions
diff --git a/hw/hda-audio.c b/hw/hda-audio.c
index 8053c74d9c..2b3ce2f504 100644
--- a/hw/hda-audio.c
+++ b/hw/hda-audio.c
@@ -906,33 +906,47 @@ static int hda_audio_init_duplex(HDACodecDevice *hda)
return hda_audio_init(hda, &duplex);
}
-static HDACodecDeviceInfo hda_audio_info_output = {
- .qdev.name = "hda-output",
- .qdev.desc = "HDA Audio Codec, output-only",
- .qdev.size = sizeof(HDAAudioState),
- .qdev.vmsd = &vmstate_hda_audio,
- .qdev.props = hda_audio_properties,
- .init = hda_audio_init_output,
- .exit = hda_audio_exit,
- .command = hda_audio_command,
- .stream = hda_audio_stream,
+static void hda_audio_output_class_init(ObjectClass *klass, void *data)
+{
+ HDACodecDeviceClass *k = HDA_CODEC_DEVICE_CLASS(klass);
+
+ k->init = hda_audio_init_output;
+ k->exit = hda_audio_exit;
+ k->command = hda_audio_command;
+ k->stream = hda_audio_stream;
+}
+
+static DeviceInfo hda_audio_output_info = {
+ .name = "hda-output",
+ .desc = "HDA Audio Codec, output-only",
+ .size = sizeof(HDAAudioState),
+ .vmsd = &vmstate_hda_audio,
+ .props = hda_audio_properties,
+ .class_init = hda_audio_output_class_init,
};
-static HDACodecDeviceInfo hda_audio_info_duplex = {
- .qdev.name = "hda-duplex",
- .qdev.desc = "HDA Audio Codec, duplex",
- .qdev.size = sizeof(HDAAudioState),
- .qdev.vmsd = &vmstate_hda_audio,
- .qdev.props = hda_audio_properties,
- .init = hda_audio_init_duplex,
- .exit = hda_audio_exit,
- .command = hda_audio_command,
- .stream = hda_audio_stream,
+static void hda_audio_duplex_class_init(ObjectClass *klass, void *data)
+{
+ HDACodecDeviceClass *k = HDA_CODEC_DEVICE_CLASS(klass);
+
+ k->init = hda_audio_init_duplex;
+ k->exit = hda_audio_exit;
+ k->command = hda_audio_command;
+ k->stream = hda_audio_stream;
+}
+
+static DeviceInfo hda_audio_duplex_info = {
+ .name = "hda-duplex",
+ .desc = "HDA Audio Codec, duplex",
+ .size = sizeof(HDAAudioState),
+ .vmsd = &vmstate_hda_audio,
+ .props = hda_audio_properties,
+ .class_init = hda_audio_duplex_class_init,
};
static void hda_audio_register(void)
{
- hda_codec_register(&hda_audio_info_output);
- hda_codec_register(&hda_audio_info_duplex);
+ hda_codec_register(&hda_audio_output_info);
+ hda_codec_register(&hda_audio_duplex_info);
}
device_init(hda_audio_register);