History log of /linux-master/sound/soc/intel/avs/core.c
Revision Date Author Comments
# b9f706f9 26-Feb-2024 Cezary Rojewski <cezary.rojewski@intel.com>

ASoC: Intel: avs: Ignore codecs with no suppoting driver

HDMI codecs which are present and functional from audio perspective lack
i915 support on drm side what results in -ENODEV during the probing
sequence. There is no reason to perform recovery procedure e.g.: reset
the HDAudio controller if this is the case.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Acked-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20240226124432.1203798-4-cezary.rojewski@intel.com


# 5acb19ec 19-Feb-2024 Cezary Rojewski <cezary.rojewski@intel.com>

ASoC: Intel: avs: TGL-based platforms support

Define handlers specific to cAVS 2.5 platforms, that is TGL, ADL, RPL
and all other variants based on this very version of AudioDSP
architecture. Most operations are inherited from their predecessors with
the major difference being AudioDSP cores management - firmware handlers
that on its own so there is no need to interfere.

Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://msgid.link/r/20240220115035.770402-9-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 275b583d 19-Feb-2024 Cezary Rojewski <cezary.rojewski@intel.com>

ASoC: Intel: avs: ICL-based platforms support

Define handlers specific to cAVS 2.0 platforms, that is ICL, JSL and all
other variants based on this very version of AudioDSP architecture. Most
operations are inherited from their predecessors with the major
difference being firmware-logging functionality - IPC request as well as
debug memory windows layout have changed.

Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://msgid.link/r/20240220115035.770402-8-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 8a6502ad 19-Feb-2024 Cezary Rojewski <cezary.rojewski@intel.com>

ASoC: Intel: avs: CNL-based platforms support

Define handlers specific to cAVS 1.8 platforms, that is CNL, CFL, CML
and all other variants based on this very version of AudioDSP
architecture. Most operations are inherited from their predecessors.

Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://msgid.link/r/20240220115035.770402-7-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 97bd565f 19-Feb-2024 Cezary Rojewski <cezary.rojewski@intel.com>

ASoC: Intel: avs: Abstract IRQ handling

Servicing IPCs on CNL platforms and onward differs from the existing
one. To make room for these, relocate SKL-based platforms specific code
into the skl.c file leaving only the genering irq_handler in the common
code.

Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://msgid.link/r/20240220115035.770402-6-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 7576e2f4 19-Feb-2024 Cezary Rojewski <cezary.rojewski@intel.com>

ASoC: Intel: avs: Abstract IPC handling

Servicing IPCs on CNL platforms and onward differs from the existing
one. To make room for these, enrich platform descriptor with fields
representing crucial IPC registers and utilize them throughout the code.

While cleaning up device descriptors, reduce the number of code lines by
assigning 'min_fw_version' within a single line.

Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://msgid.link/r/20240220115035.770402-5-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# a8f858d9 19-Feb-2024 Cezary Rojewski <cezary.rojewski@intel.com>

ASoC: Intel: avs: Prefix SKL/APL-specific members

Prefix members that are platform-specific with 'avs_' to improve code
cohesiveness and reduce the chance for naming-conflics with other
drivers.

Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://msgid.link/r/20240220115035.770402-4-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 1b72943a 19-Feb-2024 Cezary Rojewski <cezary.rojewski@intel.com>

ASoC: Intel: avs: L1SEN reference counted

Code loading is not the only procedure that manipulates L1SEN. Update
existing mechanism so the stream starting procedure can interfere with
L1SEN without causing any trouble to its other users.

Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://msgid.link/r/20240220115035.770402-2-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# f7fc624b 09-Feb-2024 Cezary Rojewski <cezary.rojewski@intel.com>

ASoC: Intel: avs: Expose FW version with sysfs

Add functionality to read version of loaded FW from sysfs.

Signed-off-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/20240209085256.121261-1-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# b5fbde22 01-Feb-2024 Cezary Rojewski <cezary.rojewski@intel.com>

ASoC: Intel: avs: Fix pci_probe() error path

Recent changes modified operation-order in the probe() function without
updating its error path accordingly. If snd_hdac_i915_init() exists with
status EPROBE_DEFER the error path must cleanup allocated IRQs before
leaving the scope.

Fixes: 2dddc514b6e4 ("ASoC: Intel: avs: Move snd_hdac_i915_init to before probe_work.")
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20240202114901.1002127-1-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# e6d0c13e 09-Oct-2023 Maarten Lankhorst <maarten.lankhorst@linux.intel.com>

ALSA: hda: i915: Remove extra argument from snd_hdac_i915_init

