Commit f89d783d authored by Amadeusz Sławiński's avatar Amadeusz Sławiński Committed by Mark Brown

ASoC: Intel: avs: Implement PCI shutdown

On shutdown reference to i915 driver needs to be released to not spam
logs with unnecessary warnings. While at it do some additional cleanup
to make sure DSP is powered down and interrupts from device are
disabled.

Fixes: 1affc44e ("ASoC: Intel: avs: PCI driver implementation")
Reported-by: default avatarKornel Dulęba <korneld@google.com>
Signed-off-by: default avatarAmadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Reviewed-by: default avatarCezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20230113190310.1451693-2-amadeuszx.slawinski@linux.intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 64e57b21
...@@ -481,6 +481,29 @@ static int avs_pci_probe(struct pci_dev *pci, const struct pci_device_id *id) ...@@ -481,6 +481,29 @@ static int avs_pci_probe(struct pci_dev *pci, const struct pci_device_id *id)
return ret; return ret;
} }
static void avs_pci_shutdown(struct pci_dev *pci)
{
struct hdac_bus *bus = pci_get_drvdata(pci);
struct avs_dev *adev = hdac_to_avs(bus);
cancel_work_sync(&adev->probe_work);
avs_ipc_block(adev->ipc);
snd_hdac_stop_streams(bus);
avs_dsp_op(adev, int_control, false);
snd_hdac_ext_bus_ppcap_int_enable(bus, false);
snd_hdac_ext_bus_link_power_down_all(bus);
snd_hdac_bus_stop_chip(bus);
snd_hdac_display_power(bus, HDA_CODEC_IDX_CONTROLLER, false);
if (avs_platattr_test(adev, CLDMA))
pci_free_irq(pci, 0, &code_loader);
pci_free_irq(pci, 0, adev);
pci_free_irq(pci, 0, bus);
pci_free_irq_vectors(pci);
}
static void avs_pci_remove(struct pci_dev *pci) static void avs_pci_remove(struct pci_dev *pci)
{ {
struct hdac_device *hdev, *save; struct hdac_device *hdev, *save;
...@@ -739,6 +762,7 @@ static struct pci_driver avs_pci_driver = { ...@@ -739,6 +762,7 @@ static struct pci_driver avs_pci_driver = {
.id_table = avs_ids, .id_table = avs_ids,
.probe = avs_pci_probe, .probe = avs_pci_probe,
.remove = avs_pci_remove, .remove = avs_pci_remove,
.shutdown = avs_pci_shutdown,
.driver = { .driver = {
.pm = &avs_dev_pm, .pm = &avs_dev_pm,
}, },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment