aboutsummaryrefslogtreecommitdiff
path: root/sound
AgeCommit message (Collapse)AuthorFilesLines
2024-04-03ASoC: SOF: Intel: mtl/lnl: Improve firmware boot stateMark Brown7-29/+189
Merge series from Peter Ujfalusi <peter.ujfalusi@linux.intel.com>: This series improves the firmware/boot state handling which will allow failed IMR boot recovery and human readable boot failure decoding. Additionally a new debugfs file is added to force a purge/clean boot of the DSP for developers.
2024-04-03ASoC: Merge up fixesMark Brown57-249/+557
Some of these, particularly the wm_adsp one in the immediate case, are needed as a basis for new work.
2024-04-03ASoC: Merge up left over v6.8 fixMark Brown1-1/+2
This v6.8 change didn't make it into the release, send it as a fix for v6.9.
2024-04-03ASoC: SOF: Intel: mtl: Correct the mtl_dsp_dump outputPeter Ujfalusi1-11/+5
The ROM/firmware state handling has changed between CAVS and ACE architecture: CAVS: ROM and firmware uses the SRAM window for the state and status/error code reporting ACE: ROM code is using two registers to report the state and error while the firmware is using the SRAM window to report states and status/error codes. Use the generic hda_dsp_get_state() to decode ROM state and error codes and print out the firmware state and status/error code only if the SRAM window is accessible - the firmware is booted and the Status readout is not 0xffffffff. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@intel.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com> Link: https://msgid.link/r/20240403105210.17949-8-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-03ASoC: SOF: Intel: hda-dsp/mtl: Add support for ACE ROM state codesPeter Ujfalusi3-6/+112
The ROM state codes differ between CAVS and ACE architecture, there is a slight overlap. Add the ACE related state defines to mtl.h, introduce new table and use it on case the function is called when running on ACE architecture. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@intel.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com> Link: https://msgid.link/r/20240403105210.17949-7-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-03ASoC: SOF: Intel: mtl: Implement firmware boot state checkPeter Ujfalusi1-5/+32
With the corrected rom_status_reg values we can now add a check for target boot status for firmware booting. With the check now we can identify failed firmware boots (IMR boots) and we can use the fallback to purge boot the DSP. Fixes: 064520e8aeaa ("ASoC: SOF: Intel: Add support for MeteorLake (MTL)") Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@intel.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com> Link: https://msgid.link/r/20240403105210.17949-6-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-03ASoC: SOF: Intel: mtl: Disable interrupts when firmware boot failedPeter Ujfalusi1-0/+1
In case of error during the firmware boot we need to disable the interrupts which were enabled as part of the boot sequence. Fixes: 064520e8aeaa ("ASoC: SOF: Intel: Add support for MeteorLake (MTL)") Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@intel.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com> Link: https://msgid.link/r/20240403105210.17949-5-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-03ASoC: SOF: Intel: lnl: Correct rom_status_regPeter Ujfalusi2-1/+17
ACE2 architecture changed the place where the ROM updates the status code from the shared SRAM window (and HFFLGP1QW0 in ACE1) to HFDSC register for the status and HFDEC (HFDSC + 4) for the error code. The rom_status_reg is not used on LNL because it was wrongly assigned based on older platform convention (SRAM window) and it was giving inconsistent readings. Add new header file for lnl specific register definitions. Fixes: 64a63d9914a5 ("ASoC: SOF: Intel: LNL: Add support for Lunarlake platform") Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@intel.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com> Link: https://msgid.link/r/20240403105210.17949-4-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-03ASoC: SOF: Intel: mtl: Correct rom_status_regPeter Ujfalusi2-4/+4
ACE1 architecture changed the place where the ROM updates the status code from the shared SRAM window to HFFLGP1QW0 register for the status and HFFLGP1QW0 + 4 for the error code. The rom_status_reg is not used on MTL because it was wrongly assigned based on older platform convention (SRAM window) and it was giving inconsistent readings. Fixes: 064520e8aeaa ("ASoC: SOF: Intel: Add support for MeteorLake (MTL)") Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@intel.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com> Link: https://msgid.link/r/20240403105210.17949-3-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-03ASoC: SOF: Intel: hda: Create debugfs file to force a clean DSP bootPeter Ujfalusi4-3/+19
When IMR boot is supported on a platform it is always going to be used to boot the DSP unless some catastrophic event happens. There is no way for a developer to force a clean DSP boot without removing and re-inserting the modules. Create a 'skip_imr_boot' debugfs file which can be used to force the next DSP boot as clean (prune) boot. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://msgid.link/r/20240403105210.17949-2-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
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 <cezary.rojewski@intel.com> Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Link: https://msgid.link/r/20240403093145.3375857-11-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
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 <cezary.rojewski@intel.com> Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Link: https://msgid.link/r/20240403093145.3375857-10-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-03ASoC: Intel: avs: rt298: Constify card_headset_pinsAmadeusz Sławiński1-1/+1
card_headset_pins is never modified, mark it const. Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com> Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Link: https://msgid.link/r/20240403093145.3375857-9-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-03ASoC: Intel: avs: rt286: Constify card_headset_pinsAmadeusz Sławiński1-1/+1
card_headset_pins is never modified, mark it const. Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com> Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Link: https://msgid.link/r/20240403093145.3375857-8-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-03ASoC: Intel: avs: rt274: Constify card_headset_pinsAmadeusz Sławiński1-1/+1
card_headset_pins is never modified, mark it const. Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com> Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Link: https://msgid.link/r/20240403093145.3375857-7-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-03ASoC: Intel: avs: nau8825: Constify card_headset_pinsAmadeusz Sławiński1-1/+1
card_headset_pins is never modified, mark it const. Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com> Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Link: https://msgid.link/r/20240403093145.3375857-6-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-03ASoC: Intel: avs: es8336: Constify card_headset_pinsAmadeusz Sławiński1-1/+1
card_headset_pins is never modified, mark it const. Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com> Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Link: https://msgid.link/r/20240403093145.3375857-5-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-03ASoC: Intel: avs: hdaudio: Constify probing_linkAmadeusz Sławiński1-1/+1
probing_link is passed to devm_kmemdup, and is never modified, may as well mark it const. Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com> Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Link: https://msgid.link/r/20240403093145.3375857-4-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-03ASoC: Intel: avs: Use devm_kstrdup_constAmadeusz Sławiński2-5/+5
FW name is constant and we just duplicate it, use const variant of devm_kstrdup to possibly save a bit of memory. Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com> Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Link: https://msgid.link/r/20240403093145.3375857-3-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-03ASoC: Intel: avs: hdaudio: Use devm_kstrdup_constAmadeusz Sławiński1-2/+2
HDA codec name is constant and we just duplicate it, use const variant of devm_kstrdup to possibly save a bit of memory. Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com> Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Link: https://msgid.link/r/20240403093145.3375857-2-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-03ASoC: rsnd: reg cleanupMark Brown11-344/+247
Merge series from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>: These are Renesas Sound driver cleanups for Gen3/Gen4.
2024-04-02ASoC: SOF: cppcheck fixes and debugfs additionMark Brown4-2/+11
Merge series from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>: Small changes with 3 cppcheck fixes and the firmware version now visible with debugfs instead of only via dmesg logs.
2024-04-02ASoC: SOF: Intel: improve SoundWire support forMark Brown9-127/+232
Merge series from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>: This patchset contains important updates for SoundWire support. We initially implemented support for multiple amplifiers on different links using a single HDaudio DMA transfer. To align with the other OS, the 'aggregation' is now supported by the firmware. This change in directions has kernel impacts, since we now have multiple HDaudio DMAs to program and start, but since there are no platforms released so far there's no end-user impact. In addition, the behavior in case of xruns is improved by clearing the PCM states and better handling of the hw_free case. Note that the hw_free support will compile but will only be functional with the companion patch "soundwire: intel: add intel_free_stream() back" already applied in the SoundWire tree.
2024-04-02ASoC: Use snd_ctl_find_id_mixer() instead ofMark Brown4-17/+200
Merge series from Richard Fitzgerald <rf@opensource.cirrus.com>: The first two patches change snd_soc_card_get_kcontrol() to use the core snd_ctl_find_id_mixer() functionality instead of open-coding its own list walk. The last patch adds a KUnit test for this, which was tested on the original and modified code.
2024-04-02ASoC: codecs: ES8326: solve some hp issues andMark Brown2-17/+22
Merge series from Zhang Yi <zhangyi@everest-semi.com>: We solved some issues related to headphone detection.And for using the same configuration in different power conditions,we modified the clock table
2024-04-02ASoC: SOF: ipc4-topology: Save the ALH DAI index during hw_paramsRanjani Sridharan3-2/+12
The node_id for multi-gateway ALH DAI's get overwritten with the group_id during the DAI copier's ipc_prepare op. So, save the ALH dai_index during the BE DAI hw_params in the dai_index field of struct ipc4_copier and use that to set the device ID in the configuration blob. This will avoid errors during copier init after an xrun. Note that the dai_index is typically set in topology for DMIC/SSP, but it's not used for ALH. Reclaiming this dai_index field to store the node_id does not generate a conflict with topology-defined values. Reviewed-by: Rander Wang <rander.wang@intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://msgid.link/r/20240402151828.175002-18-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-02ASoC: SOF: pcm: reset all PCM sources in case of xrunsPierre-Louis Bossart1-2/+13
With the delayed stops, the xrun handling is problematic: the applications expects everything to be reset but the firmware and DMA are still in a PAUSED state. This patch makes sure the prepare while pending_stop is set is special-cased. Reviewed-by: Rander Wang <rander.wang@intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Co-developed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://msgid.link/r/20240402151828.175002-17-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-02ASoC: SOF: pcm: add pending_stop state variablePierre-Louis Bossart3-0/+13
Add a state variable to keep track of delayed stops, in case pcm_ops->platform_stop_during_hw_free is set. This patch should be iso-functionality, possibly removing no-op cases. The main purpose of this new state variable is to prepare a follow-up patch to reset all PCM and DMAs in case of stop/prepare xrun sequences. Reviewed-by: Rander Wang <rander.wang@intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://msgid.link/r/20240402151828.175002-16-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-02ASoC: SOF: pcm: simplify sof_pcm_hw_free() with helperPierre-Louis Bossart1-29/+3
The same sequence is used twice, use common helper. Reviewed-by: Rander Wang <rander.wang@intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://msgid.link/r/20240402151828.175002-15-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-02ASoC: SOF: sof-audio: revisit sof_pcm_stream_free() error handling and logsPierre-Louis Bossart1-8/+20
For some reason the existing code stops on the first error, which potentially leaves the DMA and widgets in a weird state. Change to free-up all resources even in case of errors. Also add a more consistent error handling and logs, with the first error code returned to the caller. Reviewed-by: Rander Wang <rander.wang@intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://msgid.link/r/20240402151828.175002-14-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-02ASoC: SOF: Intel: hda: Clear Soundwire node ID during BE DAI hw_freeRanjani Sridharan2-4/+24
When an xrun happens, the BE DAI hw_params doesn't get invoked before the stream restarts with a prepare. In this case, clearing the node ID when the DAI widget is freed and unprepared will result in an error when it is re-initialized. In order to avoid this, move the code to clear the node ID to the BE DAI hw_free op to keep it balanced with the BE DAI hw_params. Reviewed-by: Rander Wang <rander.wang@intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://msgid.link/r/20240402151828.175002-13-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-02ASoC: SOF: Intel: hda: move helper to static inlinePierre-Louis Bossart2-8/+8
To allow using widget_to_sdev() in other files, move it as static inline in shared header file. Reviewed-by: Rander Wang <rander.wang@intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://msgid.link/r/20240402151828.175002-12-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-02ASoC: SOF: IPC4: extend dai_data with node_idPierre-Louis Bossart4-2/+9
The node_id value needs to be handled specifically for ALH. Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://msgid.link/r/20240402151828.175002-11-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-02ASoC: SOF: Intel: hda: extend signature of sdw_hda_dai_hw_params()Pierre-Louis Bossart3-3/+6
Add intel_alh_id to set the expected gateway node_id in a follow-up patch. Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://msgid.link/r/20240402151828.175002-10-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-02ASoC: SOF: Intel: set the DMA TLV device as dai_indexPierre-Louis Bossart1-1/+1
We've already defined the value for dai_index, let's use it instead of open-coding the same thing. No functionality change. Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://msgid.link/r/20240402151828.175002-9-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-02ASoC: SOF: Intel: hda-dai: add helpers to set dai configPierre-Louis Bossart1-13/+38
We need to be able to set the dai config differently for SoundWire. Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://msgid.link/r/20240402151828.175002-8-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-02ASoC: SOF: Intel: hda-dai: set dma_stream_channel_map deviceBard Liao2-2/+47
sof_ipc4_dma_config_tlv{} is required for ACE2.x. The patch follow the convention to set the dma_stream_channel_map.mapping device as "link_id << 8 | pdi_id". And the mapping in sof_ipc4_alh_configuration_blob{} should be the same as dma_stream_channel_map.mapping in sof_ipc4_dma_config{}. The purposes of device id is to map DMA tlv. Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://msgid.link/r/20240402151828.175002-7-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-02ASoC: SOF: Intel: hda-dai: set lowest N bits in ch_maskBard Liao1-7/+1
We always use the lowest N channels of stream. So, set ch_mask to GENMASK(params_channels(params) - 1, 0). Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://msgid.link/r/20240402151828.175002-6-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-02ASoC: SOF: make dma_config_tlv be an arrayBard Liao3-15/+14
Each stream needs a dma_config_tlv. We will handle multi dma_config_tlv in the follow up commits. Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://msgid.link/r/20240402151828.175002-5-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-02Revert "ASoC: SOF: Intel: hda-dai-ops: only allocate/release streams for ↵Bard Liao1-15/+2
first CPU DAI" This reverts commit f8ba62ac863c33fc0d8ac3f1270985c2b77f4377. The SoundWire aggregated solution was to use one DMA on multiple links. But, the solution changed to use one DMA for each link. It means that we should assign HDaudio stream_tag for each cpu_dai. Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://msgid.link/r/20240402151828.175002-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-02Revert "ASoC: SOF: Intel: hda-dai-ops: reset device count for SoundWire DAIs"Bard Liao1-23/+1
This reverts commit 699e146d9ebf42ee2a5d4e4e28f7a49c4aef0105. Don't reset device_count as we will use the multi-gateway firmware configuration. Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://msgid.link/r/20240402151828.175002-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-02ASoC: SOF: Intel: hda-dai: fix channel map configuration for aggregated dailinkPierre-Louis Bossart1-2/+29
The existing code derives the channel map used to program the HDaudio link DMA from the hw_params, but that is not quite right in the case of aggregation. The code in soc-pcm.c splits the hw_params depending on the codec_ch_map, and we need to reconstruct the channel-map to insert the data in the right places. This issue is seen only on amplifier feedback capture where the data from the second amplifier was replaced by that of the first amplifier. Note that the loop iterator of the macro for_each_rtd_cpu_dais() is reused in a following loop. This is different to all existing usages of that macro, hence the use of a boolean flag to avoid an access to an uninitialized variable. Fixes: 2960ee5c4814 ("ASoC: SOF: Intel: hda-dai: add helpers for SoundWire callbacks") Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://msgid.link/r/20240402151828.175002-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-02ASoC: SOF: ipc4-topology: remove shadowed variablePierre-Louis Bossart1-1/+0
Cppcheck reports this: sound/soc/sof/ipc4-topology.c:569:23: style: Local variable 'sdev' shadows outer variable [shadowVariable] struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(scomp); ^ sound/soc/sof/ipc4-topology.c:512:22: note: Shadowed declaration struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(scomp); ^ sound/soc/sof/ipc4-topology.c:569:23: note: Shadow variable struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(scomp); ^ Remove shadowed variable. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Link: https://msgid.link/r/20240402145959.172619-5-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-02ASoC: SOF: ipc4-priv: align prototype and function declarationPierre-Louis Bossart1-1/+1
Somehow instance_id and id were mixed. Align on instance_id for consistency. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Link: https://msgid.link/r/20240402145959.172619-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-02ASoC: SOF: amd: acp-loader: abort firmware download on write errorPierre-Louis Bossart1-0/+2
cppcheck reports this issue: sound/soc/sof/amd/acp-loader.c:299:6: style: Variable 'ret' is reassigned a value before the old one has been used. [redundantAssignment] ret = request_firmware(&adata->fw_dbin, fw_filename, sdev->dev); ^ sound/soc/sof/amd/acp-loader.c:289:6: note: ret is assigned ret = snd_sof_dsp_block_write(sdev, SOF_FW_BLK_TYPE_IRAM, 0, ^ sound/soc/sof/amd/acp-loader.c:299:6: note: ret is overwritten ret = request_firmware(&adata->fw_dbin, fw_filename, sdev->dev); ^ This behavior is probably unintentional, there's no reason to return an error for the DRAM but not the IRAM. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Link: https://msgid.link/r/20240402145959.172619-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-02ASoC: SOF: ipc4-loader: save FW version info to debugfsYong Zhi1-0/+8
To check loaded FW version: $ hexdump -C /sys/kernel/debug/sof/fw_version 00000000 02 00 07 00 63 00 01 00 00 00 00 00 00 00 00 00 |....c...........| Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Signed-off-by: Yong Zhi <yong.zhi@intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://msgid.link/r/20240402145959.172619-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-02ASoC: nau8325: Revise soc_enum structure definition.Seven Lee1-5/+12
This patch is modified nau8325_dac_oversampl_enum enumerated. Use SOC_VALUE_ENUM instead to hide empty (presumably invalid) options. Signed-off-by: Seven Lee <wtli@nuvoton.com> Link: https://msgid.link/r/20240401104753.3432507-1-wtli@nuvoton.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-02ASoC: rsnd: no exception for SCUKuninori Morimoto5-20/+0
R-Car Gen1 and Gen4 doesn't have SCU, and current driver checks Gen1 (only) on each devices (A). But these drivers are assuming it might be not enabled after that (B). /* This driver doesn't support Gen1 at this point */ (A) if (rsnd_is_gen1(priv)) return 0; (B) node = rsnd_src_of_node(priv); if (!node) return 0; /* not used is not error */ Gen4 DT doesn't have these device settings. (A) check doesn't work for it, but (B) check handling it. Gen1 DT doesn't have these device settings either, and (A) is handling it, but (B) only is very enough. (A) is no longer needed. This patch removes (A) Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://msgid.link/r/87v850a4dl.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-02ASoC: rsnd: R-Car Gen1/Gen2 exceptionKuninori Morimoto1-2/+2
Renesas Sound driver is using rsnd_is_genX() macro to handling difference. We can use "grep rsnd_is_gen" to find-out difference for each SoC today. In general, driver uses flag to handling SoC difference. But in Renesas Sound case, the differences are very specific, if you try to make it general, the code will become be very complicated. Some of them can use flag to handling, but we can find-out all diffence by using "grep rsnd_is_gen" today. It is not so good, but not so bad so far. So we will keep current style for a while. This patch cares Gen1/Gen2 exception by using negative handling to makes no more update for this part when we support Gen5 or later. - if (rsnd_is_gen3() || rsnd_is_gen4() || rsnd_is_gen5() || ...) + if (!rsnd_is_gen1() && !rsnd_is_gen2()) Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://msgid.link/r/87wmpga4ds.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-02ASoC: rsnd: rename rsnd_is_e3() to rsnd_is_gen3_e3()Kuninori Morimoto2-2/+2
Renesas Sound driver is using rsnd_is_genX() macro to handling difference. We can use "grep rsnd_is_gen" to find-out difference for each SoC except rsnd_is_e3(). Let's put same rule for E3 as well. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://msgid.link/r/87y19wa4dy.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>