Skip to content

Commit f89d783

Browse files
Amadeusz Sławińskibroonie
authored andcommitted
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: 1affc44 ("ASoC: Intel: avs: PCI driver implementation") Reported-by: Kornel Dulęba <[email protected]> Signed-off-by: Amadeusz Sławiński <[email protected]> Reviewed-by: Cezary Rojewski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 64e57b2 commit f89d783

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

sound/soc/intel/avs/core.c

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,29 @@ static int avs_pci_probe(struct pci_dev *pci, const struct pci_device_id *id)
481481
return ret;
482482
}
483483

484+
static void avs_pci_shutdown(struct pci_dev *pci)
485+
{
486+
struct hdac_bus *bus = pci_get_drvdata(pci);
487+
struct avs_dev *adev = hdac_to_avs(bus);
488+
489+
cancel_work_sync(&adev->probe_work);
490+
avs_ipc_block(adev->ipc);
491+
492+
snd_hdac_stop_streams(bus);
493+
avs_dsp_op(adev, int_control, false);
494+
snd_hdac_ext_bus_ppcap_int_enable(bus, false);
495+
snd_hdac_ext_bus_link_power_down_all(bus);
496+
497+
snd_hdac_bus_stop_chip(bus);
498+
snd_hdac_display_power(bus, HDA_CODEC_IDX_CONTROLLER, false);
499+
500+
if (avs_platattr_test(adev, CLDMA))
501+
pci_free_irq(pci, 0, &code_loader);
502+
pci_free_irq(pci, 0, adev);
503+
pci_free_irq(pci, 0, bus);
504+
pci_free_irq_vectors(pci);
505+
}
506+
484507
static void avs_pci_remove(struct pci_dev *pci)
485508
{
486509
struct hdac_device *hdev, *save;
@@ -739,6 +762,7 @@ static struct pci_driver avs_pci_driver = {
739762
.id_table = avs_ids,
740763
.probe = avs_pci_probe,
741764
.remove = avs_pci_remove,
765+
.shutdown = avs_pci_shutdown,
742766
.driver = {
743767
.pm = &avs_dev_pm,
744768
},

0 commit comments

Comments
 (0)