Commit graph

1699 commits

Author SHA1 Message Date
Linus Torvalds
064d7dcf51 sound updates for 6.3-rc1
The majority of works in this cycle are about ASoC spread over trees.
 Most of them are for new devices and cleanups / refactoring works,
 and not much significant changes are seen in the core side.
 Below are some highlights:
 
 ASoC:
 - Continued refactoring to move into common helper functions
 - Lots of DT schema conversons and stylistic nits
 - Continued work on building out the new SOF IPC4 scheme
 - Continued work for Intel AVS
 - New drivers for Awinc AT88395, Infineon PEB2466, Iron Device
   SMA1303, Mediatek MT8188, Realtek RT712, Renesas IDT821034,
   Samsung/Tesla FSD SoC I2S, and TI TAS5720A-Q1
 
 ALSA:
 - A few cleanups to make the remove callbacks to void returns
 - FireWire refactoring and enhancements
 - PCM kselftest enhancements
 -----BEGIN PGP SIGNATURE-----
 
 iQJCBAABCAAsFiEEIXTw5fNLNI7mMiVaLtJE4w1nLE8FAmPw+kkOHHRpd2FpQHN1
 c2UuZGUACgkQLtJE4w1nLE9X3RAAkxjjtk+BRF+tvS6VYQhezTOE7frSqpxB+ZHm
 KjdQClfpbPqYVD/pUEnz+N68bmOZKK8Ihif+LaaW+8NJJa/1kivQWNCQLCvm7L71
 x7TRkOYvrzlx+Fhpf6JacOM8VaBkRrfd+cK6pQSv8b72ZTWorfenkaC9OMdL2NEY
 YI/sH5zZd6dDoKfQ+WPsplOSCog3KKgAGvn4qEQKxADsyOjsu3rpgijcgDmVc9XT
 y2RMAEPID68TtAtcNhesurLEKZ+4mEDvALQjAsxxb99lfAFDlDBezEO4/dl2v9Db
 yebsEnM+W5z3dVl13Aok9XtVCxrhy7n+v5z060ZEoTxIEJK7YVCWx8XCVL1KSgNV
 31MEVDgf7PrsYAWr54yNF2lmwJh5YchZQ28ngZRHmQ7jMpVbO6ypyIzf77fEQSam
 SiCG7hurSCB38LUb7fg1WsjSRupRamoPDhRG9q7C36ePdeYRkBqOJsSmfABjN/Cb
 v0fixm45PtZpWoZUpLAzNEtkQA665Sf2SoAnAY+kCPllYuNXXHdEomokppffXHbO
 Xbq/wcehpOJKR9vqWhsBuVz34UbGyuM1SBLrNXj+sr24Xv6Uy4E5GcJ75rO1E3TR
 gTGTIM/DtOwTGKyceQ30Gnl9M2wKeP9/qEhkH60XgyzitGp9iAvrIvcU1ODVlfgN
 ZSBzjOk=
 =9s9c
 -----END PGP SIGNATURE-----

Merge tag 'sound-6.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound updates from Takashi Iwai:
 "The majority of works in this cycle are about ASoC spread over trees.
  Most of them are for new devices and cleanups / refactoring works, and
  not much significant changes are seen in the core side.

  Below are some highlights:

  ASoC:

   - Continued refactoring to move into common helper functions

   - Lots of DT schema conversons and stylistic nits

   - Continued work on building out the new SOF IPC4 scheme

   - Continued work for Intel AVS

   - New drivers for Awinc AT88395, Infineon PEB2466, Iron Device
     SMA1303, Mediatek MT8188, Realtek RT712, Renesas IDT821034,
     Samsung/Tesla FSD SoC I2S, and TI TAS5720A-Q1

  ALSA:

   - A few cleanups to make the remove callbacks to void returns

   - FireWire refactoring and enhancements

   - PCM kselftest enhancements"

