|
|
9ae3a8 |
From 22f1816abcb97b9df9f0c7b896202a4c3c5d89ec Mon Sep 17 00:00:00 2001
|
|
|
9ae3a8 |
From: Gerd Hoffmann <kraxel@redhat.com>
|
|
|
9ae3a8 |
Date: Mon, 3 Feb 2014 14:18:24 -0500
|
|
|
9ae3a8 |
Subject: [PATCH 4/6] hda-codec: disable streams on reset
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Message-id: <1391437104-22283-2-git-send-email-kraxel@redhat.com>
|
|
|
9ae3a8 |
Patchwork-id: 57073
|
|
|
9ae3a8 |
O-Subject: [RHEL-7 qemu-kvm PATCH 1/1] hda-codec: disable streams on reset
|
|
|
9ae3a8 |
Bugzilla: 947812
|
|
|
9ae3a8 |
RH-Acked-by: Markus Armbruster <armbru@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Bandan Das <bsd@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
|
|
|
9ae3a8 |
(cherry picked from commit 39e6a38cdd4b235b2918b4977f31fde2c0da3bc4)
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
hw/audio/hda-codec.c | 18 ++++++++++++++++++
|
|
|
9ae3a8 |
1 file changed, 18 insertions(+)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
hw/audio/hda-codec.c | 18 ++++++++++++++++++
|
|
|
9ae3a8 |
1 file changed, 18 insertions(+)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
diff --git a/hw/audio/hda-codec.c b/hw/audio/hda-codec.c
|
|
|
9ae3a8 |
index 07a43bf..986f2a9 100644
|
|
|
9ae3a8 |
--- a/hw/audio/hda-codec.c
|
|
|
9ae3a8 |
+++ b/hw/audio/hda-codec.c
|
|
|
9ae3a8 |
@@ -559,6 +559,21 @@ static int hda_audio_post_load(void *opaque, int version)
|
|
|
9ae3a8 |
return 0;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
+static void hda_audio_reset(DeviceState *dev)
|
|
|
9ae3a8 |
+{
|
|
|
9ae3a8 |
+ HDAAudioState *a = DO_UPCAST(HDAAudioState, hda.qdev, dev);
|
|
|
9ae3a8 |
+ HDAAudioStream *st;
|
|
|
9ae3a8 |
+ int i;
|
|
|
9ae3a8 |
+
|
|
|
9ae3a8 |
+ dprint(a, 1, "%s\n", __func__);
|
|
|
9ae3a8 |
+ for (i = 0; i < ARRAY_SIZE(a->st); i++) {
|
|
|
9ae3a8 |
+ st = a->st + i;
|
|
|
9ae3a8 |
+ if (st->node != NULL) {
|
|
|
9ae3a8 |
+ hda_audio_set_running(st, false);
|
|
|
9ae3a8 |
+ }
|
|
|
9ae3a8 |
+ }
|
|
|
9ae3a8 |
+}
|
|
|
9ae3a8 |
+
|
|
|
9ae3a8 |
static const VMStateDescription vmstate_hda_audio_stream = {
|
|
|
9ae3a8 |
.name = "hda-audio-stream",
|
|
|
9ae3a8 |
.version_id = 1,
|
|
|
9ae3a8 |
@@ -640,6 +655,7 @@ static void hda_audio_output_class_init(ObjectClass *klass, void *data)
|
|
|
9ae3a8 |
k->stream = hda_audio_stream;
|
|
|
9ae3a8 |
set_bit(DEVICE_CATEGORY_SOUND, dc->categories);
|
|
|
9ae3a8 |
dc->desc = "HDA Audio Codec, output-only (line-out)";
|
|
|
9ae3a8 |
+ dc->reset = hda_audio_reset;
|
|
|
9ae3a8 |
dc->vmsd = &vmstate_hda_audio;
|
|
|
9ae3a8 |
dc->props = hda_audio_properties;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
@@ -662,6 +678,7 @@ static void hda_audio_duplex_class_init(ObjectClass *klass, void *data)
|
|
|
9ae3a8 |
k->stream = hda_audio_stream;
|
|
|
9ae3a8 |
set_bit(DEVICE_CATEGORY_SOUND, dc->categories);
|
|
|
9ae3a8 |
dc->desc = "HDA Audio Codec, duplex (line-out, line-in)";
|
|
|
9ae3a8 |
+ dc->reset = hda_audio_reset;
|
|
|
9ae3a8 |
dc->vmsd = &vmstate_hda_audio;
|
|
|
9ae3a8 |
dc->props = hda_audio_properties;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
@@ -684,6 +701,7 @@ static void hda_audio_micro_class_init(ObjectClass *klass, void *data)
|
|
|
9ae3a8 |
k->stream = hda_audio_stream;
|
|
|
9ae3a8 |
set_bit(DEVICE_CATEGORY_SOUND, dc->categories);
|
|
|
9ae3a8 |
dc->desc = "HDA Audio Codec, duplex (speaker, microphone)";
|
|
|
9ae3a8 |
+ dc->reset = hda_audio_reset;
|
|
|
9ae3a8 |
dc->vmsd = &vmstate_hda_audio;
|
|
|
9ae3a8 |
dc->props = hda_audio_properties;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
--
|
|
|
9ae3a8 |
1.8.3.1
|
|
|
9ae3a8 |
|