hda-codec: disable streams on reset

-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABAgAGBQJS3kkoAAoJEEy22O7T6HE4WJ4QAJYlYsrVThAi9bnpFB7qLve+
 uP8MWwK+Wxc+O2CrN38BOoIyb273xk+U6Vj1FEfh9C1rN2dcZ4fBsUZfqqGEOYpM
 LNgFWzTUwIXDHnxVVc8Dyp+DyPbRd4CE+ii/ukY7Xq1QiHJmcdxweMPQnIZQl9UZ
 4wTWWubK1u/We+J87udQPfE3ZT2+5ndcbKM2FcCW3j8yBLvZav6/DNL6alr5eJ2L
 WGB8mOyCNu5hjaOWP1mya8cRHO6Z5IbFXqKNGU2m78C9WBO3LaZY7IL+s6mPvTzq
 0SaOk/XfK4XCwpgbvfFQ8lnJ5tdx4dagjGpwZOHPE2+Sy1l/XZztqr+caju/maqF
 PnRrosGUvYnVvPxPJKpN02mbohBizGUwL0nbal5Knx+2quQ+5sHnTJb3a3nonfuC
 /pfqvOD4thb3L7994RKu2bKfTq6TK0/n64JanmXADmEKebb3bb5AijFTModcMd8z
 uW4NejmpqsNYKXWUQ3WUktZWCEaNE7CbxTuxgr7DTSY0b2gl82cLiDS0ZAiJ4zGd
 ddwsvkEadIXHWbsdMMM3kCQQvlO/gVNYB7xozUPqOJdghlTSQAtkMi8ReR+Hxqq+
 PVS7dM276sPjRdqqaJSdk3JiE10NzUSKyBiJZtCZ5dqqIuHPlaHMgx77MzBwlVNK
 PkkqSNr9UpmwHu8WVGhC
 =yVv9
 -----END PGP SIGNATURE-----

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>
This commit is contained in:
Anthony Liguori 2014-01-24 15:51:38 -08:00
commit 14ac4febb2

View File

@ -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;
}