summaryrefslogtreecommitdiffstats
path: root/sound/soc/intel/avs/core.c
Commit message (Collapse)AuthorAgeFilesLines
* ASoC: Intel: avs: Convert to PCI device IDs definesAmadeusz Sławiński2023-07-181-8/+8
| | | | | | | | | | | | Use PCI device IDs from pci_ids.h header and while at it change to using PCI_DEVICE_DATA() macro, to simplify declarations. Acked-by: Mark Brown <broonie@kernel.org> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com> Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Link: https://lore.kernel.org/r/20230717114511.484999-12-amadeuszx.slawinski@linux.intel.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ASoC: Intel: avs: Implement PCI shutdownAmadeusz Sławiński2023-01-131-0/+24
| | | | | | | | | | | | | | 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: 1affc44ea5dd ("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>
* ASoC: Intel: avs: Probing and firmware tracing over debugfsCezary Rojewski2022-12-051-0/+2
| | | | | | | | | | | | | | | | Define debugfs subdirectory delegated for IPC communication with DSP. Input format: uint,uint,(...) which are later translated into DWORDS sequence and further into instances of struct of interest given the IPC type. For Extractor probes, following have been enabled: - PROBE_POINT_ADD (echo <..> probe_points) - PROBE_POINT_REMOVE (echo <..> probe_points_remove) - PROBE_POINT_INFO (cat probe_points) Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20221202152841.672536-14-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: Intel: avs: Power and clock gating policy overridingCezary Rojewski2022-10-281-9/+13
| | | | | | | | | | | | | | Provide pgctl/cgctl_mask module parameters for overriding power and clock gating policies respectively. These help deal with rare firmware loading failures on some configurations. There're no golden masks that cover all known problems so leave the defaults as is. While at it, update avs_hda_l1sen_enable()'s definition so it aligns with its power/clock friends. Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20221027124702.1761002-9-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: Intel: avs: Standby power-state supportPiotr Maziarz2022-10-281-7/+68
| | | | | | | | | | | | | | | Introduce avs_suspend_standby() and avs_resume_standby() to support S0IX streaming. The AudioDSP is not shutdown during such scenario and the PCI device is armed for possible wake operation through an audio event. As capability for a stream to be active during low power S0 is based off of ->ignore_suspend, adjust the field's value according to platform capabilities if needed. Signed-off-by: Piotr Maziarz <piotrx.maziarz@linux.intel.com> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20221027124702.1761002-8-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: Merge HDA/ext cleanupMark Brown2022-10-211-1/+1
|\ | | | | | | | | | | Merge branch 'topic/hda-ext-cleanup' of https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound into asoc-6.2 for further AVS work.
| * ALSA/ASoC: hda: ext: add 'ext' prefix to snd_hdac_link_free_allPierre-Louis Bossart2022-10-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | No functionality change, just prefix addition to clearly identify that the helper only applies to the 'ext' part for Intel platforms. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Link: https://lore.kernel.org/r/20221019162115.185917-6-pierre-louis.bossart@linux.intel.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ASoC: Intel: avs: simplify S3 resume flowsPierre-Louis Bossart2022-10-181-11/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The same code was directly copied from the skylake driver where it was already questionable. Remove and simplify the flow. Tested-by: Cezary Rojewski <cezary.rojewski@intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20221017204946.207986-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: Intel: avs: Add missing SKL-based device IDsCezary Rojewski2022-10-171-0/+4
| | | | | | | | | | | | | | | | | | Enable additional SKL-based configurations by filling device ID table with new entries. Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20221010121955.718168-8-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: Intel: avs: Fix DMA mask assignmentCezary Rojewski2022-10-171-1/+1
|/ | | | | | | | | Spelling error leads to incorrect behavior when setting up DMA mask. Fixes: a5bbbde2b81e ("ASoC: Intel: avs: Use helper function to set up DMA") Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20221010121955.718168-2-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ALSA: hda: Use hdac_ext prefix in snd_hdac_stream_free_all() for clarityPierre-Louis Bossart2022-09-201-2/+2
| | | | | | | | | | | | | | Make sure there's no ambiguity on layering with the appropriate prefix added. Pure rename, no functionality changed. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20220919121041.43463-5-pierre-louis.bossart@linux.intel.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ASoC: Intel: avs: Use helper function to set up DMAAmadeusz Sławiński2022-07-081-6/+2
| | | | | | | | | | | dma_set_mask() and dma_set_coherent_mask() can be performed with one call to dma_set_mask_and_coherent(), which slightly reduces amount of code on our side. Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20220707124153.1858249-9-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: Intel: avs: Set max DMA segment sizeAmadeusz Sławiński2022-07-081-0/+1
| | | | | | | | | | | | | | Apparently it is possible for code to allocate large buffers which may cause warnings as reported in [1]. This was fixed for HDA, SOF and skylake in patchset [2], fix it also for avs driver. [1] https://github.com/thesofproject/linux/issues/3430 [2] https://lore.kernel.org/all/20220215132756.31236-1-tiwai@suse.de/ Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20220707124153.1858249-8-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: Intel: avs: Block IPC channel on suspendCezary Rojewski2022-07-081-0/+1
| | | | | | | | | | | | To allow for driver's filesystem interfaces e.g.: debugfs, to be touched even when the device is asleep, mark IPC-channel as blocked when the device is suspended. This causes any invocation of said interfaces that do not toggle PM themselves to gracefully fail with "Operation not permitted" message. Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20220707124153.1858249-7-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: Intel: avs: Register HDAudio ext-bus operationsCezary Rojewski2022-07-081-1/+2
| | | | | | | | | With ASoC representation of HDAudio codec added, update bus initiazation to complete it. Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20220707124153.1858249-2-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: Intel: avs: APL-based platforms supportCezary Rojewski2022-05-171-0/+18
| | | | | | | | | | | | | | | Define handlers specific to cAVS 1.5+ platforms, that is, APL and similar platforms. These differ from SKL-alike ones in terms of AudioDSP firmware generation and thus the '+' suffix. Introduciton of IMR, removal of CLDMA, D0IX support and monolithic-ation of library/module code are most impactful but are not the only changes brought with this newer generation. Some generic and 1.5 operations are being re-used to reduce code size. Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20220516101116.190192-16-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: Intel: avs: SKL-based platforms supportCezary Rojewski2022-05-171-0/+18
| | | | | | | | | | | | | Define handlers specific to cAVS 1.5 platforms, that is SKL, KBL, AML and all other variants based on this very version of AudioDSP architecture. Most are specific to SKL-alike platforms with only skl_log_buffer_offset() being exposed and used later by younger equivalents. Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20220516101116.190192-15-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: Intel: avs: Power managementCezary Rojewski2022-05-171-0/+101
| | | | | | | | | | | To preserve power during sleep operations, handle suspend (S3), hibernation (S4) and runtime (RTD3) transitions. As flow for all of is shared, define common handlers to reduce code size. Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20220516101116.190192-14-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: Intel: avs: PCI driver implementationCezary Rojewski2022-05-171-0/+494
| | | | | | | | | | | | HD-Audio bus is a PCI device. Add all functions necessary to probe such device along with its removal sequence. Behaviour implemented for all standard operations is similar to existing solutions: sound/pci/hda and sound/soc/intel/skylake. Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20220516101116.190192-13-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: Intel: avs: General code loading flowCezary Rojewski2022-03-111-0/+61
Code loading is a complex procedure and requires combined effort of DMA and IPCs. With IPCs already in place, lay out ground for specific DMA transfer operations. Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20220311153544.136854-15-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>