* tag 'sound-6.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (398 commits)
  ALSA: hda/hdmi: Register with vga_switcheroo on Dual GPU Macbooks
  ASoC: soc-ac97: Return correct error codes
  ASoC: soc-dapm.h: fixup warning struct snd_pcm_substream not declared
  ASoC: cs35l45: Remove separate namespace for tables
  ASoC: cs35l45: Remove separate tables module
  ASoC: soc-ac97: Convert to agnostic GPIO API
  ASoC: dt-bindings: renesas,rsnd.yaml: drop "dmas/dma-names" from "rcar_sound,ssi"
  ALSA: hda: cs35l41: Enable Amp High Pass Filter
  ALSA: hda: cs35l41: Ensure firmware/tuning pairs are always loaded
  ALSA: hda: cs35l41: Correct error condition handling
  ASoC: codecs: wcd934x: Use min macro for comparison and assignment
  ASoC: Intel: Skylake: Fix struct definition
  ASoC: tlv320adcx140: extend list of supported samplerates
  ASoC: imx-pcm-rpmsg: Remove unused variable
  SoC: rt5682s: Disable jack detection interrupt during suspend
  ASoC: SOF: Intel: hda-dsp: Set streaming flag for d0i3
  ASoC: SOF: Intel: Enable d0i3 work for ipc4
  ASoC: SOF: ipc4: Wake up dsp core before sending ipc msg
  ASoC: SOF: Intel: hda-dsp: use set_pm_gate according to ipc version
  ASoC: SOF: Introduce a new set_pm_gate() IPC PM op
  ...
2023-02-22 10:29:05 -08:00
Pierre-Louis Bossart
1f810d2b6b
ASoC: SOF: Intel: hda-dai: fix possible stream_tag leak
The HDaudio stream allocation is done first, and in a second step the
LOSIDV parameter is programmed for the multi-link used by a codec.

This leads to a possible stream_tag leak, e.g. if a DisplayAudio link
is not used. This would happen when a non-Intel graphics card is used
and userspace unconditionally uses the Intel Display Audio PCMs without
checking if they are connected to a receiver with jack controls.

We should first check that there is a valid multi-link entry to
configure before allocating a stream_tag. This change aligns the
dma_assign and dma_cleanup phases.

Complements: b0cd60f3e9 ("ALSA/ASoC: hda: clarify bus_get_link() and bus_link_get() helpers")
Link: https://github.com/thesofproject/linux/issues/4151
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>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230216162340.19480-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-02-16 16:31:15 +00:00
Takashi Iwai
7933b90b42 Merge branch 'for-linus' into for-next
Pull the pending fixes for 6.3

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-02-16 15:06:18 +01:00
Takashi Iwai
1bdb78368f ASoC: Updates for v6.3
There's been quite a lot of activity this release, but not really
 one big feature - lots of new devices, plus a lot of cleanup and
 modernisation work spread throughout the subsystem:
 
  - More factoring out of common operations into helper functions
    by Morimoto-san.
  - DT schema conversons and stylistic nits.
  - Continued work on building out the new SOF IPC4 scheme.
  - Support for Awinc AT88395, Infineon PEB2466, Iron Device
    SMA1303, Mediatek MT8188, Realtek RT712, Renesas IDT821034,
    Samsung/Tesla FSD SoC I2S, and TI TAS5720A-Q1.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmPuKzoACgkQJNaLcl1U
 h9AO6wf/Us32gNLnLhT+YaPKouVq4KYpEXDeaIOdOCgs8RtonuCgURZ/D2TkzBVL
 EHLPp4QgqdIWo3FKkWgsXIOpO7R0//cj/vpccJ0PBe4VmvDinXq3dzGPPy6ZbHAS
 SatE5zItBKRUHaDliRk6S7IFEqJKwwlBqEzV0K41Q4EstYlIe+No0XIVDj3oRjHb
 jPmAD9XRPqsDaFFFb0NrVl9M/8HwBlc3j/Gnt19eJB/07IdgIr0S8mJn3qlFfGqu
 O8KgBo4+tvVMCQAxTVZ5exb/qTtK3gEPDuMi0eOKJz+g9wMJ4tRz+D8/8TQSmxmW
 lWORmNTx8jml7G4KirxIV4q4Lr0hRQ==
 =mB3t
 -----END PGP SIGNATURE-----

Merge tag 'asoc-v6.3' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-next

ASoC: Updates for v6.3

