aboutsummaryrefslogtreecommitdiff
path: root/sound/soc/intel/avs
AgeCommit message (Collapse)AuthorFilesLines
2024-10-08ASoC: Intel: avs: Update stream status in a separate threadAmadeusz Sławiński3-1/+37
Function snd_pcm_period_elapsed() is part of sequence servicing HDAudio stream IRQs. It's called under Global Interrupt Enable (GIE) disabled - no HDAudio interrupts will be raised. At the same time, the function may end up calling __snd_pcm_xrun() or snd_pcm_drain_done(). On the avs-driver side, this translates to IPCs and as GIE is disabled, these will never complete successfully. Improve system stability by scheduling stream-IRQ handling in a separate thread. Signed-off-by: Amadeusz Sławiński <[email protected]> Reviewed-by: Cezary Rojewski <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-09-27[tree-wide] finally take no_llseek outAl Viro1-3/+0
no_llseek had been defined to NULL two years ago, in commit 868941b14441 ("fs: remove no_llseek") To quote that commit, At -rc1 we'll need do a mechanical removal of no_llseek - git grep -l -w no_llseek | grep -v porting.rst | while read i; do sed -i '/\<no_llseek\>/d' $i done would do it. Unfortunately, that hadn't been done. Linus, could you do that now, so that we could finally put that thing to rest? All instances are of the form .llseek = no_llseek, so it's obviously safe. Signed-off-by: Al Viro <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2024-09-14Merge tag 'asoc-v6.12' of ↵Takashi Iwai1-1/+7
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-next ASoC: Updates for v6.12 This is a very large set of changes, almost all in drivers rather than the core. Even with the addition of several quite large drivers the overall diffstat is negative thanks to the removal of some old Intel board support which has been obsoleted by the AVS driver, helped a bit by some factoring out into helpers (especially around the Soundwire machine drivers for x86). Highlights include: - More simplifications and cleanups throughout the subsystem from Morimoto-san. - Extensive cleanups and refactoring of the Soundwire drivers to make better use of helpers. - Removal of Intel machine support obsoleted by the AVS driver. - Lots of DT schema conversions. - Machine support for many AMD and Intel x86 platforms. - Support for AMD ACP 7.1, Mediatek MT6367 and MT8365, Realtek RTL1320 SoundWire and rev C, and Texas Instruments TAS2563
2024-09-06ASoC: Intel: avs: drop SNDRV_PCM_RATE_KNOTJerome Brunet1-16/+6
The custom rate constraint list was necessary to support 12kHz, 24kHz and 128kHz. These rates are now available through SNDRV_PCM_RATE_12000, SNDRV_PCM_RATE_24000 and SNDRV_PCM_RATE_128000. Use them and drop the custom rate constraint rule. Signed-off-by: Jerome Brunet <[email protected]> Reviewed-by: David Rhodes <[email protected]> Acked-by: Mark Brown <[email protected]> Reviewed-by: Jaroslav Kysela <[email protected]> Signed-off-by: Takashi Iwai <[email protected]> Link: https://patch.msgid.link/[email protected]
2024-08-19ASoC: Intel: avs: Enable by default for all SST configurationsCezary Rojewski1-1/+7
The skylake-driver is deprecated in favour of the avs-driver. As the latter supports all configurations of its predecessor and more, update the existing selection mechanism to acknowledge the SST flag. Acked-by: Andy Shevchenko <[email protected]> Signed-off-by: Cezary Rojewski <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-06-23ASoC: Few constifications (mostly arguments)Mark Brown1-2/+2
Merge series from Krzysztof Kozlowski <[email protected]>: Make few pointers in ASoC functions as pointers to const, so the code is clearer to read, a bit safer and allows further constifications (e.g. placing some data as rodata).
2024-06-21ASoC: Merge up fixesMark Brown1-4/+15
We need some of the AMD fixes as a base for new work.
2024-06-18ASoC: Constify return of snd_soc_dai_get_pcm_stream()Krzysztof Kozlowski1-2/+2
Returned 'struct snd_soc_pcm_stream' by snd_soc_dai_get_pcm_stream() is not modified by the users, so it can be changed as pointer to const. This is a necessary step towards making the 'dai->driver' a pointer to const. Signed-off-by: Krzysztof Kozlowski <[email protected]> Link: https://msgid.link/r/20240617-n-asoc-const-auto-selectable-formats-v1-5-8004f346ee38@linaro.org Signed-off-by: Mark Brown <[email protected]>
2024-06-10ASoC: Intel: avs: Fix route overrideAmadeusz Sławiński1-4/+15
Instead of overriding existing memory strings that may be too short, just allocate needed memory and point the route at it. Reported-by: Jason Montleon <[email protected]> Link: https://github.com/thesofproject/avs-topology-xml/issues/22#issuecomment-2127892605 Reviewed-by: Cezary Rojewski <[email protected]> Signed-off-by: Amadeusz Sławiński <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-05-29ASoC: Intel: avs: es8336: Switch to new Intel CPU model definesTony Luck1-4/+4
New CPU #defines encode vendor and family as well as model. Signed-off-by: Tony Luck <[email protected]> Reviewed-by: Amadeusz Sławiński <[email protected]> Acked-by: Mark Brown <[email protected]> Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-05-27ASoC: Intel: avs: Constify struct snd_soc_tplg_opsChristophe JAILLET1-1/+1
Constifying "struct snd_soc_tplg_ops" moves some data to a read-only section, so increase overall security. On a x86_64, with allmodconfig: Before: text data bss dec hex filename 28046 794 0 28840 70a8 sound/soc/intel/avs/topology.o After: text data bss dec hex filename 28206 614 0 28820 7094 sound/soc/intel/avs/topology.o Signed-off-by: Christophe JAILLET <[email protected]> Reviewed-by: Amadeusz Sławiński <[email protected]> Link: https://msgid.link/r/01de0157088de0475970c79738284d6c86d702fe.1715526069.git.christophe.jaillet@wanadoo.fr Signed-off-by: Mark Brown <[email protected]>
2024-05-22tracing/treewide: Remove second parameter of __assign_str()Steven Rostedt (Google)1-2/+2
With the rework of how the __string() handles dynamic strings where it saves off the source string in field in the helper structure[1], the assignment of that value to the trace event field is stored in the helper value and does not need to be passed in again. This means that with: __string(field, mystring) Which use to be assigned with __assign_str(field, mystring), no longer needs the second parameter and it is unused. With this, __assign_str() will now only get a single parameter. There's over 700 users of __assign_str() and because coccinelle does not handle the TRACE_EVENT() macro I ended up using the following sed script: git grep -l __assign_str | while read a ; do sed -e 's/\(__assign_str([^,]*[^ ,]\) *,[^;]*/\1)/' $a > /tmp/test-file; mv /tmp/test-file $a; done I then searched for __assign_str() that did not end with ';' as those were multi line assignments that the sed script above would fail to catch. Note, the same updates will need to be done for: __assign_str_len() __assign_rel_str() __assign_rel_str_len() I tested this with both an allmodconfig and an allyesconfig (build only for both). [1] https://lore.kernel.org/linux-trace-kernel/[email protected]/ Link: https://lore.kernel.org/linux-trace-kernel/[email protected] Cc: Masami Hiramatsu <[email protected]> Cc: Mathieu Desnoyers <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Julia Lawall <[email protected]> Signed-off-by: Steven Rostedt (Google) <[email protected]> Acked-by: Jani Nikula <[email protected]> Acked-by: Christian König <[email protected]> for the amdgpu parts. Acked-by: Thomas Hellström <[email protected]> #for Acked-by: Rafael J. Wysocki <[email protected]> # for thermal Acked-by: Takashi Iwai <[email protected]> Acked-by: Darrick J. Wong <[email protected]> # xfs Tested-by: Guenter Roeck <[email protected]>
2024-05-21Merge tag 'pci-v6.10-changes' of ↵Linus Torvalds1-1/+1
git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci Pull pci updates from Bjorn Helgaas: "Enumeration: - Skip E820 checks for MCFG ECAM regions for new (2016+) machines, since there's no requirement to describe them in E820 and some platforms require ECAM to work (Bjorn Helgaas) - Rename PCI_IRQ_LEGACY to PCI_IRQ_INTX to be more specific (Damien Le Moal) - Remove last user and pci_enable_device_io() (Heiner Kallweit) - Wait for Link Training==0 to avoid possible race (Ilpo Järvinen) - Skip waiting for devices that have been disconnected while suspended (Ilpo Järvinen) - Clear Secondary Status errors after enumeration since Master Aborts and Unsupported Request errors are an expected part of enumeration (Vidya Sagar) MSI: - Remove unused IMS (Interrupt Message Store) support (Bjorn Helgaas) Error handling: - Mask Genesys GL975x SD host controller Replay Timer Timeout correctable errors caused by a hardware defect; the errors cause interrupts that prevent system suspend (Kai-Heng Feng) - Fix EDR-related _DSM support, which previously evaluated revision 5 but assumed revision 6 behavior (Kuppuswamy Sathyanarayanan) ASPM: - Simplify link state definitions and mask calculation (Ilpo Järvinen) Power management: - Avoid D3cold for HP Pavilion 17 PC/1972 PCIe Ports, where BIOS apparently doesn't know how to put them back in D0 (Mario Limonciello) CXL: - Support resetting CXL devices; special handling required because CXL Ports mask Secondary Bus Reset by default (Dave Jiang) DOE: - Support DOE Discovery Version 2 (Alexey Kardashevskiy) Endpoint framework: - Set endpoint BAR to be 64-bit if the driver says that's all the device supports, in addition to doing so if the size is >2GB (Niklas Cassel) - Simplify endpoint BAR allocation and setting interfaces (Niklas Cassel) Cadence PCIe controller driver: - Drop DT binding redundant msi-parent and pci-bus.yaml (Krzysztof Kozlowski) Cadence PCIe endpoint driver: - Configure endpoint BARs to be 64-bit based on the BAR type, not the BAR value (Niklas Cassel) Freescale Layerscape PCIe controller driver: - Convert DT binding to YAML (Frank Li) MediaTek MT7621 PCIe controller driver: - Add DT binding missing 'reg' property for child Root Ports (Krzysztof Kozlowski) - Fix theoretical string truncation in PHY name (Sergio Paracuellos) NVIDIA Tegra194 PCIe controller driver: - Return success for endpoint probe instead of falling through to the failure path (Vidya Sagar) Renesas R-Car PCIe controller driver: - Add DT binding missing IOMMU properties (Geert Uytterhoeven) - Add DT binding R-Car V4H compatible for host and endpoint mode (Yoshihiro Shimoda) Rockchip PCIe controller driver: - Configure endpoint BARs to be 64-bit based on the BAR type, not the BAR value (Niklas Cassel) - Add DT binding missing maxItems to ep-gpios (Krzysztof Kozlowski) - Set the Subsystem Vendor ID, which was previously zero because it was masked incorrectly (Rick Wertenbroek) Synopsys DesignWare PCIe controller driver: - Restructure DBI register access to accommodate devices where this requires Refclk to be active (Manivannan Sadhasivam) - Remove the deinit() callback, which was only need by the pcie-rcar-gen4, and do it directly in that driver (Manivannan Sadhasivam) - Add dw_pcie_ep_cleanup() so drivers that support PERST# can clean up things like eDMA (Manivannan Sadhasivam) - Rename dw_pcie_ep_exit() to dw_pcie_ep_deinit() to make it parallel to dw_pcie_ep_init() (Manivannan Sadhasivam) - Rename dw_pcie_ep_init_complete() to dw_pcie_ep_init_registers() to reflect the actual functionality (Manivannan Sadhasivam) - Call dw_pcie_ep_init_registers() directly from all the glue drivers, not just those that require active Refclk from the host (Manivannan Sadhasivam) - Remove the "core_init_notifier" flag, which was an obscure way for glue drivers to indicate that they depend on Refclk from the host (Manivannan Sadhasivam) TI J721E PCIe driver: - Add DT binding J784S4 SoC Device ID (Siddharth Vadapalli) - Add DT binding J722S SoC support (Siddharth Vadapalli) TI Keystone PCIe controller driver: - Add DT binding missing num-viewport, phys and phy-name properties (Jan Kiszka) Miscellaneous: - Constify and annotate with __ro_after_init (Heiner Kallweit) - Convert DT bindings to YAML (Krzysztof Kozlowski) - Check for kcalloc() failure in of_pci_prop_intr_map() (Duoming Zhou)" * tag 'pci-v6.10-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci: (97 commits) PCI: Do not wait for disconnected devices when resuming x86/pci: Skip early E820 check for ECAM region PCI: Remove unused pci_enable_device_io() ata: pata_cs5520: Remove unnecessary call to pci_enable_device_io() PCI: Update pci_find_capability() stub return types PCI: Remove PCI_IRQ_LEGACY scsi: vmw_pvscsi: Do not use PCI_IRQ_LEGACY instead of PCI_IRQ_LEGACY scsi: pmcraid: Use PCI_IRQ_INTX instead of PCI_IRQ_LEGACY scsi: mpt3sas: Use PCI_IRQ_INTX instead of PCI_IRQ_LEGACY scsi: megaraid_sas: Use PCI_IRQ_INTX instead of PCI_IRQ_LEGACY scsi: ipr: Use PCI_IRQ_INTX instead of PCI_IRQ_LEGACY scsi: hpsa: Use PCI_IRQ_INTX instead of PCI_IRQ_LEGACY scsi: arcmsr: Use PCI_IRQ_INTX instead of PCI_IRQ_LEGACY wifi: rtw89: Use PCI_IRQ_INTX instead of PCI_IRQ_LEGACY dt-bindings: PCI: rockchip,rk3399-pcie: Add missing maxItems to ep-gpios Revert "genirq/msi: Provide constants for PCI/IMS support" Revert "x86/apic/msi: Enable PCI/IMS" Revert "iommu/vt-d: Enable PCI/IMS" Revert "iommu/amd: Enable PCI/IMS" Revert "PCI/MSI: Provide IMS (Interrupt Message Store) support" ...
2024-05-13Merge tag 'asoc-v6.10' of ↵Takashi Iwai48-536/+507
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Updates for v6.10 This is a very big update, in large part due to extensive work the Intel people have been doing in their drivers though it's also been busy elsewhere. There's also a big overhaul of the DAPM documentation from Luca Ceresoli arising from the work he did putting together his recent ELC talk, and he also contributed a new tool for visualising the DAPM state. - A new tool dapm-graph for visualising the DAPM state. - Substantial fixes and clarifications for the DAPM documentation. - Very large updates throughout the Intel audio drivers. - Cleanups of accessors for driver data, module labelling, and for constification. - Modernsation and cleanup work in the Mediatek drivers. - Several fixes and features for the DaVinci I2S driver. - New drivers for several AMD and Intel platforms, Nuvoton NAU8325, Rockchip RK3308 and Texas Instruments PCM6240.
2024-05-08ASoC: intel: Use *-y instead of *-objs in MakefileTakashi Iwai2-22/+22
*-objs suffix is reserved rather for (user-space) host programs while usually *-y suffix is used for kernel drivers (although *-objs works for that purpose for now). Let's correct the old usages of *-objs in Makefiles. Signed-off-by: Takashi Iwai <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-05-06ASoC: Intel: avs: clarify Copyright informationPierre-Louis Bossart46-46/+46
For some reason a number of files included the "All rights reserved" statement. Good old copy-paste made sure this mistake proliferated. Remove the "All rights reserved" in all Intel-copyright to align with internal guidance. Acked-by: Cezary Rojewski <[email protected]> Signed-off-by: Pierre-Louis Bossart <[email protected]> Reviewed-by: Bard Liao <[email protected]> Reviewed-by: Péter Ujfalusi <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-05-06ASoC: Intel: avs: boards: Properly name input deviceAmadeusz Sławiński5-7/+8
Machine boards expose input device for use with userspace. Current name in some cases is incorrect, fix it. Reviewed-by: Cezary Rojewski <[email protected]> Signed-off-by: Amadeusz Sławiński <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-04-30ASoC: Intel: avs: PCM code cleanupMark Brown1-138/+112
Merge series from Cezary Rojewski <[email protected]>: A set of changes that aims to improve readability of cohesiveness of the pcm code for the avs-driver. Start off with a change that synchronizes DAI open/close - DAIs are started up in ascending order yet their shutdown does not follow the scheme - it is done in the ascending order too, rather than desceding one. This patch is a dependency for the next one in line. To align the HDAudio DAI startup/shutdown with the non-HDAudio equivalents, relocate the code from component to DAI. The reason above is a dependency stems from codec driver requirements - HDAudio code found in sound/pci/hda/ expects substream->runtime->private_data to point to a valid stream (HOST) pointer. With the hard part done, the follow up changes update the existing code to reduce it is complexity - removal of duplicates, renaming of ambiguous functions and adding new fields to DAI-data object so that the number of local variables and casts is reduced.
2024-04-30ASoC: Merge up fixesMark Brown2-1/+3
Some new SOF changes depend on the fixes there.
2024-04-30ASoC: Intel: avs: Clean up hw constraints initializationCezary Rojewski1-40/+44
Provide a separate function that initializes all PCM hardware constraints for the driver. No functional changes. Signed-off-by: Cezary Rojewski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-04-30ASoC: Intel: avs: Store pointer to link_stream in dma_dataCezary Rojewski1-21/+19
While the HDAudio codec driver expectations must be met - store valid pointer to HDAudio LINK stream in substream->runtime->private_data - the code is more readable and easier to maintain if dma_data stores pointers to both HOST and LINK stream. DAI BE operations can refer to the LINK stream with data->link_stream, similarly to how DAI FE operations access the HOST stream with data->host_stream. Signed-off-by: Cezary Rojewski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-04-30ASoC: Intel: avs: Remove redundancy around DAI prepareCezary Rojewski1-10/+4
Drop unused arguments in the avs_dai_prepare() function. With the function updated, it matches its template in snd_soc_dai_ops and can be referenced throughout the pcm.c file without need of any wrappers. Signed-off-by: Cezary Rojewski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-04-30ASoC: Intel: avs: Remove redundancy around DAI startupCezary Rojewski1-17/+5
Half of the arguments in avs_dai_startup() are unused and can be dropped. With the function updated, it matches its template in snd_soc_dai_ops and can be referenced throughout the pcm.c file without need of any wrappers. Signed-off-by: Cezary Rojewski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-04-30ASoC: Intel: avs: Store pointer to adev in DAI dma_dataCezary Rojewski1-9/+8
Reduce the number of to_avs_dev() casts by storing the driver context in DAI's dma_data. Signed-off-by: Cezary Rojewski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-04-30ASoC: Intel: avs: Remove redundancy around DAI shutdownCezary Rojewski1-25/+19
Move avs_dai_nonhda_be_shutdown() to avs_dai_shutdown() as the function is common for all transfer types, not just non-HDAudio ones. Use it to simplify avs_dai_fe_shutdown(). While at it, fix explicit kfree(data) and use the destructor instead. Signed-off-by: Cezary Rojewski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-04-30ASoC: Intel: avs: Relocate HDA BE DAI specific operationsCezary Rojewski1-29/+26
DAI's startup()/shutdown() shall deal with allocation and freeing of resources needed to facilitate streaming over it. Currently for HDAudio BE DAIs some of that task is done in component->open()/close(). Relocate the relevant pieces to address that. Signed-off-by: Cezary Rojewski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-04-25ASoC: Intel: avs: Use PCI_IRQ_INTX instead of PCI_IRQ_LEGACYDamien Le Moal1-1/+1
Use the macro PCI_IRQ_INTX instead of the deprecated PCI_IRQ_LEGACY macro. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Damien Le Moal <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Reviewed-by: Amadeusz Sławiński <[email protected]>
2024-04-22ASoC: Intel: avs: Switch to acpi-nhltMark Brown4-27/+23
Merge series from Cezary Rojewski <[email protected]>: The change is based on rafael/acpi-nhlt [1] immutable branch which Rafael kindly prepared for me. Without the topmost changes to ACPI/NHLT, the patches present will fail to compile. Recent changes for the ACPI tree [2] refactored interfaces of the NHLT table. Currently we have two implementations - one found in acpi subsystem (unused) and one in sound/hda/. As NHLT is part of ACPI, idea is to make the former useful and then switch all users of existing sound/hda/intel-nhlt.c to this new interface over time and remove the duplicate afterward. [1]: https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git/?h=acpi-nhlt [2]: https://lore.kernel.org/linux-acpi/[email protected]/
2024-04-21ASoC: Intel: avs: Switch to ACPI NHLTAmadeusz Sławiński4-27/+23
Now that NHLT support in ACPI framework was introduced, migrate avs driver to new API. Signed-off-by: Amadeusz Sławiński <[email protected]> Signed-off-by: Cezary Rojewski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-04-19ASoC: Intel: avs: Remove unused IRQ-related codeCezary Rojewski9-249/+7
Most IRQ-related code is duplicated in the driver. Switch to the new implementation and remove unused members. While the change is non-trivial, from functional perspective status quo is achieved. Signed-off-by: Cezary Rojewski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-04-19ASoC: Intel: avs: New IRQ handling implementationCezary Rojewski9-0/+240
The existing code can be both improved and simplified. To make this change easier to manage, first add new implementation and then remove deadcode in a separate patch. Simplification achieved with: - reduce the amount of resources requested by the driver i.e.: IPC and CLDMA request_irq() merged into one - reduce the number of DSP ops from 2 to 1: irq_handler/thread() vs dsp_interrupt() - drop ambiguity around CLDMA interrupt, let skl.c handle that explicitly as it is the only user Signed-off-by: Cezary Rojewski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-04-19ASoC: Intel: avs: Set name of control as in topologyAmadeusz Sławiński1-0/+2
When creating controls attached to widgets, there are a lot of rules if they get their name prefixed with widget name or not. Due to that controls ended up with weirdly looking names like "ssp0_fe DSP Volume", while topology set it to "DSP Volume". Fix this by setting no_wname_in_kcontrol_name to true in avs topology widgets which disables unwanted behaviour. Fixes: be2b81b519d7 ("ASoC: Intel: avs: Parse control tuples") Signed-off-by: Amadeusz Sławiński <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-04-08ASoC: Intel: avs: Fix debug window descriptionCezary Rojewski1-1/+1
Recent changes addressed PAGE_SIZE ambiguity in 2/3 locations for struct avs_icl_memwnd2. The unaddressed one causes build errors when PAGE_SIZE != SZ_4K. Reported-by: kernel test robot <[email protected]> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Fixes: 275b583d047a ("ASoC: Intel: avs: ICL-based platforms support") Signed-off-by: Cezary Rojewski <[email protected]> Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-04-05ASoC: Intel: avs: Fixes and cleanups for 6.10Mark Brown9-24/+109
Merge series from Cezary Rojewski <[email protected]>: Set of changes targeting the avs-driver only. No new features, patchset either fixes or fortifies existing code. Patchset starts off with a fix for debugbility on ICL+ platforms which I have forgotten to fixup when providing support for these initially. The next two address copier module initialization, most importantly, silence the gcc 'field-spanning write' false-positive. The following four: 6/13 ASoC: Intel: avs: Replace risky functions with safer variants 7/13 ASoC: Intel: avs: Fix potential integer overflow 8/13 ASoC: Intel: avs: Test result of avs_get_module_entry() 9/13 ASoC: Intel: avs: Remove dead code address problems found out by Coverity static analysis tool. The last two worth mentioning are: recommendation from the firmware team to wake subsystem from D0ix when starting any pipeline -and- shielding against invalid period/buffer sizes. Audio format shall be taken into consideration when calculating either of these. Amadeusz Sławiński (2): ASoC: Intel: avs: Restore stream decoupling on prepare ASoC: Intel: avs: Add assert_static to guarantee ABI sizes Cezary Rojewski (11): ASoC: Intel: avs: Fix debug-slot offset calculation ASoC: Intel: avs: Silence false-positive memcpy() warnings ASoC: Intel: avs: Fix config_length for config-less copiers ASoC: Intel: avs: Fix ASRC module initialization ASoC: Intel: avs: Replace risky functions with safer variants ASoC: Intel: avs: Fix potential integer overflow ASoC: Intel: avs: Test result of avs_get_module_entry() ASoC: Intel: avs: Remove dead code ASoC: Intel: avs: Wake from D0ix when starting streaming ASoC: Intel: avs: Init debugfs before booting firmware ASoC: Intel: avs: Rule invalid buffer and period sizes out sound/soc/intel/avs/avs.h | 1 + sound/soc/intel/avs/cldma.c | 2 +- sound/soc/intel/avs/core.c | 4 +-- sound/soc/intel/avs/icl.c | 12 ++++++--- sound/soc/intel/avs/loader.c | 6 +++-- sound/soc/intel/avs/messages.h | 47 ++++++++++++++++++++++++++++++++-- sound/soc/intel/avs/path.c | 13 ++++------ sound/soc/intel/avs/pcm.c | 34 +++++++++++++++++++++++- sound/soc/intel/avs/probes.c | 14 ++++++---- 9 files changed, 109 insertions(+), 24 deletions(-) -- 2.25.1
2024-04-05ASoC: Intel: avs: Rule invalid buffer and period sizes outCezary Rojewski1-0/+28
While HDAudio controller supports buffer packets up to 128 bytes low, audio format shall be taken into consideration when calculating buffer and period sizes to avoid undesired xruns. As *_size in ALSA terms means frames (channels times bit-depth-bytes), hw_rules can calculate minimal buffer and period sizes solely from sample rate and the number of milliseconds commonly used on the AudioDSP firmware side. Signed-off-by: Cezary Rojewski <[email protected]> Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-04-05ASoC: Intel: avs: Add assert_static to guarantee ABI sizesAmadeusz Sławiński4-0/+49
In order to make sure that IPC interface is stable use assert_static to check union and struct sizes that describe communication interface. Signed-off-by: Amadeusz Sławiński <[email protected]> Signed-off-by: Cezary Rojewski <[email protected]> Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-04-05ASoC: Intel: avs: Init debugfs before booting firmwareCezary Rojewski1-2/+2
When bringing up setups it's vital to have access to debug functionality even if firmware boot fails. As order of probe()ing operations is changed, update remove() procedure accordingly. Signed-off-by: Cezary Rojewski <[email protected]> Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-04-05ASoC: Intel: avs: Wake from D0ix when starting streamingCezary Rojewski1-0/+4
It is recommended to keep the DSP domain in full-power when starting DMA engines. Signed-off-by: Cezary Rojewski <[email protected]> Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-04-05ASoC: Intel: avs: Remove dead codeCezary Rojewski1-2/+0
The result of list_next_entry()/list_last_entry() is never null. Signed-off-by: Cezary Rojewski <[email protected]> Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-04-05ASoC: Intel: avs: Test result of avs_get_module_entry()Cezary Rojewski1-5/+9
While PROBE_MOD_UUID is always part of the base AudioDSP firmware manifest, from maintenance point of view it is better to check the result. Fixes: dab8d000e25c ("ASoC: Intel: avs: Add data probing requests") Signed-off-by: Cezary Rojewski <[email protected]> Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-04-05ASoC: Intel: avs: Fix potential integer overflowCezary Rojewski1-1/+1
While stream_tag for CLDMA on SKL-based platforms is always 1, function hda_cldma_setup() uses AZX_SD_CTL_STRM() macro which does: stream_tag << 20 what combined with stream_tag type of 'unsigned int' generates a potential overflow issue. Update the field type to fix that. Fixes: 45864e49a05a ("ASoC: Intel: avs: Implement CLDMA transfer") Signed-off-by: Cezary Rojewski <[email protected]> Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-04-05ASoC: Intel: avs: Replace risky functions with safer variantsCezary Rojewski2-3/+3
strscpy() and snprintf() are the recommended equivalents of their riskier friends. Signed-off-by: Cezary Rojewski <[email protected]> Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-04-05ASoC: Intel: avs: Fix ASRC module initializationCezary Rojewski1-0/+1
The ASRC module configuration consists of several reserved fields. Zero them out when initializing the module to avoid sending invalid data. Fixes: 274d79e51875 ("ASoC: Intel: avs: Configure modules according to their type") Signed-off-by: Cezary Rojewski <[email protected]> Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-04-05ASoC: Intel: avs: Fix config_length for config-less copiersCezary Rojewski1-5/+3
Copier's config_length shall always be at least one even if there is no configuration payload to carry. While the firmware treats config_length=0 or 1 in the same manner, the driver shall initialize the module properly. Signed-off-by: Cezary Rojewski <[email protected]> Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-04-05ASoC: Intel: avs: Silence false-positive memcpy() warningsCezary Rojewski2-3/+3
Commit df8fc4e934c1 ("kbuild: Enable -fstrict-flex-arrays=3") enforced strict flex array declarations. This generates false-positive in form of: "memcpy: detected field-spanning write". Avoid it by utilizing the DECLARE_FLEX_ARRAY() macro. Signed-off-by: Cezary Rojewski <[email protected]> Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-04-05ASoC: Intel: avs: Fix debug-slot offset calculationCezary Rojewski1-3/+2
For resources with ID other than 0 the current calculus is incorrect. Fixes: 275b583d047a ("ASoC: Intel: avs: ICL-based platforms support") Signed-off-by: Cezary Rojewski <[email protected]> Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-04-05ASoC: Intel: avs: Restore stream decoupling on prepareAmadeusz Sławiński1-0/+4
Revert changes from commit b87b8f43afd5 ("ASoC: Intel: avs: Drop superfluous stream decoupling") to restore working streaming during S3. Fixes: b87b8f43afd5 ("ASoC: Intel: avs: Drop superfluous stream decoupling") Signed-off-by: Amadeusz Sławiński <[email protected]> Signed-off-by: Cezary Rojewski <[email protected]> Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-04-03ASoC: Merge up fixesMark Brown16-0/+16
Some of these, particularly the wm_adsp one in the immediate case, are needed as a basis for new work.
2024-04-03ASoC: Intel: avs: rt5682: Constify card_headset_pinsAmadeusz Sławiński1-1/+1
card_headset_pins is never modified, mark it const. Reviewed-by: Cezary Rojewski <[email protected]> Signed-off-by: Amadeusz Sławiński <[email protected]> Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-04-03ASoC: Intel: avs: rt5663: Constify card_headset_pinsAmadeusz Sławiński1-1/+1
card_headset_pins is never modified, mark it const. Reviewed-by: Cezary Rojewski <[email protected]> Signed-off-by: Amadeusz Sławiński <[email protected]> Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>