mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-01-13 07:02:55 -05:00
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: 1affc44ea5 ("ASoC: Intel: avs: PCI driver implementation")
Reported-by: Kornel Dulęba <korneld@google.com>
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20230113190310.1451693-2-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
committed by
Mark Brown
parent
64e57b2195
commit
f89d783d68
@@ -481,6 +481,29 @@ static int avs_pci_probe(struct pci_dev *pci, const struct pci_device_id *id)
|
||||
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)
|
||||
{
|
||||
struct hdac_device *hdev, *save;
|
||||
@@ -739,6 +762,7 @@ static struct pci_driver avs_pci_driver = {
|
||||
.id_table = avs_ids,
|
||||
.probe = avs_pci_probe,
|
||||
.remove = avs_pci_remove,
|
||||
.shutdown = avs_pci_shutdown,
|
||||
.driver = {
|
||||
.pm = &avs_dev_pm,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user