There's been quite a lot of activity this release, but not really
one big feature - lots of new devices, plus a lot of cleanup and
modernisation work spread throughout the subsystem:

 - More factoring out of common operations into helper functions
   by Morimoto-san.
 - DT schema conversons and stylistic nits.
 - Continued work on building out the new SOF IPC4 scheme.
 - Support for Awinc AT88395, Infineon PEB2466, Iron Device
   SMA1303, Mediatek MT8188, Realtek RT712, Renesas IDT821034,
   Samsung/Tesla FSD SoC I2S, and TI TAS5720A-Q1.
2023-02-16 14:32:04 +01:00
Rander Wang
6611b975eb
ASoC: SOF: Intel: hda-dsp: Set streaming flag for d0i3
Enable d0i3 streaming if all the active streams can
work in d0i3 state and playback is enabled.

Signed-off-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230214103345.30669-6-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-02-14 13:25:15 +00:00
Rander Wang
3e6b6ed34b
ASoC: SOF: Intel: Enable d0i3 work for ipc4
Schedule a delayed work for d0i3 entry after every non-pm ipc msg.

Signed-off-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230214103345.30669-5-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-02-14 13:25:14 +00:00
Rander Wang
1c91e927e5
ASoC: SOF: ipc4: Wake up dsp core before sending ipc msg
The driver shall update the power state to D0i0 before sending
a generic IPC. Power-related IPCs are the exception to the rule,
they may be sent even when the power-state is D0i3

Signed-off-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230214103345.30669-4-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-02-14 13:25:13 +00:00
Rander Wang
3c168838fb
ASoC: SOF: Intel: hda-dsp: use set_pm_gate according to ipc version
Use set_pm_gate to unify pm gate setting for different
ipc version.

Signed-off-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230214103345.30669-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-02-14 13:25:12 +00:00
Rander Wang
167ca6a4fd
ASoC: SOF: Introduce a new set_pm_gate() IPC PM op
Set_pm_gate depends on ipc version. This patch defines
the ops for both IPC3 and IPC4.

Signed-off-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230214103345.30669-2-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-02-14 13:25:11 +00:00
Bard Liao
11f605633b
ASoC: SOF: ipc4-topology: set copier sink format
MOD_INIT_INSTANCE IPC for a copier only contains the sink format for
output pin 0. Any additional output pins that are used need to have their
sink format set using the LARGE_CONFIG_SET IPC message.
Otherwise, firmware will report error or crash due to NULL format is used.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230209142123.17193-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-02-09 14:31:17 +00:00
Ranjani Sridharan
b796ff3bf0
ASoC: SOF: ipc4-topology: Print queue IDs in error
Print the queue ID's during bind/unbind errors as well to make it easier
to see what failed exactly.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230209142123.17193-2-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-02-09 14:31:16 +00:00
Rander Wang
5afc7eefe4
ASoC: SOF: ops: refine parameters order in function snd_sof_dsp_update8
SOF driver calls snd_sof_dsp_update8 with parameters mask and value but
the snd_sof_dsp_update8 declares these two parameters in reverse order.
This causes some issues such as d0i3 register can't be set correctly
Now change function definition according to common SOF usage.

Fixes: c28a36b012 ("ASoC: SOF: ops: add snd_sof_dsp_updateb() helper")
Signed-off-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Chao Song <chao.song@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230208104404.20554-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-02-08 11:51:45 +00:00
Mark Brown
700ed3bbb7
ASoC: SOF: core/ipc4/mtl: Add support for PCM delay
Merge series from Peter Ujfalusi <peter.ujfalusi@linux.intel.com>:

The following series adds support for the PCM delay reporting in SOF core level
and implements the needed infrastructure with IPC4 to finally enable it for MTL.

Currently this is only supported on MTL (and via IPC4), but with the
infrastructure in place it will be possible to support other platforms with
DeepBuffer.
2023-02-03 15:07:15 +00:00
Mark Brown
cfe4585d7f
ASoC: (SOF) topology: Regression fixes for next
Merge series from Peter Ujfalusi <peter.ujfalusi@linux.intel.com>:

Today I came across two regressions in next with SOF:

The topology would not load with a failure of creating playback DAI
the first patch is fixing this which was caused by a missing 'else' in the patch

After fixing the topology loading, the module unloading caused kernel panic.
The second patch is correcting that which is I likely caused by copy-paste to
set wrong unload callback for the graph element.

