Commit Graph

30952 Commits

Author SHA1 Message Date
Jack Yu
140e0762ca
ASoC: rt722-sdca: add headset microphone vrefo setting
Add vrefo settings to fix jd and headset mic recording issue.

Signed-off-by: Jack Yu <jack.yu@realtek.com>
Link: https://msgid.link/r/727219ed45d3485ba8f4646700aaa8a8@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-09 19:21:39 +01:00
Jack Yu
cb9946971d
ASoC: rt722-sdca: modify channel number to support 4 channels
Channel numbers of dmic supports 4 channels, modify channels_max
regarding to this issue.

Signed-off-by: Jack Yu <jack.yu@realtek.com>
Link: https://msgid.link/r/6a9b1d1fb2ea4f04b2157799f04053b1@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-09 19:21:38 +01:00
Vijendar Mukunda
56437a561f
ASoC: amd: fix for soundwire build dependencies for legacy stack
The SND_SOC_AMD_SOUNDWIRE Kconfig symbol has build dependency on
SOUNDWIRE_AMD. It gets it wrong for a configuration involving
SND_SOC_AMD_SOUNDWIRE_LINK_BASELINE=y,SND_SOC_AMD_PS=y and SOUNDWIRE_AMD=m,
which results in a link failure:

ld: vmlinux.o: in function `amd_sdw_probe':
>> sound/soc/amd/ps/pci-ps.c:271:(.text+0x1d51eff):
	undefined reference to `sdw_amd_probe'
ld: vmlinux.o: in function `acp63_sdw_machine_select':
>> sound/soc/amd/ps/pci-ps.c:294:(.text+0x1d525d5):
	undefined reference to `sdw_amd_get_slave_info'
ld: vmlinux.o: in function `amd_sdw_exit':
>> sound/soc/amd/ps/pci-ps.c:280:(.text+0x1d538ce):
	undefined reference to `sdw_amd_exit'

Add a top level check config that forbids any of the AMD ACP drivers
with version >= 6.3 from being built-in with CONFIG_SOUNDWIRE_AMD=m.
Move SND_AMD_ACP_CONFIG common dependency config to
SND_SOC_AMD_ACP63_TOPLEVEL config.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202404061257.khJml82D-lkp@intel.com/
Fixes: a806793f23 ("ASoC: amd: simplify soundwire dependencies for legacy stack")
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://msgid.link/r/20240408180229.3287220-1-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-09 18:14:18 +01:00
Bastien Curutchet
08e02fa484
ASoC: ti: davinci-i2s: Add T1 framing support
McBSP's data delay can be configured from 0 to 2 bit clock periods. 0 is
used for DSP_B format, 1 is used for DSP_A format, 2 is unused.

A data delay of 2 bit clock periods can be used to interface to
'T1 framing' devices where data stream is preceded by a 'framing bit'. On
transmission, McBSP inserts a blank period (high-impedance period)
before the first data bit to leave an opportunity for other devices to
set this 'framing bit'. On reception, McBSP discards the 'framing bit'
that precedes the data stream.

Add support for the 'framing bit' according to the
'ti,T1-framing-[tx/rx]' device-tree properties. If a flag is present,
the data delay is set to 2 bit clock periods regardless of the selected
DAI format.

Signed-off-by: Bastien Curutchet <bastien.curutchet@bootlin.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@gmail.com>
Link: https://msgid.link/r/20240402071213.11671-14-bastien.curutchet@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-09 16:58:43 +01:00
Bastien Curutchet
92e7bb2b6a
ASoC: ti: davinci-i2s: Add S24_LE to supported formats
S24_LE is supported by McBSP but not by the driver.

Add S24_LE to driver's supported formats. Using it enables the sign
extension in DRR (Data Receive Register). The other formats are kept
with the zero extension in DRR.

Remove data_type table as it is no longer used.

Signed-off-by: Bastien Curutchet <bastien.curutchet@bootlin.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@gmail.com>
Link: https://msgid.link/r/20240402071213.11671-12-bastien.curutchet@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-09 16:58:41 +01:00
Bastien Curutchet
091b440ffd
ASoC: ti: davinci-i2s: Link free-run mode to SND_SOC_DAIFMT_[GATED/CONT]
McBSP has free-running mode where serial clocks continue to run during
emulation halts. This mode is always enabled by the driver.

Set free-running mode when SND_SOC_DAIFMT_CONT is selected by DAI
format, unset it when SND_SOC_DAIFMT_GATED is selected.

Signed-off-by: Bastien Curutchet <bastien.curutchet@bootlin.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@gmail.com>
Link: https://msgid.link/r/20240402071213.11671-11-bastien.curutchet@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-09 16:58:41 +01:00
Bastien Curutchet
94d57c541d
ASoC: ti: davinci-i2s: Enable unexpected frame pulses detection
McBSP can generate a SYNCERR when unexpected frame pulses are
detected. The driver always disables this feature and ignore the
unexpected frame pulses.

Enable the generation of SYNCERR by the McBSP. Unexpected frame
pulses are not ignored anymore.

Signed-off-by: Bastien Curutchet <bastien.curutchet@bootlin.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@gmail.com>
Link: https://msgid.link/r/20240402071213.11671-10-bastien.curutchet@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-09 16:58:40 +01:00
Bastien Curutchet
eff21f5f8e
ASoC: ti: davinci-i2s: Add handling of BP_FC format
McBSP is able to drive bit clock and consume frame clock but BP_FC
format is not handled by McBSP driver.

Add BP_FC format support.
When BP_FC is selected:
  - CLKX and CLKR are configured as outputs
  - The sample rate generator is configured to be able to provide bit
    clock.

Signed-off-by: Bastien Curutchet <bastien.curutchet@bootlin.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@gmail.com>
Link: https://msgid.link/r/20240402071213.11671-9-bastien.curutchet@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-09 16:58:39 +01:00
Bastien Curutchet
37e313cda3
ASoC: ti: davinci-i2s: Add TDM support
TDM is not supported by the McBSP driver. The McBSP datasheet does not
name explicitly TDM as a supported format but it is possible to configure
the McBSP to do TDM if all slots are used by McBSP.

Add TDM support. It uses single-phase frame. Slot width is used to
compute the McBSP's word length.

Implement the set_tdm_slot() hook of snd_soc_dai_ops struct. It only
supports TDM if all slots are used by McBSP.

The snd_soc_dai_driver's channels_max is updated from 2 to 128.

This was tested with BP_FC format on a platform designed off of
DAVINCI/OMAP_L138. A check is done in davinci_i2s_set_dai_fmt() to
prevent TDM to be used with BC_FC and BC_FP formats.

Signed-off-by: Bastien Curutchet <bastien.curutchet@bootlin.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@gmail.com>
Link: https://msgid.link/r/20240402071213.11671-8-bastien.curutchet@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-09 16:58:38 +01:00
Bastien Curutchet
7dd7a6d264
ASoC: ti: davinci-i2s: Delete unnecessary assignment
In davinci_i2s_hw_params(), mcbsp_word_length is set twice to
asp_word_length[fmt].

Remove second unnecessary assignment.

Signed-off-by: Bastien Curutchet <bastien.curutchet@bootlin.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@gmail.com>
Link: https://msgid.link/r/20240402071213.11671-7-bastien.curutchet@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-09 16:58:37 +01:00
Bastien Curutchet
714ffb8d36
ASoC: ti: davinci-i2s: Use external clock to drive sample rate generator
McBSP's internal sample rate generator can be programed to be driven by
its internal clock or by an external clock source located on CLKS pin.
The external clock source case is not handled by the driver.

Handle an optional clock related to this external clock source. If
present, the driver uses the clock located on CLKS pin as input for the
sample rate generator. Thus, the external clock rate is used to compute
divisors. If this optional clock is not present, the sample rate
generator is driven by the McBSP's functional clock.

Signed-off-by: Bastien Curutchet <bastien.curutchet@bootlin.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@gmail.com>
Link: https://msgid.link/r/20240402071213.11671-6-bastien.curutchet@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-09 16:58:36 +01:00
Bastien Curutchet
6b1517b30d
ASoC: ti: davinci-i2s: Replace dev_err with dev_err_probe
In probe(), the dev_err() is used for every returned error.

Replace dev_err() with dev_err_probe() where -EPROBE_DEFER can be
returned.

Signed-off-by: Bastien Curutchet <bastien.curutchet@bootlin.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@gmail.com>
Link: https://msgid.link/r/20240402071213.11671-5-bastien.curutchet@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-09 16:58:35 +01:00
Bastien Curutchet
904fb8f843
ASoC: ti: davinci-i2s: Remove the unused clk_input_pin attribute
The clk_input_pin attribute of davinci_mcbsp_dev struct is not set since
commit 257ade78b6 ("ASoC: davinci-i2s: Convert to use edma-pcm").

