diff options
author | Anthony Liguori <aliguori@amazon.com> | 2014-01-24 15:51:38 -0800 |
---|---|---|
committer | Anthony Liguori <aliguori@amazon.com> | 2014-01-24 15:51:39 -0800 |
commit | 14ac4febb22b4083a5a64b251ab15c94d7d65833 (patch) | |
tree | e8e975326bded7dd61f40ba42a9125a6962eb13b /hw | |
parent | f4b27793a8b948178ced486d1d32d1919bea81b2 (diff) | |
parent | 39e6a38cdd4b235b2918b4977f31fde2c0da3bc4 (diff) | |
download | qemu-14ac4febb22b4083a5a64b251ab15c94d7d65833.tar.gz qemu-14ac4febb22b4083a5a64b251ab15c94d7d65833.tar.bz2 qemu-14ac4febb22b4083a5a64b251ab15c94d7d65833.zip |
Merge remote-tracking branch 'kraxel/tags/pull-audio-2' into staging
hda-codec: disable streams on reset
# gpg: Signature made Tue 21 Jan 2014 02:17:12 AM PST using RSA key ID D3E87138
# gpg: Can't check signature: public key not found
* kraxel/tags/pull-audio-2:
hda-codec: disable streams on reset
Message-id: 1390299589-5082-1-git-send-email-kraxel@redhat.com
Signed-off-by: Anthony Liguori <aliguori@amazon.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/audio/hda-codec.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/hw/audio/hda-codec.c b/hw/audio/hda-codec.c index 07a43bfe89..986f2a9c92 100644 --- a/hw/audio/hda-codec.c +++ b/hw/audio/hda-codec.c @@ -559,6 +559,21 @@ static int hda_audio_post_load(void *opaque, int version) return 0; } +static void hda_audio_reset(DeviceState *dev) +{ + HDAAudioState *a = DO_UPCAST(HDAAudioState, hda.qdev, dev); + HDAAudioStream *st; + int i; + + dprint(a, 1, "%s\n", __func__); + for (i = 0; i < ARRAY_SIZE(a->st); i++) { + st = a->st + i; + if (st->node != NULL) { + hda_audio_set_running(st, false); + } + } +} + static const VMStateDescription vmstate_hda_audio_stream = { .name = "hda-audio-stream", .version_id = 1, @@ -640,6 +655,7 @@ static void hda_audio_output_class_init(ObjectClass *klass, void *data) k->stream = hda_audio_stream; set_bit(DEVICE_CATEGORY_SOUND, dc->categories); dc->desc = "HDA Audio Codec, output-only (line-out)"; + dc->reset = hda_audio_reset; dc->vmsd = &vmstate_hda_audio; dc->props = hda_audio_properties; } @@ -662,6 +678,7 @@ static void hda_audio_duplex_class_init(ObjectClass *klass, void *data) k->stream = hda_audio_stream; set_bit(DEVICE_CATEGORY_SOUND, dc->categories); dc->desc = "HDA Audio Codec, duplex (line-out, line-in)"; + dc->reset = hda_audio_reset; dc->vmsd = &vmstate_hda_audio; dc->props = hda_audio_properties; } @@ -684,6 +701,7 @@ static void hda_audio_micro_class_init(ObjectClass *klass, void *data) k->stream = hda_audio_stream; set_bit(DEVICE_CATEGORY_SOUND, dc->categories); dc->desc = "HDA Audio Codec, duplex (speaker, microphone)"; + dc->reset = hda_audio_reset; dc->vmsd = &vmstate_hda_audio; dc->props = hda_audio_properties; } |