With these patches applied SOF is working on next and modules can be unloaded
2023-02-03 14:43:55 +00:00
Arnd Bergmann
c5a61db9bf
ASoC: SOF: fix intel-soundwire link failure
My randconfig build setup ran into a rare build failure with

CONFIG_SND_SOC_SOF_INTEL_SOUNDWIRE_LINK_BASELINE=y
CONFIG_SND_SOC_SOF_INTEL_SOUNDWIRE=m
CONFIG_SOUNDWIRE=y
CONFIG_SOUNDWIRE_INTEL=m
CONFIG_SND_SOC_SOF_HDA=y
CONFIG_SND_SOC_SOF_INTEL_TGL=y

x86_64-linux-ld: sound/soc/sof/intel/hda.o: in function `hda_init_caps':
hda.c:(.text+0x691): undefined reference to `sdw_intel_cnl_hw_ops'
x86_64-linux-ld: hda.c:(.text+0x6f2): undefined reference to `sdw_intel_probe'
x86_64-linux-ld: sound/soc/sof/intel/hda.o: in function `hda_sdw_startup':
hda.c:(.text+0x1c40): undefined reference to `sdw_intel_startup'
x86_64-linux-ld: sound/soc/sof/intel/hda.o: in function `hda_sdw_process_wakeen':
hda.c:(.text+0x1cb6): undefined reference to `sdw_intel_process_wakeen_event'
x86_64-linux-ld: sound/soc/sof/intel/hda.o: in function `hda_dsp_interrupt_thread':
hda.c:(.text+0x1d67): undefined reference to `sdw_intel_thread'
x86_64-linux-ld: sound/soc/sof/intel/hda.o: in function `hda_dsp_remove':
hda.c:(.text+0x2655): undefined reference to `sdw_intel_exit'

My best understanding is that the definition of
SND_SOC_SOF_INTEL_SOUNDWIRE_LINK_BASELINE was intended to avoid this
problem, but got it wrong for the SND_SOC_SOF_INTEL_SOUNDWIRE=m case,
where the 'select' is meant to set SOUNDWIRE_INTEL to the value of
SND_SOC_SOF_INTEL_SOUNDWIRE_LINK_BASELINE rather than the intersection of
SND_SOC_SOF_INTEL_SOUNDWIRE_LINK_BASELINE and SND_SOC_SOF_INTEL_SOUNDWIRE.

Change the condition to check for SND_SOC_SOF_INTEL_SOUNDWIRE to be a
boolean rather than a tristate expression in order to propagate this
as intended.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20230202102247.806749-1-arnd@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-02-03 12:03:58 +00:00
Rander Wang
3937a76c64
ASoC: SOF: ipc4-pcm: add delay function support
The delay function is used to calculate the difference
between hw_ptr and dai dma position. I2S, DMIC and SDW will
use dai dma position in shared SRAM window to calculate the
delay. HDaudio will retrieve dai dma position from host mmio memory
space since it doesn't support LLP counter reported by firmware.

In two cases dai dma position is inaccurate for delay calculation
(1) dai pipeline is started before host pipeline
(2) multiple streams mixed into one. Each stream has the same dai
    dma position
Firmware calculates correct stream_start_offset for all cases including
above two. Driver subtracts stream_start_offset from dai dma position to
get accurate one.

Signed-off-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230202132954.26773-10-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-02-03 12:03:55 +00:00
Rander Wang
faceb3445a
ASoC: SOF: Intel: mtl: add get_stream_position support
Get HDaudio link position for current stream delay calculation
from hda registers.

Signed-off-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230202132954.26773-9-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-02-03 12:03:54 +00:00
Rander Wang
7f95629727
ASoC: SOF: add get_stream_position ops for pcm delay
PCM delay depends on stream position based on hardware
counter to calculate stream delay so add this ops to get
stream position according to hardware counter.

Signed-off-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230202132954.26773-8-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-02-03 12:03:53 +00:00
Rander Wang
27c2100b6b
ASoC: SOF: add delay function support in sof framework
Sof framework will call specific delay function for
different IPC version.

Signed-off-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230202132954.26773-7-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-02-03 12:03:52 +00:00
Rander Wang
7cb19007ba
ASoC: SOF: ipc4-pcm: add hw_params
Use the hw_params to init time info for ipc4 delay calculation.

Signed-off-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230202132954.26773-6-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-02-03 12:03:51 +00:00
Rander Wang
af74dbd0db
ASoC: SOF: ipc4-pcm: allocate time info for pcm delay feature
Allocate time info when pcm is loaded by topology
and free it when pcm is unloaded by topology.

Signed-off-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230202132954.26773-5-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-02-03 12:03:50 +00:00
Rander Wang
65a8ef494a
ASoC: SOF: add time info structure for ipc4 path
Start_stream_offset is used to strip invalid sample count in dai
for some cases like dai is started before host. llp_offset is used
to get current dai position from memory windows.

Signed-off-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230202132954.26773-4-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-02-03 12:03:49 +00:00
Rander Wang
4700bfb2bb
ASoC: SOF: add fw_info_box support
FW can share some information with host driver, .e.g fw status, pipeline
status and volume status. On ipc4 platform it is located in memory
windows 0 with size of struct sof_ipc4_fw_reg.

With this patch, ipc4 driver can find fw information in fw_info_box

Signed-off-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230202132954.26773-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-02-03 12:03:48 +00:00
Rander Wang
2740dcce91
ASoC: SOF: add ipc4_fw_reg header file
Ipc4_fw_reg defines the content of memory window 0 shared by fw.
Host driver can get fw information by data structure defined in
this file.

Signed-off-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230202132954.26773-2-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-02-03 12:03:48 +00:00
V sujith kumar Reddy
2e7c6652f9
ASoC: SOF: amd: Fix for handling spurious interrupts from DSP
As interrupts are Level-triggered,unless and until we deassert the register
the interrupts are generated which causes spurious interrupts unhandled.

Now we deasserted the interrupt at top half which solved the below
"nobody cared" warning.

warning reported in dmesg:
	irq 80: nobody cared (try booting with the "irqpoll" option)
	CPU: 5 PID: 2735 Comm: irq/80-AudioDSP
		Not tainted 5.15.86-15817-g4c19f3e06d49 #1 1bd3fd932cf58caacc95b0504d6ea1e3eab22289
	Hardware name: Google Skyrim/Skyrim, BIOS Google_Skyrim.15303.0.0 01/03/2023
	Call Trace:
	<IRQ>
	dump_stack_lvl+0x69/0x97
	 __report_bad_irq+0x3a/0xae
	note_interrupt+0x1a9/0x1e3
	handle_irq_event_percpu+0x4b/0x6e
	handle_irq_event+0x36/0x5b
	handle_fasteoi_irq+0xae/0x171
	 __common_interrupt+0x48/0xc4
	</IRQ>

	handlers:
	acp_irq_handler [snd_sof_amd_acp] threaded [<000000007e089f34>] acp_irq_thread [snd_sof_amd_acp]
	Disabling IRQ #80

Signed-off-by: V sujith kumar Reddy <Vsujithkumar.Reddy@amd.com>
Link: https://lore.kernel.org/r/20230203123254.1898794-1-Vsujithkumar.Reddy@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-02-02 15:37:28 +00:00
Peter Ujfalusi
afd7c141c7
ASoC: SOF: topology: Add missed "else" in sof_connect_dai_widget
The conversion to use generic helpers missed the else for the dai
direction check which leads to failure when loading playback widgets

Fixes: 323f09a61d ("ASoC: sof: use helper function")
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/20230201112846.27707-2-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-02-02 11:09:46 +00:00
Kuninori Morimoto
323f09a61d
ASoC: sof: use helper function
Current ASoC has many helper function.
This patch use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87o7qfea3f.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-01-31 11:05:05 +00:00
Peter Ujfalusi
251a2b1185
ASoC: SOF: ipc4-pcm: Do not run the trigger pipelines if no spipe is stored
If the pipeline setup fails at the first widget/pipeline then we will have
no spipe stored under the pipeline_list->pipelines, the
pipeline_list->count is 0.

If this is the case we would have a NULL pointer dereference if the
execution is allowed to proceed.

Check for this condition along with the pipeline_list->pipelines check

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20230127120031.10709-19-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-01-27 12:14:13 +00:00
Peter Ujfalusi
f94f391527
ASoC: SOF: Protect swidget->use_count with mutex for kcontrol access race
The use_count of the swidget is protect by ALSA core PCM locking with the
exception when an associated kcontrol is changed.

It has been observed that a rightly timed kcontrol access during stream
stop can result of an attempt to send a control update to a widget which
has been freed up between the check of the use_count and the message
sending.

We need to protect the entire sof_widget_setup() and sof_widget_free()
execution to make it safe to rely on the use_count.
Move the code under an _unlocked() function and use a mutex to protect
the execution of the functions for concurrency.
On the control path we need to use the lock only for the kcontrol access,
the widget_kcontrol_setup() op is called with the lock already held.

Reported-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20230127120031.10709-18-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-01-27 12:14:12 +00:00
Peter Ujfalusi
955a6f131a
ASoC: SOF: Avoid double decrementing use_count in sof_widget_setup on error
The sof_widget_free() on the error path will decrement the use count and if
we jump to widget_free: then the use_count will be decremented by two,
which is not correct as we only incremented once with 1.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20230127120031.10709-17-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-01-27 12:14:12 +00:00
Ranjani Sridharan
6bc4d1b714
ASoC: SOF: ipc4-topology: Protect pipeline free with mutex
When starting/stopping multiple streams in parallel, pipeline triggers
and pipeline frees can get interleaved. So use the same mutex used for
pipeline trigger to protect the pipeline frees as well. Rename the
trigger_mutex to pipeline_state_mutex for more clarity.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230127120031.10709-16-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-01-27 12:14:11 +00:00
Ranjani Sridharan
32c4b69872
ASoC: SOF: ipc4-pcm: Implement pipeline trigger reference counting
Use the started_count and paused_count to implement reference counting
when making decisions to start/stop/pause pipelines during the FE DAI
trigger. This is necessary to trigger the shared pipelines in the FE DAI
trigger properly.

With IPC4, the FE trigger will issue multiple pipeline state changes,
and the triggers are propagated downstream to connected pipelines by
the SOF driver - not the firmware. This creates a window for race
conditions where an FE trigger preempts another one, which results
in inconsistent pipeline states and refcounts.

This patch introduces a mutex lock for the pcm trigger that guarantees
that IPC4 state and resources are accessed in a serialized manner.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@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>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230127120031.10709-15-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-01-27 12:14:10 +00:00
Ranjani Sridharan
6f9eb19a33
ASoC: SOF: ipc4-pcm: Rename 'data' variable to trigger_list
For more clarity, rename the struct ipc4_pipeline_set_state_data
variable to trigger_list instead of data. No functionality change.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@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>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230127120031.10709-14-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-01-27 12:14:09 +00:00
Ranjani Sridharan
9c04363d22
ASoC: SOF: Introduce struct snd_sof_pipeline
Introduce struct snd_sof_pipeline to save the information about
pipelines including the pipeline widget, their status wrt how many PCM's
are using them and whether they are complete or not.

In struct snd_sof_widget, replace pipe_widget with spipe and remove
complete. In struct snd_sof_pcm_stream_pipeline_list, replace
pipe_widgets with pipelines.

Update all users accordingly.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@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>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230127120031.10709-13-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-01-27 12:14:08 +00:00
Ranjani Sridharan
2d271af1af
ASoC: SOF: ipc4-pcm: Use the PCM stream's pipeline_info during trigger
Use the list of pipelines in the PCM stream's pipeline info to trigger
the pipelines in the right order. Add a helper for triggering pipelines
in batch mode that will be used to trigger multiple pipelines at the
same time.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Libin Yang <libin.yang@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230127120031.10709-12-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-01-27 12:14:07 +00:00
Ranjani Sridharan
19137532db
ASoC: SOF: sof-audio: Populate the PCM stream pipeline_info
Populate the pipeline_info for the PCM stream with the list of pipeline
widgets that need to be handled during the PCM trigger. This will be
used in the IPC-specific PCM trigger op to trigger the pipelines.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Libin Yang <libin.yang@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230127120031.10709-11-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-01-27 12:14:06 +00:00
Ranjani Sridharan
37a26eec53
ASoC: SOF: ipc4: Add flag to skip triggering pipelines during FE DAI trigger
Add a new flag, skip_during_fe_trigger, to struct sof_ipc4_pipeline to
skip triggering pipelines in the FE DAI trigger. Set this flag for the
HDA DAI BE pipelines so that their BE pipeline will not be triggered in
the FE DAI trigger. Also, move the trigger handling for all commands
include START/PAUSE_RELEASE for the HDA DAI's to the backend DAI trigger
ops.

For the SSP/DMIC/SDW cases, remove the BE DAI trigger as they involve no
DMA operations and can be triggered in the FE DAI trigger. This is in
preparation to perform batch triggering of all pipelines for the non-HDA
case.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Libin Yang <libin.yang@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230127120031.10709-10-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-01-27 12:14:05 +00:00
Ranjani Sridharan
ba223b3ad0
ASoC: SOF: ipc4-pcm: Define pcm_setup/free ops
Define the pcm_setup/pcm_free ops for IPC4. Define a new struct
snd_sof_pcm_stream_trigger_info and add a new field trigger_info of this
type to struct snd_sof_pcm_stream. This will be used to save the list of
pipelines that need to be triggered.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Libin Yang <libin.yang@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230127120031.10709-9-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-01-27 12:14:04 +00:00
Ranjani Sridharan
7201a3d47e
ASoC: SOF: Introduce PCM setup/free PCM IPC ops
These will be used to perform IPC-specific PCM setup/free.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Libin Yang <libin.yang@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230127120031.10709-8-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-01-27 12:14:04 +00:00
Ranjani Sridharan
e380c90710
ASoC: SOF: topology: Set IPC-specific trigger order for DAI links
Add a new topology IPC op to set up DAI links and set the link trigger
order to match the expectation based on the IPC type. Note that the
link_setup op implementations for IPC3 and IPC4 are not identical and
have contrasting trigger orders for playback and capture.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-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>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230127120031.10709-7-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-01-27 12:14:03 +00:00
Ranjani Sridharan
82b18242ae
ASoC: SOF: pcm: do not free widgets during suspend trigger
IPC3 and IPC4 have different requirements for the order in which the FE
CPU and BE CPU DAI trigger callbacks must be invoked. With a regular PCM
start/stop, pipeline widgets are set up during hw_params and freed
during hw_free.

But when the system is suspended when a PCM is running,
pipeline widgets are freed during the SUSPEND trigger callback for the
FE CPU DAI. In order to avoid freeing the pipeline widgets before the BE
CPU DAI trigger is executed, the trigger order was modified in previous
contributions in the PCM dai_link_fixup callback to make sure that the BE
CPU DAI trigger stop/suspend is always invoked before the FE CPU DAI
trigger. But this contradicts the firmware requirement for IPC4 w.r.t.
ordering of pipeline triggers.

So, remove the freeing of pipeline widgets during FE CPU DAI suspend
trigger and handle it during system suspend when the
tear_down_all_pipelines() IPC op is invoked. This will be followed up
with a patch to fix the trigger order for IPC4.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-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>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230127120031.10709-6-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-01-27 12:14:02 +00:00
Ranjani Sridharan
4639029b04
ASoC: SOF: sof-audio: Only process widgets in the connected widget list
When walking the list of the widgets from the source to the sink, we
accidentally also end up preparing/setting up the widgets that are not
in the list of connected DAPM widgets associated with the PCM. Avoid
this by checking if a widget is part of the connected DAPM widget list
during widget prepare, unprepare, setup or free.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230127120031.10709-5-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-01-27 12:14:01 +00:00
Ranjani Sridharan
73ea660947
ASoC: SOF: sof-audio: Set up/free DAI/AIF widgets only once
Calling the sof_widget_setup/free() for the DAI/AIF widgets inside the
snd_soc_dapm_widget_for_each_sink_path() loop will end up setting up or
freeing the widget multiple times if there are multiple paths leaving
the widget. Fix this by moving the widget setup/free for the starting
widget in each path outside the loop.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230127120031.10709-4-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-01-27 12:14:00 +00:00
Ranjani Sridharan
9a62d87ace
ASoC: SOF: ipc4-topology: No need to unbind routes within a pipeline
The FW currently ignores unbinding routes if the source and sink widgets
belong to the same pipeline. So no need to send the IPC at all in the
first place.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230127120031.10709-2-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-01-27 12:13:58 +00:00
Bard Liao
0390a102cc
ASoC: SOF: ipc4-topology: use different channel mask for each sdw amp feedback
Currently, we use the same channel mask for aggregated speakers.
It works fine for playback because we duplicate the audio data for all
aggregated speakers. But we need to get audio data from each aggregated
speaker and combine them to the captured audio. So we need to set
non-overlapping channel mask for aggregated ALH DAIs.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230125141317.30302-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-01-26 13:32:46 +00:00
Bard Liao
7d573425d8
ASoC: SOF: ipc4-topology: add buffer type support
The corresponding IPC4 module of snd_soc_dapm_buffer widget is module
-to-module copier.
The module-to-module copier is a buffer-like component with demuxing
capabilities.
Rename the host_token_list to common_copier_token_list since it will
be used by host copier and module-to-module copier.
The setup callback is almost the same as sof_ipc4_widget_setup_pcm except
the gtw_cfg data, and the free callback is exactly the same as
sof_ipc4_widget_free_comp_pcm. To reduce the duplication, the commit
reuses the setup and free callbacks.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230126110637.25542-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-01-26 13:32:44 +00:00
Peter Ujfalusi
fb4293600c
ASoC: SOF: sof-audio: prepare_widgets: Check swidget for NULL on sink failure
If the swidget is NULL we skip the preparing of the widget and jump to
handle the sink path of the widget.
If the prepare fails in this case we would undo the prepare but the swidget
is NULL (we skipped the prepare for the widget).

To avoid NULL pointer dereference in this case we must check swidget
against NULL pointer once again.

Fixes: 0ad84b11f2 ("ASoC: SOF: sof-audio: skip prepare/unprepare if swidget is NULL")
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20230120102125.30653-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-01-20 14:09:56 +00:00
Dan Carpenter
ea57680af4
ASoC: SOF: ipc4-mtrace: prevent underflow in sof_ipc4_priority_mask_dfs_write()
The "id" comes from the user.  Change the type to unsigned to prevent
an array underflow.

Fixes: f4ea22f7aa ("ASoC: SOF: ipc4: Add support for mtrace log extraction")
Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/Y8laruWOEwOC/dx9@kili
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-01-20 11:51:47 +00:00
Mark Brown
ae7c40bc2c
Add support to compress API to ipc_msg_data /
Merge series from Daniel Baluta <daniel.baluta@oss.nxp.com>:

This patch series adds compress API support to ipc_msg_data /
set_stream_data_offset callbacks.

Changes since v1:
	- fixed reviewed-by list (+Peter, -Pierre). Since github had
	  some glitches I added the reviews received manually in the
          commits.
	- Github PR link: https://github.com/thesofproject/linux/pull/4133

Daniel Baluta (4):
  ASoC: SOF: Prepare ipc_msg_data to be used with compress API
  ASoC: SOF: Prepare set_stream_data_offset for compress API
  ASoC: SOF: Add support for compress API for stream data/offset
  ASoC: SOF: compress: Set compress data offset

 sound/soc/sof/amd/acp-ipc.c            |  8 ++--
 sound/soc/sof/amd/acp.h                |  5 ++-
 sound/soc/sof/compress.c               |  9 +++++
 sound/soc/sof/intel/hda-ipc.c          |  8 ++--
 sound/soc/sof/intel/hda.h              |  4 +-
 sound/soc/sof/ipc3-pcm.c               |  3 +-
 sound/soc/sof/ipc3.c                   |  4 +-
 sound/soc/sof/mediatek/mt8186/mt8186.c |  2 +-
 sound/soc/sof/mediatek/mt8195/mt8195.c |  2 +-
 sound/soc/sof/ops.h                    |  8 ++--
 sound/soc/sof/sof-priv.h               | 11 ++++--
 sound/soc/sof/stream-ipc.c             | 53 +++++++++++++++++++-------
 12 files changed, 81 insertions(+), 36 deletions(-)

--
2.25.1
2023-01-18 15:45:21 +00:00
Mark Brown
309d401452
ASoC: Merge up 6.2 fixes
To resolve a conflict and support further development.
2023-01-18 15:33:51 +00:00