Remove the attribute.
Keep the behaviour of the MCBSP_CLKR case as MCBSP_CLKR == 0.
I can't test the BC_FP format so I added back the initial comment that
was removed by commit ec63755337 ("ASoC: DaVinci: Added selection of
clk input pin for McBSP"). This was the last dependency to
linux/platform_data/davinci_asp.h so it is not included anymore.

Remove the enum mcbsp_clk_input_pin from davinci_asp.h as it is not used
anywhere else.

Signed-off-by: Bastien Curutchet <bastien.curutchet@bootlin.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@gmail.com>
Link: https://msgid.link/r/20240402071213.11671-4-bastien.curutchet@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-09 16:58:34 +01:00
Derek Fang
103abab975
ASoC: rt5645: Fix the electric noise due to the CBJ contacts floating
The codec leaves tie combo jack's sleeve/ring2 to floating status
default. It would cause electric noise while connecting the active
speaker jack during boot or shutdown.
This patch requests a gpio to control the additional jack circuit
to tie the contacts to the ground or floating.

Signed-off-by: Derek Fang <derek.fang@realtek.com>

Link: https://msgid.link/r/20240408091057.14165-1-derek.fang@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-09 16:40:48 +01:00
end.to.start
4b9a474c7c
ASoC: acp: Support microphone from device Acer 315-24p
This patch adds microphone detection for the Acer 315-24p, after which a microphone appears on the device and starts working

Signed-off-by: end.to.start <end.to.start@mail.ru>
Link: https://msgid.link/r/20240408152454.45532-1-end.to.start@mail.ru
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-09 16:40:47 +01:00
Geert Uytterhoeven
9fd60615ad
ASoC: codecs: Rockchip on-SoC codecs should depend on ARCH_ROCKCHIP
The various Rockchip embedded audio codecs are only present on Rockchip
SoCs.  Hence add dependencies on ARCH_ROCKCHIP, to prevent asking the
user about these drivers when configuring a kernel without Rockchip SoC
support.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://msgid.link/r/6cdbaf4afcf4d2059b257f6cb3a8a61bf5e17688.1712676714.git.geert+renesas@glider.be
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-09 16:38:42 +01:00
Pierre-Louis Bossart
17f4041244
ASoC: SOF: debug: show firmware/topology prefix/names
The SOF driver has multiple profiles to select firmware/topology
prefix/names depending on the platform and ipc_type, and each of those
fields can be overridden with kernel parameters. This results in some
cases in confusion on what configuration is actually used in a given
test.

We currently log the firmware and topology names in the kernel logs,
but there's been an ask to add the information in debugfs to simplify
test scripts used by developers and CI.

This isn't meant to be a stable ABI used by apps, changes will be
allowed as needed.

Closes: https://github.com/thesofproject/linux/issues/3867
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://msgid.link/r/20240408194147.28919-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-09 14:03:35 +01:00
Ranjani Sridharan
90a2353080
ASoC: SOF: pcm: Restrict DSP D0i3 during S0ix to IPC3
Introduce a new field in struct sof_ipc_pcm_ops that can be used to
restrict DSP D0i3 during S0ix suspend to IPC3. With IPC4, all streams
must be stopped before S0ix suspend.

Reviewed-by: Uday M Bhat <uday.m.bhat@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@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/20240408194147.28919-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-09 14:03:34 +01:00
Pierre-Louis Bossart
305539a25a
ASoC: SOF: Intel: add default firmware library path for LNL
The commit cd6f2a2e63 ("ASoC: SOF: Intel: Set the default firmware
library path for IPC4") added the default_lib_path field for all
platforms, but this was missed when LunarLake was later introduced.

Fixes: 64a63d9914 ("ASoC: SOF: Intel: LNL: Add support for Lunarlake platform")
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://msgid.link/r/20240408194147.28919-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-09 14:03:33 +01:00
Peter Ujfalusi
61faefa220
ASoC: SOF: Intel: lnl: Add fw_regs area to debugfs map
Expose the firmware registers via debugfs. it can be of great help while
debugging complex issues.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240409113349.21623-4-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-09 13:24:21 +01:00
Peter Ujfalusi
d33a369dda
ASoC: SOF: Intel: mtl: Add fw_regs area to debugfs map
Expose the firmware registers via debugfs. it can be of great help while
debugging complex issues.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240409113349.21623-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-09 13:24:20 +01:00
Peter Ujfalusi
25ab9c40e7
ASoC: SOF: Intel: tgl: Add fw_regs area to debugfs map for IPC4
Expose the firmware registers via debugfs. it can be of great help while
debugging complex issues.
The area is only available with IPC4.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240409113349.21623-2-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-09 13:24:19 +01:00
Peter Ujfalusi
7211814f2a
ASoC: SOF: ipc4-pcm: Do not reset the ChainDMA if it has not been allocated
The ChainDMA operation differs from normal pipelines that it is only
created when the stream started, in fact a PCM using ChainDMA has no
pipelines, modules.
To reset a ChainDMA, it needs to be first allocated in firmware. When
PulseAudio/PipeWire starts, they will probe the PCMs by opening them, check
hw_params and then close the PCM without starting audio.
Unconditionally resetting the ChainDMA can result the following error:

ipc tx      : 0xe040000|0x0: GLB_CHAIN_DMA
ipc tx reply: 0x2e000007|0x0: GLB_CHAIN_DMA
FW reported error: 7 - Unsupported operation requested
ipc error for msg 0xe040000|0x0
sof_pcm_stream_free: pcm_ops hw_free failed -22

Add a new chain_dma_allocated flag to sof_ipc4_pcm_stream_priv to store the
ChainDMA allocation state and use this flag to skip sending the reset if
the ChainDMA is not allocated.

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://msgid.link/r/20240409110036.9411-5-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-09 13:24:04 +01:00
Peter Ujfalusi
551af3280c
ASoC: SOF: ipc4-pcm: Introduce generic sof_ipc4_pcm_stream_priv
Using the sof_ipc4_timestamp_info struct directly as sps->private data
is too restrictive, add a new generic sof_ipc4_pcm_stream_priv struct
containing the time_info to allow new information to be stored in a
generic way.

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://msgid.link/r/20240409110036.9411-4-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-09 13:24:03 +01:00
Peter Ujfalusi
36e980050b
ASoC: SOF: ipc4-pcm: Use consistent name for sof_ipc4_timestamp_info pointer
The pointer to sof_ipc4_timestamp_info named most of the time as
'time_info' only to be named as 'stream_info' or 'info' in two function.

Use the consistent name of 'time_info' throughout the file.

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://msgid.link/r/20240409110036.9411-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-09 13:24:02 +01:00
Peter Ujfalusi
965e49cdf8
ASoC: SOF: ipc4-pcm: Use consistent name for snd_sof_pcm_stream pointer
Throughout the file the pointer for snd_sof_pcm_stream is named either
'stream' or (wrongly) 'spcm' which confuses the reader.

Use 'sps' for the pointer name as it is the most common name used in SOF
codebase.

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://msgid.link/r/20240409110036.9411-2-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-09 13:24:01 +01:00
Dan Carpenter
9cb83ed19b
ASoC: Intel: sof_rt5682: Fix uninitialized variable in probe
Initialize "is_legacy_cpu" to false to prevent an uninitialized variable
bug.

Fixes: 8efcd48646 ("ASoC: Intel: sof_rt5682: use common module for sof_card_private initialization")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/6e16433f-1897-46a2-b3ee-e177e7d846b8@moroto.mountain
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-08 18:33:33 +01:00
Richard Fitzgerald
dfd2ffb373
ASoC: cs35l56: Prevent overwriting firmware ASP config
Only populate the ASP1 config registers in the regmap cache if the
ASP DAI is used. This prevents regcache_sync() from overwriting
these registers with their defaults when the firmware owns
control of these registers.

On a SoundWire system the ASP could be owned by the firmware to
share reference audio with the firmware on other cs35l56. Or it
can be used as a normal codec-codec interface owned by the driver.
The driver must not overwrite the registers if the firmware has
control of them.

The original implementation for this in commit 07f7d6e7a1
("ASoC: cs35l56: Fix for initializing ASP1 mixer registers") was
to still provide defaults for these registers, assuming that if
they were never reconfigured from defaults then regcache_sync()
would not write them out because they are not dirty. Unfortunately
regcache_sync() is not that smart. If the chip has not reset (so
the driver has not called regcache_mark_dirty()) a regcache_sync()
could write out registers that are not dirty.

To avoid accidental overwriting of the ASP registers, they are
removed from the table of defaults and instead are populated with
defaults only if one of the ASP DAI configuration functions is
called. So if the DAI has never been configured, the firmware is
assumed to have ownership of these registers, and the regmap cache
will not contain any entries for them.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Fixes: 07f7d6e7a1 ("ASoC: cs35l56: Fix for initializing ASP1 mixer registers")
Link: https://msgid.link/r/20240408101803.43183-5-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-08 14:10:01 +01:00
Richard Fitzgerald
d4884fd48a
ASoC: cs35l56: Fix unintended bus access while resetting amp
Use the new regmap_read_bypassed() so that the regmap can be left
in cache-only mode while it is booting, but the driver can still
read boot-status and chip-id information during this time.

This fixes race conditions where some writes could be issued to the
silicon while it is still rebooting, before the driver has determined
that the boot is complete.

This is typically prevented by putting regmap into cache-only until the
hardware is ready. But this assumes that the driver does not need to
access device registers to determine when it is "ready". For cs35l56
this involves polling a register and the original implementation relied
on having special handlers to block racing callbacks until dsp_work()
is complete. However, some cases were missed, most notably the ASP DAI
functions.

The regmap_read_bypassed() function allows the fix for this to be
simplified to putting regmap into cache-only during the reset. The
initial boot stages (poll HALO_STATE and read the chip ID) are all done
bypassed. Only when the amp is seen to be booted is the cache-only
revoked.

Changes are:
- cs35l56_system_reset() now leaves the regmap in cache-only status.

- cs35l56_wait_for_firmware_boot() polls using regmap_read_bypassed().

- cs35l56_init() revokes cache-only either via cs35l56_hw_init() or
  when firmware has rebooted after a soft reset.

- cs35l56_hw_init() exits cache-only after it has determined that the
  amp has booted.

- cs35l56_sdw_init() doesn't disable cache-only, since this must be
  deferred to cs35l56_init().

- cs35l56_runtime_resume_common() waits for firmware boot before exiting
  cache-only.

These changes cover three situations where the registers are not
accessible:

1) SoundWire first-time enumeration. The regmap is kept in cache-only
   until the chip is fully booted. The original code had to exit
   cache-only to read chip status in cs35l56_init() and cs35l56_hw_init()
   but this is now deferred to after the firmware has rebooted.

   In this case cs35l56_sdw_probe() leaves regmap in cache-only
   (unchanged behaviour) and cs35l56_hw_init() exits cache-only after the
   firmware is booted and the chip identified.

2) Soft reset during first-time initialization. cs35l56_init() calls
   cs35l56_system_reset(), which puts regmap into cache-only.
   On I2C/SPI cs35l56_init() then flows through to call
   cs35l56_wait_for_firmware_boot() and exit cache-only. On SoundWire
   the re-enumeration will enter cs35l56_init() again, which then drops
   down to call cs35l56_wait_for_firmware_boot() and exit cache-only.

3) Soft reset after firmware download. dsp_work() calls
   cs35l56_system_reset(), which puts regmap into cache-only. After this
   the flow is the same as (2).

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Fixes: 8a731fd37f ("ASoC: cs35l56: Move utility functions to shared file")
Link: https://msgid.link/r/20240408101803.43183-4-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-08 14:10:00 +01:00
Mohammad Rafi Shaik
5485c3fa96
ASoC: qcom: sc8280xp: Add support for QCM6490 and QCS6490
Add compatibles for sound card on Qualcomm QCM6490 IDP and
QCS6490 RB3Gen2 boards.

Signed-off-by: Mohammad Rafi Shaik <quic_mohs@quicinc.com>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://msgid.link/r/20240408042331.403103-3-quic_mohs@quicinc.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-08 13:39:00 +01:00
Hans de Goede
e50729d742
ASoC: Intel: bytcr_rt5640: Apply Asus T100TA quirk to Asus T100TAM too
The Asus T100TA quirk has been using an exact match on a product-name of
"T100TA" but there are also T100TAM variants with a slightly higher
clocked CPU and a metal backside which need the same quirk.

Sort the existing T100TA (stereo speakers) below the more specific
T100TAF (mono speaker) quirk and switch from exact matching to
substring matching so that the T100TA quirk will also match on
the T100TAM models.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://msgid.link/r/20240407191559.21596-1-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-08 13:38:47 +01:00
Sameer Pujar
2e93a29b48
ASoC: tegra: Fix DSPK 16-bit playback
DSPK configuration is wrong for 16-bit playback and this happens because
the client config is always fixed at 24-bit in hw_params(). Fix this by
updating the client config to 16-bit for the respective playback.

Fixes: 327ef64702 ("ASoC: tegra: Add Tegra186 based DSPK driver")
Cc: stable@vger.kernel.org
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Acked-by: Thierry Reding <treding@nvidia.com>
Link: https://msgid.link/r/20240405104306.551036-1-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-08 13:38:46 +01:00
Cezary Rojewski
7a1625c171
ASoC: Intel: avs: Fix debug window description
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 <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202404070100.i3t3Jf7d-lkp@intel.com/
Fixes: 275b583d04 ("ASoC: Intel: avs: ICL-based platforms support")
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://msgid.link/r/20240408081840.1319431-1-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-08 13:38:45 +01:00
Mark Brown
f3806fe542
ASoC: SOF: Intel: improve and extend HDaudio-based
Merge series from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

For LunarLake, the SoundWire in-band wake detection is reported with
the HDAudio WAKE_EN/WAKE_STS registers. In the existing code, these
registers are only handled for HDaudio codecs. Now the same registers
have to be handled with care as shared resources.

The in-band wake detection mainly used for jack detection. Without
this patchset, the SoundWire headset codecs signal an event that would
be ignored and not reported.
2024-04-05 23:15:55 +01:00
Mark Brown
3018fdf7bd
ASoC: Intel: avs: Fixes and cleanups for 6.10
Merge series from Cezary Rojewski <cezary.rojewski@intel.com>:

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-05 23:15:43 +01:00
Cezary Rojewski
9a38599350
ASoC: Intel: avs: Rule invalid buffer and period sizes out
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 <cezary.rojewski@intel.com>
Link: https://msgid.link/r/20240405090929.1184068-14-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-05 13:13:12 +01:00
Amadeusz Sławiński
c2b10acb62
ASoC: Intel: avs: Add assert_static to guarantee ABI sizes
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 <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://msgid.link/r/20240405090929.1184068-13-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-05 13:13:11 +01:00
Cezary Rojewski
ff0aefe2d2
ASoC: Intel: avs: Init debugfs before booting firmware
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 <cezary.rojewski@intel.com>
Link: https://msgid.link/r/20240405090929.1184068-12-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-05 13:13:11 +01:00
Cezary Rojewski
30df76bbcb
ASoC: Intel: avs: Wake from D0ix when starting streaming
It is recommended to keep the DSP domain in full-power when starting DMA
engines.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://msgid.link/r/20240405090929.1184068-11-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-05 13:13:10 +01:00
Cezary Rojewski
d58275f474
ASoC: Intel: avs: Remove dead code
The result of list_next_entry()/list_last_entry() is never null.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://msgid.link/r/20240405090929.1184068-10-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-05 13:13:09 +01:00
Cezary Rojewski
41bf4525fa
ASoC: Intel: avs: Test result of avs_get_module_entry()
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: dab8d000e2 ("ASoC: Intel: avs: Add data probing requests")
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://msgid.link/r/20240405090929.1184068-9-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-05 13:13:08 +01:00
Cezary Rojewski
c7e832cabe
ASoC: Intel: avs: Fix potential integer overflow
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: 45864e49a0 ("ASoC: Intel: avs: Implement CLDMA transfer")
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://msgid.link/r/20240405090929.1184068-8-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-05 13:13:07 +01:00
Cezary Rojewski
4771484759
ASoC: Intel: avs: Replace risky functions with safer variants
strscpy() and snprintf() are the recommended equivalents of their
riskier friends.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://msgid.link/r/20240405090929.1184068-7-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-05 13:13:06 +01:00
Cezary Rojewski
9d2e26f31c
ASoC: Intel: avs: Fix ASRC module initialization
The ASRC module configuration consists of several reserved fields. Zero
them out when initializing the module to avoid sending invalid data.