Now that all drivers have moved from modprobe loading to
handling -EPROBE_DEFER, we can remove the argument again.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20231009115437.99976-14-maarten.lankhorst@linux.intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 2dddc514 09-Oct-2023 Maarten Lankhorst <maarten.lankhorst@linux.intel.com>

ASoC: Intel: avs: Move snd_hdac_i915_init to before probe_work.

Now that we can use -EPROBE_DEFER, it's no longer required to spin off
the snd_hdac_i915_init into a workqueue. It's likely the whole workqueue
can be destroyed, but I don't have the means to test this.

Removing the workqueue would simplify init even further, but is left
as exercise for the reviewer.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Acked-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://lore.kernel.org/r/20231009115437.99976-10-maarten.lankhorst@linux.intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 32f4e921 09-Oct-2023 Maarten Lankhorst <maarten.lankhorst@linux.intel.com>

ALSA: hda: i915: Add an allow_modprobe argument to snd_hdac_i915_init

Xe is a new GPU driver that re-uses the display (and sound) code from
i915. It's no longer possible to load i915, as the GPU can be driven
by the xe driver instead.

The new behavior will return -EPROBE_DEFER, and wait for a compatible
driver to be loaded instead of modprobing i915.

Converting all drivers at the same time is a lot of work, instead we
will convert each user one by one.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20231009115437.99976-8-maarten.lankhorst@linux.intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 28a21cb2 29-Sep-2023 Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>

ASoC: Intel: avs: Preallocate memory for module configuration

In order to instantiate modules on the firmware side, the driver sends
payload with module configuration. In some case size of this information
is not known before hand, so driver allocates temporary memory during
module creation and frees it after use. Optimize the flow a bit, by
preallocating maximum buffer. This removes the time spend on allocating
memory, as well as potential OOM errors during module initialization.

Handlers for modules, where configuration data fits on stack, are left
as is.

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/20230929112436.787058-4-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 8d9614b8 17-Jul-2023 Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>

ASoC: Intel: avs: Convert to PCI device IDs defines

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>


# f89d783d 13-Jan-2023 Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>

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: 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>


# 5a565ba2 02-Dec-2022 Cezary Rojewski <cezary.rojewski@intel.com>

ASoC: Intel: avs: Probing and firmware tracing over debugfs

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>


# 2a87f177 27-Oct-2022 Cezary Rojewski <cezary.rojewski@intel.com>

ASoC: Intel: avs: Power and clock gating policy overriding

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>


# d56829e9 27-Oct-2022 Piotr Maziarz <piotrx.maziarz@linux.intel.com>

ASoC: Intel: avs: Standby power-state support

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>


# 7f05ca9a 19-Oct-2022 Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

ALSA/ASoC: hda: ext: add 'ext' prefix to snd_hdac_link_free_all

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>


# 8e1ae6f6 17-Oct-2022 Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

ASoC: Intel: avs: simplify S3 resume flows

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>


# d1356811 10-Oct-2022 Cezary Rojewski <cezary.rojewski@intel.com>

ASoC: Intel: avs: Add missing SKL-based device IDs

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>


# 83375566 10-Oct-2022 Cezary Rojewski <cezary.rojewski@intel.com>

ASoC: Intel: avs: Fix DMA mask assignment

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>


# 0839a04e 19-Sep-2022 Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

ALSA: hda: Use hdac_ext prefix in snd_hdac_stream_free_all() for clarity

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>


# a5bbbde2 07-Jul-2022 Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>

ASoC: Intel: avs: Use helper function to set up DMA

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>


# 8544eebc 07-Jul-2022 Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>

ASoC: Intel: avs: Set max DMA segment size

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>


# daa36bbc 07-Jul-2022 Cezary Rojewski <cezary.rojewski@intel.com>

ASoC: Intel: avs: Block IPC channel on suspend

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>


# c50cea05 07-Jul-2022 Cezary Rojewski <cezary.rojewski@intel.com>

ASoC: Intel: avs: Register HDAudio ext-bus operations

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>


# c8c960c1 15-May-2022 Cezary Rojewski <cezary.rojewski@intel.com>

ASoC: Intel: avs: APL-based platforms support

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>


# b3e29075 15-May-2022 Cezary Rojewski <cezary.rojewski@intel.com>

ASoC: Intel: avs: SKL-based platforms support

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>


# cfbc100e 15-May-2022 Cezary Rojewski <cezary.rojewski@intel.com>

ASoC: Intel: avs: Power management

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>


# 1affc44e 15-May-2022 Cezary Rojewski <cezary.rojewski@intel.com>

ASoC: Intel: avs: PCI driver implementation

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>


# b27f4523 11-Mar-2022 Cezary Rojewski <cezary.rojewski@intel.com>

ASoC: Intel: avs: General code loading flow

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>