hw/audio/intel-hda: don't reset codecs twice
commit3e95ef49e6196654d2ca83baa28a594f4d136223
authorPeter Maydell <peter.maydell@linaro.org>
Fri, 14 Oct 2022 14:26:31 +0000 (14 15:26 +0100)
committerGerd Hoffmann <kraxel@redhat.com>
Wed, 23 Nov 2022 11:30:45 +0000 (23 12:30 +0100)
tree5d3f30fe1643623d35b9d8f8389af6b17861d0ff
parent1dfb7a175f55039c0641cab9def130ca9e844da9
hw/audio/intel-hda: don't reset codecs twice

Currently the intel-hda device has a reset method which manually
resets all the codecs by calling device_legacy_reset() on them.  This
means they get reset twice, once because child devices on a qbus get
reset before the parent device's reset method is called, and then
again because we're manually resetting them.

Drop the manual reset call, and ensure that codecs are still reset
when the guest does a reset via ICH6_GCTL_RESET by using
device_cold_reset() (which resets all the devices on the qbus as well
as the device itself) instead of a direct call to the reset function.

This is a slight ordering change because the (only) codec reset now
happens before the controller registers etc are reset, rather than
once before and then once after, but the codec reset function
hda_audio_reset() doesn't care.

This lets us drop a use of device_legacy_reset(), which is
deprecated.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20221014142632.2092404-2-peter.maydell@linaro.org>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
hw/audio/intel-hda.c