Fixes: 274d79e518 ("ASoC: Intel: avs: Configure modules according to their type")
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://msgid.link/r/20240405090929.1184068-6-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-05 13:13:05 +01:00
Cezary Rojewski
beeeee9686
ASoC: Intel: avs: Fix config_length for config-less copiers
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 <cezary.rojewski@intel.com>
Link: https://msgid.link/r/20240405090929.1184068-5-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-05 13:13:04 +01:00
Cezary Rojewski
6dd68c2da4
ASoC: Intel: avs: Silence false-positive memcpy() warnings
Commit df8fc4e934 ("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 <cezary.rojewski@intel.com>
Link: https://msgid.link/r/20240405090929.1184068-4-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-05 13:13:03 +01:00
Cezary Rojewski
c91b692781
ASoC: Intel: avs: Fix debug-slot offset calculation
For resources with ID other than 0 the current calculus is incorrect.

Fixes: 275b583d04 ("ASoC: Intel: avs: ICL-based platforms support")
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://msgid.link/r/20240405090929.1184068-3-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-05 13:13:02 +01:00
Amadeusz Sławiński
680507581e
ASoC: Intel: avs: Restore stream decoupling on prepare
Revert changes from commit b87b8f43af ("ASoC: Intel: avs: Drop
superfluous stream decoupling") to restore working streaming during S3.

Fixes: b87b8f43af ("ASoC: Intel: avs: Drop superfluous stream decoupling")
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://msgid.link/r/20240405090929.1184068-2-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-05 13:13:01 +01:00
Takashi Iwai
100c85421b ASoC: Fixes for v6.9
A relatively large set of fixes here, the biggest piece of it is a
 series correcting some problems with the delay reporting for Intel SOF
 cards but there's a bunch of other things.  Everything here is driver
 specific except for a fix in the core for an issue with sign extension
 handling volume controls.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmYPJIUACgkQJNaLcl1U
 h9Ap8Qf/Xr2YP+KJxiD7g52grelyqjUdMCBkoB5Ndf4BU/mBl5X1yZkBuiTEB24D
 dcjamLuxNHGJhrHalYEfok6wRK3RMlkDZ8SNgpCP9rmOH0cSdt/8I3vUXA/XUKrx
 SnceTSZC1S7BSRk26IKf2UdFRULMSGpC87mVLxi7DT+nmuIAigGau3yBPXveG00p
 OLOYmJK9vwdlxAkfIp0ddYx3iTqfaq55W5ttWadoLG9gpoGbDzkvapBsZebqlGeo
 MkZrur70Vi7ousGATkzQHCkEUD8atNOTRrrAgVmzgBbUy3Y6LOmeMwiH306wXJAq
 XHiYYLCPlPI5myNYHeKmOQbCK1AzpA==
 =/2l+
 -----END PGP SIGNATURE-----

Merge tag 'asoc-fix-v6.9-rc2' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus

ASoC: Fixes for v6.9

A relatively large set of fixes here, the biggest piece of it is a
series correcting some problems with the delay reporting for Intel SOF
cards but there's a bunch of other things.  Everything here is driver
specific except for a fix in the core for an issue with sign extension
handling volume controls.
2024-04-05 08:48:12 +02:00
Pierre-Louis Bossart
35b5806e2e
ASoC: SOF: Intel: hda-ctrl: only clear WAKESTS for HDaudio codecs
When a PME wake happens due to a SoundWire wake, we currently clear
all WAKESTS bits during the resume operation initiated by the PCI
subsystem. As a result, we are unable to identify which SoundWire
links need to be resumed and don't properly handle jack detection.

This patch only clears the WAKESTS bits for the HDaudio codecs
detected earlier.

Note that we still clear all WAKESTS bits unconditionally in
hda_dsp_ctrl_stop_chip(). The existing behavior is potentially racy if
e.g. a jack event happens during a suspend routine, but there's a risk
of breaking shutdown or reboot sequences so the code is left as is for
now.

Closes: https://github.com/thesofproject/linux/issues/4687
Co-developed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Keqiao Zhang <keqiao.zhang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://msgid.link/r/20240404190357.138073-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-04 20:25:40 +01:00
Pierre-Louis Bossart
b69480edf4
ASoC: SOF: Intel: hda-codec: preserve WAKEEN values
Since LunarLake, we use the HDadio WAKEEN/WAKESTS to detect wakes for
SoundWire codecs. Unfortunately, the existing code in
hda_codec_jack_wake_enable() unconditionally resets the WAKEEN bits.

This patch changes the initialization to preserve SoundWire WAKEEN
bits. For HDAudio codecs the same strategy is used, WAKEEN is only set
when the jacktbl.used property is set.

Closes: https://github.com/thesofproject/linux/issues/4687
Co-developed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Keqiao Zhang <keqiao.zhang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://msgid.link/r/20240404190357.138073-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-04 20:25:39 +01:00
Pierre-Louis Bossart
ab9182441e
ASoC: SOF: Intel: lnl: add helper to detect SoundWire wakes
The global STATESTS register will provide information on all
links. Rather than iterate on all possible links, the helpers only
filters the range of possible bits for a quick lookup. The
process_wakeen() helper will walk through all the links and deal with
wakes.

Signed-off-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>
Link: https://msgid.link/r/20240404190357.138073-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-04 20:25:38 +01:00
Pierre-Louis Bossart
bd5863f9ef
ASoC: SOF: Intel: hda-ctrl: add missing WAKE_STS clear
For some reason, the programming sequences in the SOF driver do not
include a clear of the WAKE_STS bits before resetting the controller.

This clear is not formally required by the HDaudio specification, but
was added to harden the snd-hda-reset back in 2007. Adding this
sequence back avoids an issue reported by the Intel CI.

Closes: https://github.com/thesofproject/linux/issues/4889
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@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/20240404190357.138073-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-04 20:25:37 +01:00
Pierre-Louis Bossart
716778b3d7
ASoC: SOF: Intel: hda-stream: clarify comment
The Yoda grammar and multiple negatives are unclear.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://msgid.link/r/20240404185448.136157-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-04 19:58:28 +01:00
Pierre-Louis Bossart
d5263dbbd8
ASoC: SOF: Intel: don't ignore IOC interrupts for non-audio transfers
The HDaudio stream interrupts are ignored unless the stream is PCM or
compressed audio. For alternate non-audio usages, such as code loader
or SoundWire BPT case, the IOC interrupt on the last buffer
transferred is silently ignored.

This patch adds a 'struct completion' for each HDaudio stream. This
capability helps detect if the non-audio data transfers
completed. There is no performance impact for audio streams.

In the code loader case, the code currently starts the DMA and
directly checks if the firmware status changes, without checking if
the DMA succeeded. With a first pass waiting for the DMA to complete,
system validation engineers can gather more precise timing information
on firmware boot time or root-cause boot failures more accurately.

A timeout of 500ms was selected for the code loader DMA. This is an
experimental value which should be more than enough - higher values
would certainly be problematic from a usage/latency perspective.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://msgid.link/r/20240404185448.136157-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-04 19:58:27 +01:00
Pierre-Louis Bossart
6cbf086143
ASoC: SOF: Intel: hda-loader: change signature of code loader helpers
We need to reuse cl_prepare, cl_trigger and cl_cleanup helpers from a
SoundWire context where only the device information is
available. Rather than pass the 'sdev' argument, use get_drvdata() to
retrieve the required structure.

For consistency, rename hda_cl_stream_prepare() as hda_cl_prepare().

These three helpers are also exported so that they can be referenced
from another module.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://msgid.link/r/20240404185448.136157-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-04 19:58:26 +01:00
Pierre-Louis Bossart
e9ae5adce9
ASoC: SOF: Intel: hda-loader: add flag to tag ICCMAX stream
The existing code conflates capture stream and ICCMAX stream. This
isn't going to be true any longer when we add support for SDW BPT RX
streams. Add a boolean tag to flag ICCMAX streams.

No functionality change, only future-proofing change.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://msgid.link/r/20240404185448.136157-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-04 19:58:25 +01:00
Chaitanya Kumar Borah
90f8917e7a
ASoC: SOF: Core: Add remove_late() to sof_init_environment failure path
In cases where the sof driver is unable to find the firmware and/or
topology file [1], it exits without releasing the i915 runtime
pm wakeref [2]. This results in dmesg warnings[3] during
suspend/resume or driver unbind. Add remove_late() to the failure path
of sof_init_environment so that i915 wakeref is released appropriately

[1]

[    8.990366] sof-audio-pci-intel-mtl 0000:00:1f.3: SOF firmware and/or topology file not found.
[    8.990396] sof-audio-pci-intel-mtl 0000:00:1f.3: Supported default profiles
[    8.990398] sof-audio-pci-intel-mtl 0000:00:1f.3: - ipc type 1 (Requested):
[    8.990399] sof-audio-pci-intel-mtl 0000:00:1f.3:  Firmware file: intel/sof-ipc4/mtl/sof-mtl.ri
[    8.990401] sof-audio-pci-intel-mtl 0000:00:1f.3:  Topology file: intel/sof-ace-tplg/sof-mtl-rt711-2ch.tplg
[    8.990402] sof-audio-pci-intel-mtl 0000:00:1f.3: Check if you have 'sof-firmware' package installed.
[    8.990403] sof-audio-pci-intel-mtl 0000:00:1f.3: Optionally it can be manually downloaded from:
[    8.990404] sof-audio-pci-intel-mtl 0000:00:1f.3:    https://github.com/thesofproject/sof-bin/
[    8.999088] sof-audio-pci-intel-mtl 0000:00:1f.3: error: sof_probe_work failed err: -2

[2]

ref_tracker: 0000:00:02.0@ffff9b8511b6a378 has 1/5 users at
     track_intel_runtime_pm_wakeref.part.0+0x36/0x70 [i915]
     __intel_runtime_pm_get+0x51/0xb0 [i915]
     intel_runtime_pm_get+0x17/0x20 [i915]
     intel_display_power_get+0x2f/0x70 [i915]
     i915_audio_component_get_power+0x23/0x120 [i915]
     snd_hdac_display_power+0x89/0x130 [snd_hda_core]
     hda_codec_i915_init+0x3f/0x50 [snd_sof_intel_hda]
     hda_dsp_probe_early+0x170/0x250 [snd_sof_intel_hda_common]
     snd_sof_device_probe+0x224/0x320 [snd_sof]
     sof_pci_probe+0x15b/0x220 [snd_sof_pci]
     hda_pci_intel_probe+0x30/0x70 [snd_sof_intel_hda_common]
     local_pci_probe+0x4c/0xb0
     pci_device_probe+0xcc/0x250
     really_probe+0x18e/0x420
     __driver_probe_device+0x7e/0x170
     driver_probe_device+0x23/0xa0

[3]
[  484.105070] ------------[ cut here ]------------
[  484.108238] thunderbolt 0000:00:0d.2: PM: pci_pm_suspend_late+0x0/0x50 returned 0 after 0 usecs
[  484.117106] i915 0000:00:02.0: i915 raw-wakerefs=1 wakelocks=1 on cleanup
[  484.792005] WARNING: CPU: 2 PID: 2405 at drivers/gpu/drm/i915/intel_runtime_pm.c:444 intel_runtime_pm_driver_release+0x6c/0x80

Tested-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Lucas De Marchi <lucas.demarchi@intel.com>
Link: https://github.com/thesofproject/linux/pull/4878
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://msgid.link/r/20240404184813.134566-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-04 19:51:51 +01:00
Mark Brown
fe4a074542
ASoC: Drop soc-topology ABI v4 support
Merge series from Cezary Rojewski <cezary.rojewski@intel.com>:

This patchset impacts UAPI.

The only known users of the soc-topology ABI v4 are Chromebook
configurations. Starting from kernel v5.4, all of them are making use of
soc-topology ABI v5. The patchset first removes obsolete code from the
Intel's skylake-driver - the driver of choice for the mentioned
Chromebooks - and then proceeds with removal of relevant soc-topology.c
and uapi bits.

Cezary Rojewski (4):
  ASoC: Intel: Skylake: Remove soc-topology ABI v4 support
  ASoC: topology: Remove ABI v4 support
  ASoC: topology: Cleanup after ABI v4 support removal
  ASoC: topology: Remove obsolete ABI v4 structs

 include/uapi/sound/asoc.h               |  56 ------
 include/uapi/sound/skl-tplg-interface.h |  74 --------
 sound/soc/intel/skylake/skl-topology.c  | 169 -----------------
 sound/soc/soc-topology.c                | 241 ++----------------------
 4 files changed, 18 insertions(+), 522 deletions(-)

--
2.25.1
2024-04-04 18:09:18 +01:00
Dan Carpenter
2cfa0eea26
ASoC: SOF: Clean up sof_ipc_flood_dfs_write()
This function doesn't support partial writes so using
simple_write_to_buffer() doesn't really make sense.  It's better to
just use copy_from_user().

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Acked-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://msgid.link/r/a35dded2-392b-4ccb-9dbb-d782ac9b6547@moroto.mountain
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-04 16:24:29 +01:00
Dan Carpenter
84ae7d9cfa
ASoC: SOF: Disable pointless writes to debugfs file
The permissions on this debugfs file are 0444 so it can't be written to.
And writing to the file hasn't done anything since commit 6e9548cdb3
("ASoC: SOF: Convert the generic IPC flood test into SOF client").
Delete the write function.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Acked-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://msgid.link/r/9d2477cf-25aa-4d12-818f-fdafc9aaa28a@moroto.mountain
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-04 16:24:28 +01:00
Cezary Rojewski
82c192540b
ASoC: topology: Cleanup after ABI v4 support removal
Flag 'abi_match' along with several other local variables has no purpose
with v4 related members removed.

Cc: Curtis Malainey <cujomalainey@chromium.org>
Cc: Łukasz Majczak <lmajczak@google.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://msgid.link/r/20240403091629.647267-4-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-04 15:50:05 +01:00
Cezary Rojewski
c57468dc1f
ASoC: topology: Remove ABI v4 support
There are no users of soc-topology ABI v4 since kernel v5.4 so remove
all v4 -> v5 converters.

Cc: Curtis Malainey <cujomalainey@chromium.org>
Cc: Łukasz Majczak <lmajczak@google.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://msgid.link/r/20240403091629.647267-3-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-04 15:50:04 +01:00
Cezary Rojewski
251ea65205
ASoC: Intel: Skylake: Remove soc-topology ABI v4 support
The only known users are Chromebook configurations. Starting from
kernel v5.4, all of them are making use of soc-topology ABI v5.

Cc: Curtis Malainey <cujomalainey@chromium.org>
Cc: Łukasz Majczak <lmajczak@google.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://msgid.link/r/20240403091629.647267-2-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-04 15:50:03 +01:00
Mark Brown
98b1bb9ecf
ASoC: SOF: imx: stop using the imx8_*_clocks API
Merge series from Laurentiu Mihalcea <laurentiumihalcea111@gmail.com>:

The imx8_*_clocks API requires keeping track of all of the clocks used
by the IMX SOF driver via an array. This is unnecessary and doesn't
scale well. As such, remove it altogether and replace it with
devm_clk_bulk_get_all() and friends.
2024-04-04 15:31:30 +01:00
Francesco Dolcini
9f1aeef4cb
ASoC: nau8822: Remove unused member from struct
Remove unused mclk_idx struct member.

Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Link: https://msgid.link/r/20240404111953.99287-1-francesco@dolcini.it
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-04 12:59:42 +01:00
Arnd Bergmann
2ba2d17170
ASoC: codecs: rk3308: fix building without CONFIG_OF
The newly added codec has an extraneous of_match_ptr() annotation for
the ID table:

sound/soc/codecs/rk3308_codec.c:956:34: error: 'rk3308_codec_of_match' defined but not used [-Werror=unused-const-variable=]
  956 | static const struct of_device_id rk3308_codec_of_match[] = {

Remove it to avoid introducing a warning when -Wunused-const-variable
gets enabled by default:

Fixes: 4ed0915f5b ("ASoC: codecs: Add RK3308 internal audio codec driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://msgid.link/r/20240404095755.650364-1-arnd@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-04 12:59:41 +01:00
Vijendar Mukunda
b9846a3867
ASoC: SOF: amd: fix for false dsp interrupts
Before ACP firmware loading, DSP interrupts are not expected.
Sometimes after reboot, it's observed that before ACP firmware is loaded
false DSP interrupt is reported.
Registering the interrupt handler before acp initialization causing false
interrupts sometimes on reboot as ACP reset is not applied.
Correct the sequence by invoking acp initialization sequence prior to
registering interrupt handler.

Fixes: 738a2b5e2c ("ASoC: SOF: amd: Add IPC support for ACP IP block")
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://msgid.link/r/20240404041717.430545-1-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-04 12:59:29 +01:00
Mark Brown
86f26aca49
ALSA: cirrus: Tidy up of firmware control read/write
Merge series from Richard Fitzgerald <rf@opensource.cirrus.com>:

This set of patches factors out some repeated code to clean up
firmware control read/write functions, and removes some redundant
control notification code.

base-commit: f193957b0f
2024-04-03 20:45:32 +01:00
Mark Brown
b9cfeeb9b0
ASoC: codecs: rk3308: fix build warning without OF
Merge series from Luca Ceresoli <luca.ceresoli@bootlin.com>:

This small series fixes a build warning reported by kernel test robot
<lkp@intel.com> and improves the Kconfig entry.

Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
---
Changes in v2:
- Replaced v1 implementation with __maybe_unused
- Added patch to depend on || COMPILE_TEST
- Link to v1: https://lore.kernel.org/r/20240329-rk3308-audio-codec-fix-warning-v1-1-b9d177fcd6c9@bootlin.com

---
Luca Ceresoli (2):
      ASoC: codecs: rk3308: fix "defined but not used" warning on !OF
      ASoC: codecs: rk3308: depend on ARM64 || COMPILE_TEST

 sound/soc/codecs/Kconfig        | 1 +
 sound/soc/codecs/rk3308_codec.c | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
---
base-commit: 4ed0915f5b
change-id: 20240329-rk3308-audio-codec-fix-warning-51bb572ebd96

Best regards,
--
Luca Ceresoli <luca.ceresoli@bootlin.com>
2024-04-03 18:56:57 +01:00
Peter Ujfalusi
3f5eb32513
ASoC: SOF: Intel: lnl: Disable DMIC/SSP offload on remove
During probe the DMIC/SSP offload is enabled and it is not reversed on
remove.

Add a remove wrapper for LNL to disable the offload for DMIC and SSP
similarly to what is done during probe.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-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/20240403111839.27259-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-03 18:47:08 +01:00
Mark Brown
f79b1758b8
ASoC: SOF: Intel: mtl/lnl: Improve firmware boot state
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-03 16:28:31 +01:00
Simon Trimmer
e81f5c9f7d
ASoC: wm_adsp: Remove notification of driver write
Any control that the driver is updating should be marked as SYSTEM and
therefore will not have an ALSA control to notify.

Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://msgid.link/r/20240325113127.112783-5-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-03 16:10:30 +01:00
Simon Trimmer
3802a9969b
ASoC: wm_adsp: Use cs_dsp_coeff_lock_and_[read|write]_ctrl()
Using the cs_dsp_coeff_lock_and_[read|write]_ctrl() wrappers tidies
the calling functions as it does not need to manage the DSP pwr_lock.

Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://msgid.link/r/20240325113127.112783-3-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-03 16:10:28 +01:00
Mark Brown
327719aa62
ASoC: Merge up fixes
Some of these, particularly the wm_adsp one in the immediate case, are
needed as a basis for new work.
2024-04-03 16:07:41 +01:00
Mark Brown
09bbc4f0d6
ASoC: Merge up left over v6.8 fix
This v6.8 change didn't make it into the release, send it as a fix for
v6.9.
2024-04-03 16:03:56 +01:00
Laurentiu Mihalcea
e618b8b37a
ASoC: SOF: imx: remove imx8_*_clocks API
Since the i.MX drivers no longer use the imx8_*_clocks API
this can be removed.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Reviewed-by: Iuliana Prodan <iuliana.prodan@nxp.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://msgid.link/r/20240328221201.24722-3-laurentiumihalcea111@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-03 13:09:48 +01:00
Laurentiu Mihalcea
a358f67d16
ASoC: SOF: imx: drop usage of the imx8_*_clocks API
Currently, the driver has to keep track of all the clocks
it uses via an array of "struct clk_bulk_data", which doesn't
scale well and is unnecessary. As such, replace the usage of
the imx8_*_clocks with "devm_clk_bulk_get_all()" and friends.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Reviewed-by: Iuliana Prodan <iuliana.prodan@nxp.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://msgid.link/r/20240328221201.24722-2-laurentiumihalcea111@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-03 13:09:47 +01:00
Luca Ceresoli
03246ade46
ASoC: codecs: rk3308: depend on ARM64 || COMPILE_TEST
This codec is only known to exist in the RK3308 ARM64 SoC, so depend on it
except for compile test cases. Note that the driver won't probe without
CONFIG_OF, but ARM64 selects OF already so it is not needed.

Suggested-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Link: https://msgid.link/r/20240403-rk3308-audio-codec-fix-warning-v2-2-816bae4c1dc5@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-03 12:46:58 +01:00
Luca Ceresoli
38d5387b76
ASoC: codecs: rk3308: fix "defined but not used" warning on !OF
Building with CONFIG_OF=n triggers:

  warning: 'rk3308_codec_of_match' defined but not used [-Wunused-const-variable=]
  warning: unused variable 'rk3308_codec_of_match' [-Wunused-const-variable]

Even though OF is needed for probing, fix by declaring as __maybe_unused to
still allow building on non-OF configurations for build testing.

Fixes: 9fdd7b45da ("arm64: defconfig: enable Rockchip RK3308 internal audio codec driver")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202403271905.BYbGJiPi-lkp@intel.com/
Closes: https://lore.kernel.org/oe-kbuild-all/202403271907.0z0uuG5I-lkp@intel.com/
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Link: https://msgid.link/r/20240403-rk3308-audio-codec-fix-warning-v2-1-816bae4c1dc5@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-03 12:46:57 +01:00
Peter Ujfalusi
40bdf121a3
ASoC: SOF: Intel: mtl: Correct the mtl_dsp_dump output
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-03 12:04:28 +01:00
Peter Ujfalusi
3dc2682870
ASoC: SOF: Intel: hda-dsp/mtl: Add support for ACE ROM state codes
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-03 12:04:27 +01:00
Peter Ujfalusi
6b1c1c47e7
ASoC: SOF: Intel: mtl: Implement firmware boot state check
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: 064520e8ae ("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-03 12:04:26 +01:00
Peter Ujfalusi
26187f44aa
ASoC: SOF: Intel: mtl: Disable interrupts when firmware boot failed
In case of error during the firmware boot we need to disable the interrupts
which were enabled as part of the boot sequence.

Fixes: 064520e8ae ("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-03 12:04:25 +01:00
Peter Ujfalusi
b852574c67
ASoC: SOF: Intel: lnl: Correct rom_status_reg
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: 64a63d9914 ("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-03 12:04:24 +01:00
Peter Ujfalusi
1f1b820dc3
ASoC: SOF: Intel: mtl: Correct rom_status_reg
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: 064520e8ae ("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-03 12:04:23 +01:00
Peter Ujfalusi
bbdf9af261
ASoC: SOF: Intel: hda: Create debugfs file to force a clean DSP boot
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-03 12:04:23 +01:00
Amadeusz Sławiński
5faf65b5d1
ASoC: Intel: avs: rt5682: Constify card_headset_pins
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-03 11:05:19 +01:00
Amadeusz Sławiński
a055674868
ASoC: Intel: avs: rt5663: Constify card_headset_pins
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-03 11:05:19 +01:00
Amadeusz Sławiński
33a886eee7
ASoC: Intel: avs: rt298: Constify card_headset_pins
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-03 11:05:18 +01:00
Amadeusz Sławiński
682bedc8b0
ASoC: Intel: avs: rt286: Constify card_headset_pins
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-03 11:05:17 +01:00
Amadeusz Sławiński
130c953a75
ASoC: Intel: avs: rt274: Constify card_headset_pins
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-03 11:05:16 +01:00
Amadeusz Sławiński
bf400f16a0
ASoC: Intel: avs: nau8825: Constify card_headset_pins
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-03 11:05:15 +01:00
Amadeusz Sławiński
2dbe7c8098
ASoC: Intel: avs: es8336: Constify card_headset_pins
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-03 11:05:14 +01:00
Amadeusz Sławiński
a3c95efc43
ASoC: Intel: avs: hdaudio: Constify probing_link
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-03 11:05:13 +01:00
Amadeusz Sławiński
68a71af3ae
ASoC: Intel: avs: Use devm_kstrdup_const
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-03 11:05:12 +01:00
Amadeusz Sławiński
27aa581804
ASoC: Intel: avs: hdaudio: Use devm_kstrdup_const
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-03 11:05:11 +01:00
Mark Brown
953db8ded1
ASoC: rsnd: reg cleanup
Merge series from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:

These are Renesas Sound driver cleanups for Gen3/Gen4.
2024-04-03 11:04:23 +01:00
Mark Brown
ff9496dacf
ASoC: SOF: cppcheck fixes and debugfs addition
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-02 22:30:44 +01:00
Mark Brown
d62d62109f
ASoC: SOF: Intel: improve SoundWire support for
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-02 22:19:33 +01:00
Mark Brown
dbc93a554f
ASoC: Use snd_ctl_find_id_mixer() instead of
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-02 22:19:21 +01:00
Mark Brown
283758231d
ASoC: codecs: ES8326: solve some hp issues and
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-02 21:01:43 +01:00
Ranjani Sridharan
f0caa4fc24
ASoC: SOF: ipc4-topology: Save the ALH DAI index during hw_params
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-02 17:14:58 +01:00
Pierre-Louis Bossart
ebd3b3014e
ASoC: SOF: pcm: reset all PCM sources in case of xruns
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-02 17:14:57 +01:00
Pierre-Louis Bossart
dbc78bce74
ASoC: SOF: pcm: add pending_stop state variable
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-02 17:14:56 +01:00
Pierre-Louis Bossart
bb83ae04d9
ASoC: SOF: pcm: simplify sof_pcm_hw_free() with helper
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-02 17:14:55 +01:00
Pierre-Louis Bossart
a6f2b279d2
ASoC: SOF: sof-audio: revisit sof_pcm_stream_free() error handling and logs
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-02 17:14:54 +01:00
Ranjani Sridharan
bfe9225455
ASoC: SOF: Intel: hda: Clear Soundwire node ID during BE DAI hw_free
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-02 17:14:53 +01:00
Pierre-Louis Bossart
2ac9e09ba0
ASoC: SOF: Intel: hda: move helper to static inline
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-02 17:14:52 +01:00
Pierre-Louis Bossart
a936456d4b
ASoC: SOF: IPC4: extend dai_data with node_id
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-02 17:14:51 +01:00
Pierre-Louis Bossart
8bc3b56cac
ASoC: SOF: Intel: hda: extend signature of sdw_hda_dai_hw_params()
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-02 17:14:50 +01:00
Pierre-Louis Bossart
219271481e
ASoC: SOF: Intel: set the DMA TLV device as dai_index
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-02 17:14:49 +01:00
Pierre-Louis Bossart
58f32cb701
ASoC: SOF: Intel: hda-dai: add helpers to set dai config
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-02 17:14:48 +01:00
Bard Liao
17386cb1b4
ASoC: SOF: Intel: hda-dai: set dma_stream_channel_map device
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-02 17:14:47 +01:00
Bard Liao
8fa10a2436
ASoC: SOF: Intel: hda-dai: set lowest N bits in ch_mask
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-02 17:14:46 +01:00
Bard Liao
e9c6b118de
ASoC: SOF: make dma_config_tlv be an array
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-02 17:14:45 +01:00
Bard Liao
1d0fb3d0c3
Revert "ASoC: SOF: Intel: hda-dai-ops: only allocate/release streams for first CPU DAI"
This reverts commit f8ba62ac86.

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-02 17:14:45 +01:00
Bard Liao
24b1f93df4
Revert "ASoC: SOF: Intel: hda-dai-ops: reset device count for SoundWire DAIs"
This reverts commit 699e146d9e.
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-02 17:14:44 +01:00
Pierre-Louis Bossart
831045513c
ASoC: SOF: Intel: hda-dai: fix channel map configuration for aggregated dailink
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: 2960ee5c48 ("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-02 17:14:43 +01:00
Pierre-Louis Bossart
c143cfe4f8
ASoC: SOF: ipc4-topology: remove shadowed variable
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-02 17:14:29 +01:00
Pierre-Louis Bossart
458e387050
ASoC: SOF: ipc4-priv: align prototype and function declaration
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-02 17:14:28 +01:00
Pierre-Louis Bossart
dbb6ca68b5
ASoC: SOF: amd: acp-loader: abort firmware download on write error
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-02 17:14:27 +01:00
Yong Zhi
f690cdcc01
ASoC: SOF: ipc4-loader: save FW version info to debugfs
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-02 17:14:26 +01:00
Seven Lee
91ebd32eee
ASoC: nau8325: Revise soc_enum structure definition.
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-02 15:55:21 +01:00
Kuninori Morimoto
07f6232ff1
ASoC: rsnd: no exception for SCU
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-02 15:55:07 +01:00
Kuninori Morimoto
5be0e7f7f2
ASoC: rsnd: R-Car Gen1/Gen2 exception
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-02 15:55:06 +01:00
Kuninori Morimoto
0b8ef53e12
ASoC: rsnd: rename rsnd_is_e3() to rsnd_is_gen3_e3()
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>
2024-04-02 15:55:05 +01:00
Kuninori Morimoto
6e4e543294
ASoC: rsnd: don't get resource from ID
All SoC has reg-name, no need to support getting resource from ID
any more. Remove it. To get physical address for DMA settings,
it still need to know the index, but it is no longer fixed.
This patch tidyup it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://msgid.link/r/87zfuca4e6.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-02 15:55:04 +01:00
Kuninori Morimoto
35aaed1bc3
ASoC: rsnd: cleanup regmap table
R-Car Sound is using almost same register mapping on each generation,
therefore we can share it. Here indicates some memo/comments.

SSI/SSIU/SCU have multi channels (SSI0 - SSI9 etc), but ADG is single,
so, we don't need to have multi channel settings for it

	- rsnd_gen_regmap_init(..., 10, ..ADG, ...);
	+ rsnd_gen_regmap_init(...,  1, ..ADG, ...);

Gen4 added new SSI_BUSIF, but it is not used

Gen4 calls rsnd_gen_regmap_init() for SDMC, but the address is calculated
by rsnd_gen4_dma_addr(). It needs physical address, but other info are
not needed. use NULL conf for it.

	- rsnd_gen_regmap_init(..., 10, ..SDMC, conf_sdmc);
	+ rsnd_gen_regmap_init(...,  1, ..SDMC, conf_null);

Gen4 have only SSI0/SSIU0, we don't need to have multi channel settings.

	- rsnd_gen_regmap_init(..., 10, ..SSI, ...);
	+ rsnd_gen_regmap_init(...,  1, ..SSI, ...);

SSI_MODE2 address is different between Gen2/3 and Gen4, but it is not
used on Gen4. Thus we can share same regmap table.

	Gen2/3 : 0x808
	Gen4   : 0xa0c

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Khanh Le <khanh.le.xr@renesas.com>
Link: https://msgid.link/r/871q7obiyt.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-02 15:55:03 +01:00
Richard Fitzgerald
ef7784e41d
ASoC: soc-card: Add KUnit test case for snd_soc_card_get_kcontrol
Add a new snd-soc-card KUnit test with a simple test case for
snd_soc_card_get_kcontrol() and snd_soc_card_get_kcontrol_locked().

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://msgid.link/r/20240401100210.61277-4-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-02 15:54:49 +01:00
Richard Fitzgerald
897cc72b08
ASoC: soc-card: Use snd_ctl_find_id_mixer() instead of open-coding
Use the snd_ctl_find_id_mixer[_locked]() wrapper in
snd_soc_card_get_kcontrol[_locked]() instead of open-coding a custom
list walk of the card controls list.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://msgid.link/r/20240401100210.61277-3-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-02 15:54:48 +01:00
Amadeusz Sławiński
d619b0b70d
ASoC: Intel: avs: boards: Add modules description
Modpost warns about missing module description, add it.

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/20240402130640.3310999-1-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-02 15:54:33 +01:00
Zhang Yi
fec9c7f668
ASoC: codecs: ES8326: Removing the control of ADC_SCALE
We removed the configuration of ES8326_ADC_SCALE
in es8326_jack_detect_handler because user changed
the configuration by snd_controls

Signed-off-by: Zhang Yi <zhangyi@everest-semi.com>
Link: https://msgid.link/r/20240402062043.20608-5-zhangyi@everest-semi.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-02 15:54:19 +01:00
Zhang Yi
6e5f5bf894
ASoC: codecs: ES8326: Solve a headphone detection issue after suspend and resume
We got a headphone detection issue after suspend and resume.
And we fixed it by modifying the configuration at es8326_suspend
and invoke es8326_irq at es8326_resume.

Signed-off-by: Zhang Yi <zhangyi@everest-semi.com>
Link: https://msgid.link/r/20240402062043.20608-4-zhangyi@everest-semi.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-02 15:54:18 +01:00
Zhang Yi
4581468d07
ASoC: codecs: ES8326: modify clock table
We got a digital microphone feature issue. And we fixed it by modifying
the clock table. Also, we changed the marco ES8326_CLK_ON declaration

Signed-off-by: Zhang Yi <zhangyi@everest-semi.com>
Link: https://msgid.link/r/20240402062043.20608-3-zhangyi@everest-semi.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-02 15:54:17 +01:00
Zhang Yi
8a655cee6c
ASoC: codecs: ES8326: Solve error interruption issue
We got an error report about headphone type detection and button detection.
We fixed the headphone type detection error by adjusting the debounce timer
configuration. And we fixed the button detection error by disabling the
button detection feature when the headphone are unplugged and enabling it
when headphone are plugged in.

Signed-off-by: Zhang Yi <zhangyi@everest-semi.com>
Link: https://msgid.link/r/20240402062043.20608-2-zhangyi@everest-semi.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-02 15:54:16 +01:00
Vijendar Mukunda
2c603a4947
ASoC: amd: acp: fix for acp_init function error handling
If acp_init() fails, acp pci driver probe should return error.
Add acp_init() function return value check logic.

Fixes: e61b415515 ("ASoC: amd: acp: refactor the acp init and de-init sequence")
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20240329053815.2373979-1-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-29 13:59:35 +00:00
Mark Brown
2ae143fb3a
ASoC: nau8325: Modify driver code and dtschema.
Merge series from Seven Lee <wtli@nuvoton.com>:

Add a driver for the Nuvoton NAU88325.
2024-03-29 01:32:12 +00:00
Mark Brown
439c69f809
ASoC: Intel: boards: updates for 6.10 - part3
Merge series from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

This last part is the continuation of Brent Lu's cleanups. Multiple
quirks have been removed to use "default" configurations and
ACPI-based detection of codecs and selection of topology files.

This cleanup has been done in multiple steps/phases since Fall 2023,
thanks Brent for this contribution!
2024-03-29 01:32:01 +00:00
Mark Brown
64f84dc49f
ASoC: drop driver owner assignment
Merge series from Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>:

Core for several drivers already sets the driver.owner, so driver does
not need to.  Simplify the drivers.
2024-03-29 01:31:40 +00:00
Mark Brown
e48ef67700
ASoC: rt-sdw: fix locking and improve error logs
Merge series from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

Fix a set of problematic locking sequences and update error messages,
tested on SOF/SoundWire platforms.
2024-03-29 01:31:29 +00:00
Stephen Lee
fc563aa900
ASoC: ops: Fix wraparound for mask in snd_soc_get_volsw
In snd_soc_info_volsw(), mask is generated by figuring out the index of
the most significant bit set in max and converting the index to a
bitmask through bit shift 1. Unintended wraparound occurs when max is an
integer value with msb bit set. Since the bit shift value 1 is treated
as an integer type, the left shift operation will wraparound and set
mask to 0 instead of all 1's. In order to fix this, we type cast 1 as
`1ULL` to prevent the wraparound.

Fixes: 7077148fb5 ("ASoC: core: Split ops out of soc-core.c")
Signed-off-by: Stephen Lee <slee08177@gmail.com>
Link: https://msgid.link/r/20240326010131.6211-1-slee08177@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-28 22:01:43 +00:00
Pierre-Louis Bossart
f892e66fca
ASoC: rt-sdw*: add __func__ to all error logs
The drivers for Realtek SoundWire codecs use similar logs, which is
problematic to analyze problems reported by CI tools, e.g. "Failed to
get private value: 752001 => 0000 ret=-5". It's not uncommon to have
several Realtek devices on the same platform, having the same log
thrown makes support difficult.

This patch adds __func__ to all error logs which didn't already
include it.

No functionality change, only error logs are modified.

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/20240325221817.206465-7-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-28 19:31:12 +00:00
Pierre-Louis Bossart
adb354bbc2
ASoC: rt722-sdca-sdw: fix locking sequence
The disable_irq_lock protects the 'disable_irq' value, we need to lock
before testing it.

Fixes: a0b7c59ac1 ("ASoC: rt722-sdca: fix for JD event handling in ClockStop Mode0")
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Chao Song <chao.song@linux.intel.com>
Link: https://msgid.link/r/20240325221817.206465-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-28 19:31:11 +00:00
Pierre-Louis Bossart
c8b2e5c1b9
ASoC: rt712-sdca-sdw: fix locking sequence
The disable_irq_lock protects the 'disable_irq' value, we need to lock
before testing it.

Fixes: 7a8735c155 ("ASoC: rt712-sdca: fix for JD event handling in ClockStop Mode0")
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Chao Song <chao.song@linux.intel.com>
Link: https://msgid.link/r/20240325221817.206465-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-28 19:31:10 +00:00
Pierre-Louis Bossart
aae86cfd87
ASoC: rt711-sdw: fix locking sequence
The disable_irq_lock protects the 'disable_irq' value, we need to lock
before testing it.

Fixes: b69de265bd ("ASoC: rt711: fix for JD event handling in ClockStop Mode0")
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Chao Song <chao.song@linux.intel.com>
Link: https://msgid.link/r/20240325221817.206465-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-28 19:31:09 +00:00
Pierre-Louis Bossart
ee28777164
ASoC: rt711-sdca: fix locking sequence
The disable_irq_lock protects the 'disable_irq' value, we need to lock
before testing it.

Fixes: 23adeb7056 ("ASoC: rt711-sdca: fix for JD event handling in ClockStop Mode0")
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Chao Song <chao.song@linux.intel.com>
Link: https://msgid.link/r/20240325221817.206465-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-28 19:31:08 +00:00
Pierre-Louis Bossart
310a5caa4e
ASoC: rt5682-sdw: fix locking sequence
The disable_irq_lock protects the 'disable_irq' value, we need to lock
before testing it.

Fixes: 02fb23d727 ("ASoC: rt5682-sdw: fix for JD event handling in ClockStop Mode0")
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Chao Song <chao.song@linux.intel.com>
Link: https://msgid.link/r/20240325221817.206465-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-28 19:31:07 +00:00
Aleksandr Mishin
ea60ab9572
ASoC: kirkwood: Fix potential NULL dereference
In kirkwood_dma_hw_params() mv_mbus_dram_info() returns NULL if
CONFIG_PLAT_ORION macro is not defined.
Fix this bug by adding NULL check.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: bb6a40fc5a ("ASoC: kirkwood: Fix reference to PCM buffer address")
Signed-off-by: Aleksandr Mishin <amishin@t-argos.ru>
Link: https://msgid.link/r/20240328173337.21406-1-amishin@t-argos.ru
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-28 19:27:59 +00:00
Seven Lee
c0a3873b99
ASoC: nau8325: new driver
The driver is for amplifiers NAU8325 of Nuvoton Technology Corporation.
The NAU8325 is a stereo high efficiency filter-free Class-D audio
amplifier, which is capable of driving a 4ohm load with up to 3W output
power.

Signed-off-by: Seven Lee <wtli@nuvoton.com>
Link: https://msgid.link/r/20240327075755.3410381-3-wtli@nuvoton.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-28 15:54:04 +00:00
Brent Lu
57ad033ce0
ASoC: Intel: sof_cs42l42: add mtl_cs42l42_def for mtl boards
Add the board config mtl_cs42l42_def to cs42l42 machine driver for all
mtl boards using default SSP port allocation (headphone codec on SSP2,
speaker amplifiers on SSP0, and BT offload on SSP1).

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327162408.63953-19-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-28 13:58:26 +00:00
Brent Lu
6d90e02ae8
ASoC: Intel: sof_cs42l42: add rpl_cs42l42_def for rpl boards
Add the board config rpl_cs42l42_def to cs42l42 machine driver for all
rpl boards using default SSP port allocation (headphone codec on SSP0,
speaker amplifiers on SSP1, and BT offload on SSP2).

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327162408.63953-18-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-28 13:58:25 +00:00
Brent Lu
ae33c9134d
ASoC: Intel: sof_cs42l42: mach cleanup for adl boards
Add a common entry in enumeration table for all cs42l42 boards
with/without speaker amplifier. All other adl_cs42l42_def entries
become redundant so get removed.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327162408.63953-17-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-28 13:58:24 +00:00
Brent Lu
2872f3b5df
ASoC: Intel: sof_cs42l42: board id cleanup for adl boards
Introduce "adl_cs42l42_def" for adl boards which implement headphone
codec on SSP0 and speaker amplifiers on SSP1.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327162408.63953-16-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-28 13:58:23 +00:00
Brent Lu
a2e678fe95
ASoC: Intel: sof_rt5682: mach cleanup for mtl boards
Add two common entries in enumeration table for all rt5682/rt5650
boards with/without speaker amplifier. All other mtl_rt5682_def
entries become redundant so get removed.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327162408.63953-15-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-28 13:58:22 +00:00
Brent Lu
7b24d86c84
ASoC: Intel: sof_rt5682: mach cleanup for rpl boards
Add two common entries in enumeration table for all rt5682/rt5650
boards with/without speaker amplifier. All other rpl_rt5682_def
entries become redundant so get removed.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327162408.63953-14-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-28 13:58:21 +00:00
Brent Lu
34f2565376
ASoC: Intel: sof_rt5682: mach cleanup for adl boards
Add two common entries in enumeration table for all rt5682/rt5650
boards with/without speaker amplifier. All other adl_rt5682_def
entries become redundant so get removed.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327162408.63953-13-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-28 13:58:20 +00:00
Brent Lu
4b95706b4a
ASoC: Intel: sof_rt5682: mach cleanup for tgl boards
Add a common entry in enumeration table for all rt5682 boards
with/without speaker amplifier. All other tgl_rt5682_def entries
become redundant so get removed.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327162408.63953-12-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-28 13:58:19 +00:00
Brent Lu
d5dd7f4fc0
ASoC: Intel: sof_nau8825: add mtl_nau8825_def for mtl boards
Add the board config mtl_nau8825_def to nau8825 machine driver for all
mtl boards using default SSP port allocation (headphone codec on SSP2,
speaker amplifiers on SSP0, and BT offload on SSP1).

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327162408.63953-11-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-28 13:58:18 +00:00
Brent Lu
3822d41469
ASoC: Intel: sof_nau8825: mach cleanup for rpl boards
Add a common entry in enumeration table for all nau8825 boards
with/without speaker amplifier. All other rpl_nau8825_def entries
become redundant so get removed.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327162408.63953-10-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-28 13:58:17 +00:00
Brent Lu
1934906b26
ASoC: Intel: sof_nau8825: mach cleanup for adl boards
Add a common entry in enumeration table for all nau8825 boards
with/without speaker amplifier. All other adl_nau8825_def entries
become redundant so get removed.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327162408.63953-9-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-28 13:58:16 +00:00
Brent Lu
1504a768f6
ASoC: SOF: Intel: support tplg suffix detection
Add new flags to tplg_quirk_mask to detect and append codec/amplifier
tplg suffix to topology file name at runtime. With this feature we
could implement an enumeration entry for all boards which implement
same headphone codec regardless the speaker amplifier type.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327162408.63953-8-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-28 13:58:15 +00:00
Brent Lu
2e723a79ec
ASoC: Intel: ssp-common: get codec tplg suffix function
Add helper functions to get tplg suffix string for specific headphone
codec or speaker amplifier. The string could be used to compose the
default topology file name for specific headphone codec and speaker
amplifier combination.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327162408.63953-7-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-28 13:58:14 +00:00
Brent Lu
fe2365c298
ASoC: Intel: ssp-common: delete module
Moving all code to snd-soc-acpi-intel-match module and remove the
snd-soc-acpi-intel-ssp-common module.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327162408.63953-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-28 13:58:14 +00:00
Brent Lu
e1ff45518f
ASoC: Intel: ssp-common: module name change
As we applied new naming convention to functions and structures,
changing module name as well to reflect the new naming.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327162408.63953-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-28 13:58:13 +00:00
Brent Lu
a17fea3880
ASoC: Intel: ssp-common: naming convention change
As we moved ssp-common files to new locations with new names, changing
the naming convention from sof_ssp_ to snd_soc_acpi_intel_.

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327162408.63953-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-28 13:58:12 +00:00
Brent Lu
bd1222ad17
ASoC: Intel: ssp-common: relocate header file
Moving ssp-common header file from sound/soc/intel/common directory to
include/sound directory and rename the file. Keep file content
unchanged for tracking purpose.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327162408.63953-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-28 13:58:11 +00:00
Brent Lu
94a944a8c4
ASoC: Intel: ssp-common: relocate source file
Moving ssp-common source and header files from sound/soc/intel/boards
directory to sound/soc/intel/common directory and rename the source
file. Keep file content unchanged for tracking purpose.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327162408.63953-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-28 13:58:10 +00:00
Krzysztof Kozlowski
29580cd7b9
ASoC: sdw-mockup: drop driver owner assignment
Core in sdw_register_driver() already sets the .owner, so driver does
not need to.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327-module-owner-var-v1-18-86d5002ba6dc@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-28 13:57:56 +00:00
Krzysztof Kozlowski
8c70ce6108
ASoC: rt722-sdca-sdw: drop driver owner assignment
Core in sdw_register_driver() already sets the .owner, so driver does
not need to.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327-module-owner-var-v1-17-86d5002ba6dc@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-28 13:57:55 +00:00
Krzysztof Kozlowski
eb9e075797
ASoC: rt715-sdw: drop driver owner assignment
Core in sdw_register_driver() already sets the .owner, so driver does
not need to.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327-module-owner-var-v1-16-86d5002ba6dc@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-28 13:57:54 +00:00
Krzysztof Kozlowski
d4f501e292
ASoC: rt715-sdca-sdw: drop driver owner assignment
Core in sdw_register_driver() already sets the .owner, so driver does
not need to.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327-module-owner-var-v1-15-86d5002ba6dc@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-28 13:57:53 +00:00
Krzysztof Kozlowski
7c00f1706e
ASoC: rt712-sdca-sdw: drop driver owner assignment
Core in sdw_register_driver() already sets the .owner, so driver does
not need to.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327-module-owner-var-v1-14-86d5002ba6dc@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-28 13:57:52 +00:00
Krzysztof Kozlowski
e50d2fbb63
ASoC: rt712-sdca-dmic: drop driver owner assignment
Core in sdw_register_driver() already sets the .owner, so driver does
not need to.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327-module-owner-var-v1-13-86d5002ba6dc@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-28 13:57:52 +00:00
Krzysztof Kozlowski
37dc3531c5
ASoC: rt711-sdw: drop driver owner assignment
Core in sdw_register_driver() already sets the .owner, so driver does
not need to.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327-module-owner-var-v1-12-86d5002ba6dc@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-28 13:57:51 +00:00
Krzysztof Kozlowski
852298a5e1
ASoC: rt711-sdca-sdw: drop driver owner assignment
Core in sdw_register_driver() already sets the .owner, so driver does
not need to.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327-module-owner-var-v1-11-86d5002ba6dc@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-28 13:57:50 +00:00
Krzysztof Kozlowski
554bec0c52
ASoC: rt700-sdw: drop driver owner assignment
Core in sdw_register_driver() already sets the .owner, so driver does
not need to.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327-module-owner-var-v1-10-86d5002ba6dc@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-28 13:57:49 +00:00
Krzysztof Kozlowski
e140dfeb10
ASoC: rt5682-sdw: drop driver owner assignment
Core in sdw_register_driver() already sets the .owner, so driver does
not need to.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327-module-owner-var-v1-9-86d5002ba6dc@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-28 13:57:48 +00:00
Krzysztof Kozlowski
3b7859dec8
ASoC: rt1318-sdw: drop driver owner assignment
Core in sdw_register_driver() already sets the .owner, so driver does
not need to.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327-module-owner-var-v1-8-86d5002ba6dc@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-28 13:57:47 +00:00
Krzysztof Kozlowski
7d5a265662
ASoC: rt1316-sdw: drop driver owner assignment
Core in sdw_register_driver() already sets the .owner, so driver does
not need to.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327-module-owner-var-v1-7-86d5002ba6dc@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-28 13:57:46 +00:00
Krzysztof Kozlowski
b982047530
ASoC: rt1308-sdw: drop driver owner assignment
Core in sdw_register_driver() already sets the .owner, so driver does
not need to.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327-module-owner-var-v1-6-86d5002ba6dc@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-28 13:57:45 +00:00
Krzysztof Kozlowski
d95c19aa2c
ASoC: rt1017-sdca-sdw: drop driver owner assignment
Core in sdw_register_driver() already sets the .owner, so driver does
not need to.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327-module-owner-var-v1-5-86d5002ba6dc@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-28 13:57:44 +00:00
Krzysztof Kozlowski
fe2065d645
ASoC: max98373-sdw: drop driver owner assignment
Core in sdw_register_driver() already sets the .owner, so driver does
not need to.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327-module-owner-var-v1-4-86d5002ba6dc@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-28 13:57:43 +00:00
Krzysztof Kozlowski
54b8a522e6
ASoC: tlv320aic3x-spi: drop driver owner assignment
Core in spi_register_driver() already sets the .owner, so driver
does not need to.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327-module-owner-var-v1-3-86d5002ba6dc@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-28 13:57:42 +00:00
Krzysztof Kozlowski
8a4836231c
ASoC: tlv320aic32x4-spi: drop driver owner assignment
Core in spi_register_driver() already sets the .owner, so driver
does not need to.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327-module-owner-var-v1-2-86d5002ba6dc@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-28 13:57:41 +00:00
Krzysztof Kozlowski
c335412ced
ASoC: loongson: i2s/pci: drop driver owner assignment
PCI core in pci_register_driver() already sets the .owner, so driver
does not need to.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327-module-owner-var-v1-1-86d5002ba6dc@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-28 13:57:40 +00:00
Ondrej Jirman
559aebe45a
ASoC: sun8i-codec: Fix build with CONFIG_SND_JACK_INPUT_DEV disabled
When CONFIG_SND_JACK_INPUT_DEV is disabled, struct snd_jack doesn't
have 'type' field. We can't rely on this field being always present,
so store the jack_type in the codec driver itself.

Signed-off-by: Ondrej Jirman <megi@xff.cz>
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202403261243.kcXCPAYs-lkp@intel.com/
Link: https://msgid.link/r/20240327080542.3649840-1-megi@xff.cz
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-27 15:57:34 +00:00
Vijendar Mukunda
4af565de9f
ASoC: amd: acp: fix for acp pdm configuration check
ACP PDM configuration has to be verified for all combinations.
Remove FLAG_AMD_LEGACY_ONLY_DMIC check.

Fixes: 3a94c8ad0a ("ASoC: amd: acp: add code for scanning acp pdm controller")

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://msgid.link/r/20240327104657.3537664-2-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-27 15:00:22 +00:00
Mark Brown
cc98380308
ASoC: Intel: boards: updates for 6.10 - part2
Merge series from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

This second part provides SoundWire-related cleanups and extensions
required by Realtek RT722 and Cirrus Logic codecs.

Also included is a cleanup of the RT715-sdca DAI naming and new tables
for ACPI-based board detections.
2024-03-26 20:21:16 +00:00
Andy Shevchenko
7b95ee0db7
ASoC: soc-jack: Get rid of legacy GPIO support
No more users.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://msgid.link/r/20240326171134.1414462-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-26 17:13:45 +00:00
Charles Keepax
59ffeb15b2
ASoC: Intel: sof_sdw: Add support for cs42l43 optional speaker output
Add support for the optional speaker output on the cs42l43, this uses
the new SOF_CODEC_SPKR quirk to conditional include the speaker DAI
link. It is worth noting that currently no systems are included that
utilise this feature, but the feature is added as several systems are on
the horizon. As part of this SOF_SDW_MAX_DAI_NUM must be increased, it
is currently 3 but cs42l43 will now have 4 DAI links. This value is
increased to 8 to give some head room for future devices.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240326160429.13560-35-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-26 16:13:51 +00:00
Charles Keepax
9c09bef69f
ASoC: Intel: sof_sdw: Add quirk for optional codec speakers
Some codecs have speaker drivers that may or may not be used in a
given system. Add a quirk (SOF_CODEC_SPKR) that defines if a system
uses the codec speaker, this is kept generic such that any codec
with such a speaker DAI can reuse the quirk.

For implementation of this, add a quirk field into the
sof_sdw_dai_info structure. This field is not used to specify
if a system uses a particular quirk, that is still done through
the sof_sdw_quirk variable, this field is used to flag a DAI as
conditional on a certain quirk. This means the DAI will only be
included in the card if sof_sdw_quirk and the DAI quirk field have
a matching set bit.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240326160429.13560-34-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-26 16:13:50 +00:00
Charles Keepax
36f307d296
ASoC: Intel: sof_sdw: Remove redundant initialisations
Unspecified fields are by default initialised to zero, remove redundant
init pointer initialisations.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240326160429.13560-33-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-26 16:13:49 +00:00
Charles Keepax
84aa440e02
ASoC: Intel: sof_sdw: Don't pass acpi_link_adr to init functions
There is no need to pass the snd_soc_acpi_link_adr structure to the init
functions, it conveys no specific information about the codec. Remove
this parameter from the callbacks

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240326160429.13560-32-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-26 16:13:48 +00:00
Bard Liao
aac976aa3c
ASoC: Intel: change cs35l56 name_prefix
To use sequential amp numbers. I,e, AMP1, AMP2, AMP3, AMP4

Reviewed-by: Chao Song <chao.song@linux.intel.com>
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/20240326160429.13560-31-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-26 16:13:47 +00:00
Bard Liao
a2e620e4ac
ASoC: Intel: sof_sdw: change rt715-sdca dai name
As rt715-sdca dai name has been changed in codec driver, we should
change it in machine driver, too. Changing the dai name in
codec_info_list[] also help sof_sdw_rtd_init() to run .rtd_init()
from the same codec.

Reviewed-by: Chao Song <chao.song@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
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/20240326160429.13560-30-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-26 16:13:46 +00:00
Bard Liao
13112a34d8
ASoC: rt715-sdca: rename dai name with rt715-sdca prefix
The dai name are the same as rt715 codec. Rename them with rt715-sdca
prefix allow machine driver to distinguish rt715 and rt715-sdca from
dai name.

Reviewed-by: Chao Song <chao.song@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
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/20240326160429.13560-29-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-26 16:13:45 +00:00
Bard Liao
df19c6cd0f
ASoC: Intel: sof_sdw_rt722_sdca: use rt_dmic_rtd_init
rt_dmic_rtd_init() can be used for rt722 dmic, too.

Reviewed-by: Chao Song <chao.song@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
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/20240326160429.13560-28-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-26 16:13:44 +00:00
Bard Liao
266c9b27cb
ASoC: Intel: sof_sdw_rt722_sdca: set rtd_init in codec_info_list[]
Add rt722 into rt_sdca_jack_rtd_init() supported list, and set
rtd_init callback directly in codec_info_list[]. No need to use a
init callback to set the rtd_init callback.
Besides, sof_sdw_rt_sdca_jack_init() doesn't set .rtd_init anymore.

Reviewed-by: Chao Song <chao.song@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
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/20240326160429.13560-27-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-26 16:13:43 +00:00
Bard Liao
45bbc14fb9
ASoC: Intel: sof_sdw: remove unused rt dmic rtd_init
Some Realtek SDW DMIC codecs use the generic rt_dmic_rtd_init callback now.
Remove unused rtd_init callbacks.

Reviewed-by: Chao Song <chao.song@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
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/20240326160429.13560-26-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-26 16:13:42 +00:00
Bard Liao
bee2fe4467
ASoC: Intel: sof_sdw: use generic rtd_init function for Realtek SDW DMICs
The only thing that the rt_xxx_rtd_init() functions do is to set
card->components. And we can set card->components with name_prefix
as rt712_sdca_dmic_rtd_init() does.
And sof_sdw_rtd_init() will always select the first dai with the
given dai->name from codec_info_list[]. Unfortunately, we have
different codecs with the same dai name. For example, dai name of
rt715 and rt715-sdca are both "rt715-aif2". Using a generic rtd_init
allow sof_sdw_rtd_init() run the rtd_init() callback from a similar
codec dai.

Fixes: 8266c73126 ("ASoC: Intel: sof_sdw: add common sdw dai link init")
Reviewed-by: Chao Song <chao.song@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
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/20240326160429.13560-25-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-26 16:13:41 +00:00
Charles Keepax
59bf457d80
ASoC: intel: sof_sdw: Factor out SoundWire DAI creation
Factor out the creation of the SoundWire DAI links into a helper
function. No functional change.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240326160429.13560-24-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-26 16:13:40 +00:00
Charles Keepax
5f14d70b7f
ASoC: Intel: sof_sdw: Move generation of DAI links to new parsing
The only part left using the old parsing code is now the generation of
the actual DAI links. Move this generation over to being based on the
new parsing, which allows the removal of the last of the old parsing
code.

The new DAI link generation is a simple matter of creating a new DAI
link for each sof_sdw_dailink struct, and adding a cpu, a codec, and
a mapping for each sof_sdw_endpoint contained in that sof_sdw_dailink.
Note that the CPUs can be inferred as the endpoint list is iterated,
because the endpoints were added into the list sorted by link.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240326160429.13560-23-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-26 16:13:39 +00:00
Charles Keepax
13e698e8ee
ASoC: Intel: sof_sdw: Move append_dai_type to new parsing
append_dai_type should be set to true in any situation that would
result in multiple DAI links existing on a single SoundWire bus,
because the legacy naming used only the bus number to make things
unique. The current code handles this by looking for codecs with
multiple dai_info structs and looking for buses that include multiple
types of device on them. The first of these assumes that all DAIs on a
given device would be in use. The second, with dissimilar aggregation
now being supported, isn't really an accurate check either since those
devices could be aggregated into a single DAI link.

Move the handling for this flag over to the new parsing code and
simplify things a little by looking directly for SoundWire links
that will contain multiple DAI links to set the flag. These changes
should not cause any change in behaviour for any currently supported
systems.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240326160429.13560-22-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-26 16:13:39 +00:00
Charles Keepax
22f2a5e710
ASoC: Intel: sof_sdw: Move ignore_pch_dmic to new parsing
Trivial move of the handling of ignore_pch_dmic over to the new parsing
code.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240326160429.13560-21-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-26 16:13:38 +00:00
Charles Keepax
0d7b9880db
ASoC: Intel: sof_sdw: Move counting and codec_conf to new parsing
Use the output of the new snd_soc_acpi struct parsing for the purposes
of counting the number of SoundWire DAI links and physical devices
attached to the SoundWire. These counts are already returned by the
parser so those can just be used directly. But the population of the
codec_conf structures, is moved from the old parsing code over to the
new. As the two parsers currently co-exist it is better to not have
them both attempt to modify the same structures.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240326160429.13560-20-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-26 16:13:37 +00:00
Charles Keepax
27fd36aefa
ASoC: Intel: sof-sdw: Add new code for parsing the snd_soc_acpi structs
The current machine driver code has a lot of loops parsing through
the ACPI structs (snd_soc_acpi_link_adr, snd_soc_acpi_adr_device,
snd_soc_acpi_endpoint), this makes it hard to understand exactly
what information is being extracted and for what purposes. As well
as being slightly inefficient, as the same information is looked
up multiple times. There are also some issues with the handling
of multiple endpoints on a single device, only the first of the
snd_soc_acpi_endpoint structures is currently fully processed by the
driver. This means doing things like aggregating the second endpoint
on a device with another device are not currently possible.

Add new parsing code that will count the devices and endpoints, parse
them into an intermediate datastructure, and then use that to create
the DAI links. This patch does not actually utilise the results of
the parsing, items will be moved across in the following patches.

This parsing is based around two new structures which are temporarily
allocated whilst parsing. Firstly, sof_sdw_endpoint, which represents
a specific endpoint for audio on a device and is more or less directly
equivalent to snd_soc_acpi_endpoint. Secondly, sof_sdw_dailink
which represents a DAI link and contains a linked list of one or
more sof_sdw_endpoints. A single trip through the snd_soc_acpi data
structures is used to populate these.

One important point to note here is the use of the num field in
snd_soc_acpi_endpoint to address sof_sdw_dai_info array in the
sof_sdw_codec_info struct. This expects a one to one mapping between
endpoints on a device and dai infos. It would be fine for a specific
system to not specify an endpoint for all of the dai infos available,
but two endpoints mapping to the same dai info would make not sense.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240326160429.13560-19-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-26 16:13:36 +00:00
Charles Keepax
8166bdd2c5
ASoC: intel: soc-acpi: Add missing cs42l43 endpoints
Currently the cs42l43 just specifies a single endpoint, as the current
machine driver only looks at the first endpoint specified. Future
refactoring will process all endpoints, as such proper specification
should be added for all the cs42l43 endpoints.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240326160429.13560-18-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-26 16:13:35 +00:00
Charles Keepax
17750bc651
ASoC: Intel: sof_sdw: Remove no longer supported quirk
The SOF_SDW_NO_AGGREGATION quirk is mostly for debug and no longer works
correctly with the current state of the machine driver. Remove it from
the code and add an error message if someone uses it.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240326160429.13560-17-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-26 16:13:34 +00:00
Balamurugan C
aa238217d6
ASoC: Intel: soc-acpi-intel-arl-match: Add rt711 sdca codec support
Adding rt711 sdca codec support for arl boards.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Chao Song <chao.song@linux.intel.com>
Signed-off-by: Balamurugan C <balamurugan.c@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240326160429.13560-16-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-26 16:13:33 +00:00
Charles Keepax
b48f238585
ASoC: Intel: sof_sdw: Factor out codec name generation
In preparation for future refactoring pull out a helper specifically for
generating the codec name.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240326160429.13560-15-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-26 16:13:32 +00:00
Charles Keepax
0e2c1dd086
ASoC: Intel: sof_sdw: Factor out BlueTooth DAI creation
Factor out the creation of the BlueTooth DAI links into a helper
function.  No functional change.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240326160429.13560-14-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-26 16:13:31 +00:00
Charles Keepax
914c43ab50
ASoC: Intel: sof_sdw: Factor out HDMI DAI creation
Factor out the creation of the HDMI DAI links into a helper function.
No functional change.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240326160429.13560-13-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-26 16:13:30 +00:00
Charles Keepax
c2473a0e50
ASoC: Intel: sof_sdw: Factor out DMIC DAI creation.
Factor out the creation of the DMIC DAI links into a helper function.
No functional change.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240326160429.13560-12-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-26 16:13:29 +00:00
Charles Keepax
4d96a7f000
ASoC: Intel: sof_sdw: Factor out SSP DAI creation
Factor out the creation of the SSP DAI links into a helper function. No
functional change.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240326160429.13560-11-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-26 16:13:28 +00:00
Charles Keepax
2132dbc1a9
ASoC: Intel: sof_sdw: Use for_each_set_bit
Rather than open coding a loop to process each bit use for_each_set_bit.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240326160429.13560-10-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-26 16:13:27 +00:00
Charles Keepax
c577b747b9
ASoC: Intel: sof_sdw: Only pass dai_link pointer around
Rather than passing around a pointer to the dai_link array and
an index into this array, simply pass a pointer to the current
dai_link. Also move the DAI link pointer sanity check to the end
of the DAI link creation, and change it to a warn on. This check
should only be hit if there is a serious bug in the machine driver,
so checking it on each iteration is excessive.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240326160429.13560-9-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-26 16:13:26 +00:00
Charles Keepax
d36bfa329a
ASoC: Intel: sof_sdw: Move flags to private struct
Move the flags ignore_pch_dmic and append_dai_type into the drivers
private structure rather than passing them around between functions.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240326160429.13560-8-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-26 16:13:25 +00:00
Charles Keepax
0703329606
ASoC: Intel: sof_sdw: Move get_codec_dai_by_name() into sof_sdw itself
Currently sof_sdw relies on sof_board_helpers to provide
get_codec_dai_by_name(), but that is the only function from
sof_board_helpers it uses and no other machine driver requires
that function. There is no reason for sof_sdw to select SSP_COMMON
but more and more functions in sof_board_helpers are gaining
dependencies on functions that would require stubs for sof_sdw to
build without it.  Firstly it was sof_ssp_get_codec_name(), as was
fixed in commit c1469c3a8a ("ASoC: Intel: ssp-common: Add stub for
sof_ssp_get_codec_name"), now it is:

ERROR: modpost: "sof_ssp_detect_amp_type"
[sound/soc/intel/boards/snd-soc-intel-sof-board-helpers.ko] undefined!
ERROR: modpost: "sof_ssp_detect_codec_type"
[sound/soc/intel/boards/snd-soc-intel-sof-board-helpers.ko] undefined!

Rather than adding more stubs, simply move the affected function
to the sof_sdw machine driver itself and no longer select
SND_SOC_INTEL_SOF_BOARD_HELPERS at all. This should allow work on
SSP_COMMON to progress without affecting sof_sdw.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240326160429.13560-7-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-26 16:13:24 +00:00
Charles Keepax
634ffef9cb
ASoC: intel: sof_sdw: Set channel map directly from endpoints
The current code evenly distributes the CODEC DAIs across the CPU
DAIs in the DAI link, but this is just an assumption about how the
devices are connected to the host. All the information about which
CODEC is connected to which CPU DAI is contained in the endpoints
datastructures and those structures are already parsed to work out
which CODECs to include in the DAI link. Simply fill in the mapping
from CPUs -> CODECs as we parse through the endpoints structures,
this will ensure that mapping matches the physical layout.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240326160429.13560-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-26 16:13:24 +00:00
Charles Keepax
961e694749
ASoC: intel: sof_sdw: Only pass codec_conf pointer around
Rather than passing around a pointer to the codec_conf array, an index
into it and a size, simply pass around a pointer to the current codec_conf.
This reduces the amount of state moving around.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240326160429.13560-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-26 16:13:23 +00:00
Charles Keepax
1329f5b0d9
ASoC: intel: sof_sdw: Make find_codec_info_dai() return a pointer
Rather than returning an index simply return a pointer to the
located codec info, this simplifies all the callers which only
want to access the codec info structure. Also remove the inline
specifier the function is fairly large for an inline function,
let the compiler decide. And move the function such that it is
located with the other find_codec_info_*() functions.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240326160429.13560-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-26 16:13:22 +00:00
Charles Keepax
c2c7a8b384
ASoC: intel: sof_sdw: Make find_codec_info_acpi() return a pointer
Rather than returning an index simply return a pointer to the
located codec info, this simplifies all the callers which only
want to access the codec info structure. Also remove the inline
specifier the function is fairly large for an inline function,
let the compiler decide.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240326160429.13560-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-26 16:13:21 +00:00
Charles Keepax
087777347b
ASoC: intel: sof_sdw: Make find_codec_info_part() return a pointer
Rather than returning an index simply return a pointer to the
located codec info, this simplifies all the callers which only
want to access the codec info structure. Also remove the inline
specifier the function is fairly large for an inline function,
let the compiler decide.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240326160429.13560-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-26 16:13:20 +00:00
Luca Ceresoli
4ed0915f5b
ASoC: codecs: Add RK3308 internal audio codec driver
Add driver for the internal audio codec of the Rockchip RK3308 SoC.

Initially based on the vendor kernel driver [0], with lots of cleanups,
fixes, improvements, conversion to DAPM and removal of some features.

[0] https://github.com/rockchip-linux/kernel/blob/develop-4.19/sound/soc/codecs/rk3308_codec.c

Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Link: https://msgid.link/r/20240305-rk3308-audio-codec-v4-4-312acdbe628f@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-26 14:55:21 +00:00
Mark Brown
35c8c82fa0
Add support for jack detection to codec present in
Merge series from Ondřej Jirman <megi@xff.cz>:

This series adds support for jack detection to this codec. I used
and tested this on Pinephone. It works quite nicely. I tested it
against Android headset mic button resistor specification.

The patches are a rewritten and debugged version of the original
ones from Arnaud Ferraris and Samuel Holland, improved to better
handle headset button presses and with more robust plug-in/out
event debouncing, and to use set_jack API instead of sniffing
the sound card widget names, to detect the type of jack connector.
2024-03-26 14:11:34 +00:00
Mark Brown
fc32f949ed
ASoC: codecs: ES8326: Reducin powerconsumption and
Merge series from Zhang Yi <zhangyi@everest-semi.com>:

We changed the configuration related to hibernation.
and delete the REG_SUPPLY to cover mute issue.
2024-03-26 14:11:23 +00:00
Mark Brown
37d6983992
ASoC: dmaengine_pcm: Allow passing component name via config
Merge series from Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>:

At the moment we cannot instantiate two dmaengine_pcms with the same
parent device, as the components will be named the same, leading to
conflicts.

Add 'name' field to the snd_dmaengine_pcm_config, and use that (if
defined) as the component name instead of deriving the component name
from the device.
2024-03-26 14:11:12 +00:00
Mark Brown
d7e6a980dd
ASoC: Harden DAPM route checks and Intel fixes
Merge series from Cezary Rojewski <cezary.rojewski@intel.com>:

Set of loosely connected patches. Most impactful change is dropping any
permisiveness when snd_soc_dapm_add_routes() fails in soc-topology.c To
do it safely, disable route checks for all skylake-driver boards.

Relevant background:

Since commit daa480bde6 ("ASoC: soc-core: tidyup for
snd_soc_dapm_add_routes()") route checks are no longer permissive. Probe
failures for Intel boards have been partially addressed by commit
a22ae72b86 ("ASoC: soc-core: isable route checks for legacy devices")
and its follow up but only skl_nau88l25_ssm4567.c is patched. The rest
of the boards still need fixing.

After that, removal of copy-pastas found in ssm4567.c and redundant code
in i2s_test.c for avs-boards.

Changes in v2:
- glk_rt5682_max98357a.c and skl_hda_dsp_generic.c now disable route
  checks only for the skylake-drvier
- asoc now logs failures of snd_soc_dapm_add_routes() in soc-topology.c

Amadeusz Sławiński (1):
  ASoC: Intel: avs: i2s_test: Remove redundant dapm routes

Cezary Rojewski (4):
  ASoC: Intel: Disable route checks for Skylake boards
  ASoC: topology: Do not ignore route checks when parsing graphs
  ASoC: Intel: avs: ssm4567: Do not ignore route checks
  ASoC: Intel: avs: ssm4567: Board cleanup

 sound/soc/intel/avs/boards/i2s_test.c         | 79 -------------------
 sound/soc/intel/avs/boards/ssm4567.c          |  5 +-
 sound/soc/intel/boards/bxt_da7219_max98357a.c |  1 +
 sound/soc/intel/boards/bxt_rt298.c            |  1 +
 sound/soc/intel/boards/glk_rt5682_max98357a.c |  2 +
 sound/soc/intel/boards/kbl_da7219_max98357a.c |  1 +
 sound/soc/intel/boards/kbl_da7219_max98927.c  |  4 +
 sound/soc/intel/boards/kbl_rt5660.c           |  1 +
 sound/soc/intel/boards/kbl_rt5663_max98927.c  |  2 +
 .../intel/boards/kbl_rt5663_rt5514_max98927.c |  1 +
 sound/soc/intel/boards/skl_hda_dsp_generic.c  |  2 +
 .../soc/intel/boards/skl_nau88l25_max98357a.c |  1 +
 sound/soc/intel/boards/skl_rt286.c            |  1 +
 sound/soc/soc-topology.c                      | 11 ++-
 14 files changed, 27 insertions(+), 85 deletions(-)

--
2.25.1
2024-03-26 14:11:00 +00:00
Mark Brown
ef71b33022
ASoC: fsl: Support register and unregister rpmsg
Merge series from Chancel Liu <chancel.liu@nxp.com>:

	echo /lib/firmware/fw.elf > /sys/class/remoteproc/remoteproc0/firmware
(A)	echo start > /sys/class/remoteproc/remoteproc0/state
(B)	echo stop > /sys/class/remoteproc/remoteproc0/state

The rpmsg sound card is registered in (A) and unregistered in (B).
After "start", imx-audio-rpmsg registers devices for ASoC platform driver
and machine driver. Then sound card is registered. After "stop",
imx-audio-rpmsg unregisters devices for ASoC platform driver and machine
driver. Then sound card is unregistered.
2024-03-26 14:10:50 +00:00
Mark Brown
22247e402d
ASoC: Intel: boards: updates for 6.10 - part1
Merge series from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

This series from Brent Lu adds common helpers and board configurations
to reduce the number of quirks.
2024-03-26 14:10:38 +00:00
Mark Brown
6c26dac593
SoC: Cleanup MediaTek soundcard machine drivers
Merge series from AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>:

This is the start of a series cleaning up the Mediatek drivers with some
preparatory cleanups and improvements.
2024-03-26 14:10:27 +00:00
Mark Brown
3849c4d6c6
ASoC: SOF: ipc4/Intel: Fix delay reporting
Merge series from Peter Ujfalusi <peter.ujfalusi@linux.intel.com>:

The current version of delay reporting code can report incorrect
values when paired with a firmware which enables this feature.

Unfortunately there are several smaller issues that needed to be addressed
to correct the behavior:

Wrong information was used for the host side of counter
For MTL/LNL used incorrect (in a sense that it was verified only on MTL)
link side counter function.
The link side counter needs compensation logic if pause/resume is used.
The offset values were not refreshed from firmware.
Finally, not strictly connected, but the ALSA buffer size needs to be
constrained to avoid constant xrun from media players (like mpv)

The series applies cleanly for 6.9 and 6.8.y stable, but older stable
would need manual backport, but it is questionable if it is needed as
MTL/LNL is missing features.
2024-03-26 13:03:19 +00:00
John Watts
1e90a84649
ASoC: soc-dai: Note valid values of sysclock direction
Clock direction is marked as 'unsigned int' but only two values are
currently used in practice. Note these down in the documentation.

Signed-off-by: John Watts <contact@jookia.org>
Link: https://msgid.link/r/20240326-dai_mclk_hint-v1-1-653cbd2d78d9@jookia.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-26 12:51:23 +00:00
Charles Keepax
56ebbd19c2
ASoC: cs42l43: Correct extraction of data pointer in suspend/resume
The current code is pulling the wrong pointer causing it to disable the
wrong IRQ. Correct the code to pull the correct cs42l43 core data
pointer.

Fixes: 64353af49f ("ASoC: cs42l43: Add system suspend ops to disable IRQ")
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://msgid.link/r/20240326105434.852907-1-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-26 11:37:46 +00:00
Pierre-Louis Bossart
ea5fee227f
ASoC: hdac_hda: improve error logs
We have a couple of duplicate logs and missing information, add
__func__ consistently and make sure useful error codes are logged.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://msgid.link/r/20240325221925.206507-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-26 11:24:24 +00:00
Andy Shevchenko
6a92834166
ASoC: fsl: imx-es8328: Remove leftover gpio initialisation
The gpio field is not used anymore, remove the leftover.
This also fixes the compilation error after the ...

Fixes: 9855f05e55 ("ASoC: fsl: imx-es8328: Switch to using gpiod API")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://msgid.link/r/20240325191341.3977321-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-26 11:24:23 +00:00
Brent Lu
61cafaeab5
ASoC: Intel: sof_rt5682: board id cleanup for cml boards
Introduce "cml_rt5682_def" for cml boards which implement headphone
codec on SSP0 and speaker amplifiers on SSP1.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240325221059.206042-22-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-25 22:45:08 +00:00
Brent Lu
2b384bcd2c
ASoC: Intel: sof_nau8825: remove sof_nau8825 board id
Remove sof_nau8825 board id and use adl_nau8825_def instead since SSP
port assignment is the same.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240325221059.206042-21-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-25 22:45:07 +00:00
Brent Lu
16e5700644
ASoC: Intel: sof_ssp_amp: remove unnecessary idisp HDMI quirk
Remove SOF_NUM_IDISP_HDMI(3) from board quirks since the value is 3 if
not defined.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240325221059.206042-20-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-25 22:45:06 +00:00
Brent Lu
b497654f1d
ASoC: Intel: sof_rt5682: remove unnecessary idisp HDMI quirk
Remove SOF_NUM_IDISP_HDMI(3) from board quirks since the value is 3 if
not defined.

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240325221059.206042-19-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-25 22:45:05 +00:00
Brent Lu
9ca54c3356
ASoC: Intel: sof_da7219: board id cleanup for rpl boards
Introduce "rpl_da7219_def" board to reduce the number of rpl board
configs. This config could support all boards which implement
headphone codec on SSP0 and speaker amplifiers on SSP1.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240325221059.206042-18-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-25 22:45:04 +00:00
Brent Lu
ef771be889
ASoC: Intel: sof_da7219: board id cleanup for adl boards
Introduce "adl_da7219_def" board to reduce the number of jsl board
configs. This config could support all boards which implement
headphone codec on SSP0 and speaker amplifiers on SSP1.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240325221059.206042-17-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-25 22:45:03 +00:00
Brent Lu
45728dc6df
ASoC: Intel: sof_da7219: board id cleanup for jsl boards
Introduce "jsl_da7219_def" board to reduce the number of jsl board
configs. This config could support all boards which implement
headphone codec on SSP0 and speaker amplifiers on SSP1.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240325221059.206042-16-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-25 22:45:02 +00:00
Brent Lu
ed61b2ef5a
ASoC: Intel: sof_da7219: add SOF_DA7219_MCLK_EN quirk
PLL bypass mode requires mclk to be present. However, mclk pin is not
connected in JSL boards. Here we add the SOF_DA7219_MCLK_EN quirk to
improve driver readability.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240325221059.206042-15-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-25 22:45:01 +00:00
Brent Lu
a7963f6ecc
ASoC: Intel: sof_da7219: add codec exit function
Add exit function to headphone codec dai link.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240325221059.206042-14-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-25 22:45:00 +00:00
Brent Lu
a8f408dc87
ASoC: Intel: sof_da7219: use common module for DAI link generation
Use intel_board module to generate DAI link array and update num_links
field in snd_soc_card structure.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240325221059.206042-13-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-25 22:44:59 +00:00
Brent Lu
495d5b48d4
ASoC: Intel: sof_ssp_amp: use common module for sof_card_private initialization
Use intel_board module to initialize sof_card_private structure.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240325221059.206042-12-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-25 22:44:59 +00:00
Brent Lu
8efcd48646
ASoC: Intel: sof_rt5682: use common module for sof_card_private initialization
Use intel_board module to initialize sof_card_private structure

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240325221059.206042-11-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-25 22:44:58 +00:00
Brent Lu
bfa8c0088f
ASoC: Intel: sof_nau8825: use common module for sof_card_private initialization
Use intel_board module to initialize sof_card_private structure.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240325221059.206042-10-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-25 22:44:57 +00:00