linux-block.git
7 months agoASoC: soc-core: tidyup ret handling for card->disable_route_checks
Kuninori Morimoto [Thu, 12 Dec 2024 02:13:13 +0000 (02:13 +0000)]
ASoC: soc-core: tidyup ret handling for card->disable_route_checks

commit a22ae72b86a4 ("ASoC: soc-core: disable route checks for legacy
devices") added card->disable_route_checks to disable route checks
for legacy devices at soc_probe_component() and snd_soc_bind_card().

And commit 6974857c2b2c ("ASoC: topology: Do not ignore route checks
when parsing graphs") tidyup soc-topology for same reason.

In snd_soc_bind_card() case, if snd_soc_dapm_add_routes() (A) error,
but has card->disable_route_checks case (B), it will indicate
dev_info() only, and then, next function (C) will be called.
Thus, "ret" will be over written, and it is handled as non-error.

static int snd_soc_bind_card(...)
{
...
(A) ret = snd_soc_dapm_add_routes(...);
if (ret < 0) {
(B) if (card->disable_route_checks) {
dev_info(...);
} else {
...
goto probe_end;
}
}

(C) ret = snd_soc_dapm_add_routes(...);
...

In soc_probe_component() case, if snd_soc_dapm_add_routes() (a)
error, and has card->disable_route_checks case (b), it will indicate
dev_info(). But there is no next function after that, this means ret is
still indicating error, and will not be over written.
So error handline (c) will be handled, and will return error (d)

static int soc_probe_component(...)
{
...
(a) ret = snd_soc_dapm_add_routes(...);
if (ret < 0) {
(b) if (card->disable_route_checks) {
dev_info(...);
} else {
...
goto err_probe;
}
}

/* see for_each_card_components */
list_add(...);

err_probe:
(c) if (ret < 0)
soc_remove_component(...);

(d) return ret;
}

In soc_tplg_dapm_graph_elems_load() case, snd_soc_dapm_add_routes()
is called in for loop (1). if it was error (2), and doesn't have
card->disable_route_checks case flag (3), it will break from loop.
If card has flag, it will indicate dev_info() and handled as non-error.
But ret is still indicating error in this case. If this error happen
in last of loop, if will return error (4).

static int soc_tplg_dapm_graph_elems_load(...)
{
...
(1) for (i = 0; i < count; i++) {
...
(2) ret = snd_soc_dapm_add_routes(...);
if (ret) {
(3) if (!dapm->card->disable_route_checks) {
dev_err(...);
break;
}
dev_info(...);
}
}

(4) return ret;
}

This patch set "ret = 0" for each case.

Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>
Cc: Cezary Rojewski <cezary.rojewski@intel.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87wmg5tzra.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agoASoC: fsl: add memory to memory function for ASRC
Mark Brown [Fri, 13 Dec 2024 17:33:09 +0000 (17:33 +0000)]
ASoC: fsl: add memory to memory function for ASRC

Merge series from Shengjiu Wang <shengjiu.wang@nxp.com>:

This function is base on the accelerator implementation
for compress API:
04177158cf98 ("ALSA: compress_offload: introduce accel operation mode")

Audio signal processing also has the requirement for memory to
memory similar as Video.

This asrc memory to memory (memory ->asrc->memory) case is a non
real time use case.

User fills the input buffer to the asrc module, after conversion, then asrc
sends back the output buffer to user. So it is not a traditional ALSA playback
and capture case.

Because we had implemented the "memory -> asrc ->i2s device-> codec"
use case in ALSA.  Now the "memory->asrc->memory" needs
to reuse the code in asrc driver, so the patch 1 and patch 2 is for refining
the code to make it can be shared by the "memory->asrc->memory"
driver.

Other change is to add memory to memory support for two kinds of i.MX ASRC
modules.

7 months agofirmware: cirrus: Add KUnit tests for cs_dsp
Mark Brown [Fri, 13 Dec 2024 17:33:05 +0000 (17:33 +0000)]
firmware: cirrus: Add KUnit tests for cs_dsp

Merge series from Richard Fitzgerald <rf@opensource.cirrus.com>:

This series adds KUnit tests for the cs_dsp module.

Most of the functionality in cs_dsp is for downloading firmware to
DSP memory and interacting with "control" words defined in that
memory. This doesn't require any emulation of running firmware,
because it is only reading and writing registers. So the testing can
be done using a dummy regmap. The way this is used to perform testing
is described in more detail in the commit message for each test.

ADSP1 is not tested because this was only used by the WM2200 codec,
a long-obsolete part that was discontinued in 2015.

7 months agoASoC: SOF: core/Intel: Handle pause supported token
Mark Brown [Fri, 13 Dec 2024 17:33:00 +0000 (17:33 +0000)]
ASoC: SOF: core/Intel: Handle pause supported token

Merge series from Peter Ujfalusi <peter.ujfalusi@linux.intel.com>:

A new set of tokens have been added to SOF topology to indicate that the pause
operation is supported or not on the given PCM device.
Pause is an optional feature that depends on pipeline, topology and modules
used by the PCM.

Add a pause_supported flag to snd_sof_pcm_stream and use this flag in Intel
platform code to keep the pause support enabled or to disable it.

7 months agoASoC: SOF: sof-priv: Remove unused SOF_DAI_STREAM() and SOF_FORMATS
Peter Ujfalusi [Fri, 13 Dec 2024 13:17:17 +0000 (15:17 +0200)]
ASoC: SOF: sof-priv: Remove unused SOF_DAI_STREAM() and SOF_FORMATS

The following definitions have no users: SOF_DAI_STREAM() and SOF_FORMATS,
they can be dropped from the header file.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Link: https://patch.msgid.link/20241213131717.24071-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agoASoC: SOF: ipc4-topology: Use macro to set the EXT_PARAM_SIZE in widget setup
Peter Ujfalusi [Fri, 13 Dec 2024 13:21:10 +0000 (15:21 +0200)]
ASoC: SOF: ipc4-topology: Use macro to set the EXT_PARAM_SIZE in widget setup

Use the SOF_IPC4_MOD_EXT_PARAM_SIZE() macro to set the param size in the
extension part of the IPC message for clarity.

No Functional change as the PARMA_SIZE offset is at 0.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://patch.msgid.link/20241213132110.27800-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agofirmware: cs_dsp: Add KUnit testing of client callbacks
Richard Fitzgerald [Thu, 12 Dec 2024 14:37:25 +0000 (14:37 +0000)]
firmware: cs_dsp: Add KUnit testing of client callbacks

Test that the cs_dsp_client_ops callbacks are called when expected.

pre_run, post_run - when cs_dsp_run() is called.
pre_stop, post_stop - when cs_dsp_stop() is called
control_add - when a WMFW is loaded
control_remove - when cs_dsp_remove() is called

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20241212143725.1381013-13-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agofirmware: cs_dsp: Add KUnit testing of wmfw error cases
Richard Fitzgerald [Thu, 12 Dec 2024 14:37:24 +0000 (14:37 +0000)]
firmware: cs_dsp: Add KUnit testing of wmfw error cases

Add tests for various types of errors and illegal values in
wmfw files. This covers buffer overflows as well as general
unsupported field values.

There are several sets of test cases to cover various different
versions of the wmfw file format.

V0 format was only used on the earlier ADSP2 devices. It does
not have algorithm blocks.

V1 format is used on all ADSP2 versions. It added algorithm
blocks and firmware coefficient descriptor blocks. Strings
are stored in fixed-length arrays.

V2 format is used on all ADSP2 versions. It is similar to V1
but space for strings is variable-length with either an 8-bit
or 16-bit length field.

V3 format is used on Halo Core DSPs and is mostly identical to
the V3 format.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20241212143725.1381013-12-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agofirmware: cs_dsp: Add KUnit testing of bin error cases
Richard Fitzgerald [Thu, 12 Dec 2024 14:37:23 +0000 (14:37 +0000)]
firmware: cs_dsp: Add KUnit testing of bin error cases

Add tests for various types of errors and illegal values in
bin files. This covers buffer overflows as well as general
unsupported field values.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20241212143725.1381013-11-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agofirmware: cs_dsp: Add KUnit testing of control read/write
Richard Fitzgerald [Thu, 12 Dec 2024 14:37:22 +0000 (14:37 +0000)]
firmware: cs_dsp: Add KUnit testing of control read/write

Add KUnit test cases for control read/write.

Tests cases cover general reading and writing of controls:
1) Read/write at offset position in control.
2) Read/write of various lengths less than length of the control.
3) Rejecting illegal arguments.

The test cases are run for ADSP2 with 16-bit registers, ADSP2
with 32-bit registers and Halo Core with 32-bit registers. The
ADSP2 cases are further divided into runs for V1 and V2 format
WMFW files, because there are differences in how V1 and V2
defines controls.

The obsolete V0 format does not have controls, so no testing of
that format is needed.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20241212143725.1381013-10-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agofirmware: cs_dsp: Add KUnit testing of control cache
Richard Fitzgerald [Thu, 12 Dec 2024 14:37:21 +0000 (14:37 +0000)]
firmware: cs_dsp: Add KUnit testing of control cache

Add KUnit test cases for the caching of control content.

The test cases can be divided into four groups:
1) The cache is correctly initialized when the firmware is first
   downloaded.
2) Reads return the correct data.
3) Writes update the registers and cache.
4) If a value has been written to the control it is retained in
   the cache and written out to the registers when the firmware
   is started.

There are multiple test suites to cover:
 - V1 and V2 format files on 16-bit and 32-bit ADSP2.
 - V3 format files on Halo Core DSPs.

V1 format files, and some V2 format files, didn't provide access
flags for the controls. There are a couple of test cases for
unspecified flags to ensure backwards compatibility with the
original implementation of these older firmware versions.

The obsolete V0 format does not have controls, so no testing of
that format is needed.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20241212143725.1381013-9-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agofirmware: cs_dsp: Add KUnit testing of control parsing
Richard Fitzgerald [Thu, 12 Dec 2024 14:37:20 +0000 (14:37 +0000)]
firmware: cs_dsp: Add KUnit testing of control parsing

Add KUnit test cases for parsing of firmware controls out of the
wmfw. These test cases are only testing that the data in the wmfw
is correctly interpreted and entered into the list of controls.

The test cases can be roughly divided into three types:
1) The correct values are extracted from the wmfw.
2) Variable-length strings are handled correctly.
3) Controls are correctly identified as unique or identical.

There are multiple test suites to cover:
- V1 and V2 format files on 16-bit and 32-bit ADSP2.
- V3 format files on Halo Core DSPs.

V1 format does not have named controls, and the strings in the
coefficient descriptor are fixed-length fields. On V2 and V3 format
the controls are named and all strings are variable-length.

The obsolete V0 format does not have controls, so no testing of
that format is needed.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20241212143725.1381013-8-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agofirmware: cs_dsp: Add KUnit testing of wmfw download
Richard Fitzgerald [Thu, 12 Dec 2024 14:37:19 +0000 (14:37 +0000)]
firmware: cs_dsp: Add KUnit testing of wmfw download

This adds a KUnit test suite to test downloading wmfw files.

The general technique is
1. Create mock wmfw file content
2. Tell cs_dsp to download the wmfw file
3. Check in the emulated regmap registers that the correct values have
   been written to DSP memory
4. Drop the regmap cache for the expected written registers and then do a
   regcache_sync() to check for unexpected writes to other registers.

The test covers ADSP2 v1 and v2, and HALO Core DSPs. (ADSP1 is very
obsolete so isn't tested).

There is a large number of test cases and parameterized variants of tests
because of the many different addressing schemes supported by the Cirrus
devices. The DSP has 2 or 3 memory spaces: XM, YM and ZM. The DSP sees
these using its native addressing, which is word-addressed (not
byte-addressed). The host sees these through one of several register
mappings (depending on the DSP type and parent codec family). The
registers have three different addressing schemes: 16-bit registers
addressed by register number, 32-bit registers addressed by register
number, or 32-bit registers addressed by byte (with a stride of 4). In
addition to these multiple addressing schemes, the Halo Core DSPs have a
"packed" register mapping that maps 4 DSP words into 3 registers. In
addition to this there are 4 versions of the wmfw file format to be
tested.

The test cases intentionally have relatively little factoring-out of
similar code. This makes it much easier to visually verify that a test
case is testing correctly, and what exactly it is testing. Factoring out
large amounts of code into helper functions tends to obscure what the
actual test procedure is, so increasing the chance of hidden errors where
test cases don't actually test as intended.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20241212143725.1381013-7-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agofirmware: cs_dsp: Add KUnit testing of bin file download
Richard Fitzgerald [Thu, 12 Dec 2024 14:37:18 +0000 (14:37 +0000)]
firmware: cs_dsp: Add KUnit testing of bin file download

This adds a KUnit test suite to test downloading bin files.

The general technique is
1. Create mock bin file content
2. Tell cs_dsp to download the bin file
3. Check in the emulated regmap registers that the correct values have
   been written to DSP memory
4. Drop the regmap cache for the expected written registers and then do a
   regcache_sync() to check for unexpected writes to other registers.

The test covers ADSP2 v1 and v2, and HALO Core DSPs. (ADSP1 is very
obsolete so isn't tested).

There is a large number of test cases and parameterized variants of tests
because of the many different addressing schemes supported by the Cirrus
devices. The DSP has 2 or 3 memory spaces: XM, YM and ZM. The DSP sees
these using its native addressing, which is word-addressed (not
byte-addressed). The host sees these through one of several register
mappings (depending on the DSP type and parent codec family). The
registers have three different addressing schemes: 16-bit registers
addressed by register number, 32-bit registers addressed by register
number, or 32-bit registers addressed by byte (with a stride of 4). In
addition to these multiple addressing schemes, the Halo Core DSPs have a
"packed" register mapping that maps 4 DSP words into 3 registers. The bin
file addresses the data blob relative to the base address of an algorithm,
which has to be calculated in both DSP words (for the DSP to access) and
register addresses (for the host).

This results in many different addressing schemes used in parallel, hence
the complexity of the address and size manipulation in the test cases:
word addresses in DSP memory, byte offsets, word offsets, register
addresses (either byte-addressed 32-bit or index-addressed 16-bit), and
packed register addresses.

The test cases intentionally have relatively little factoring-out of
similar code. This makes it much easier to visually verify that a test
case is testing correctly, and what exactly it is testing. Factoring out
large amounts of code into helper functions tends to obscure what the
actual test procedure is, so increasing the chance of hidden errors where
test cases don't actually test as intended.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20241212143725.1381013-6-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agofirmware: cs_dsp: Add mock bin file generator for KUnit testing
Richard Fitzgerald [Thu, 12 Dec 2024 14:37:17 +0000 (14:37 +0000)]
firmware: cs_dsp: Add mock bin file generator for KUnit testing

Add a mock firmware file that emulates what the firmware build tools
would normally create. This will be used by KUnit tests to generate a
test bin file.

The data payload in a bin is an opaque blob, so the mock bin only needs
to generate the appropriate file header and description block for each
payload blob.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20241212143725.1381013-5-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agofirmware: cs_dsp: Add mock wmfw file generator for KUnit testing
Richard Fitzgerald [Thu, 12 Dec 2024 14:37:16 +0000 (14:37 +0000)]
firmware: cs_dsp: Add mock wmfw file generator for KUnit testing

Add a mock firmware file that emulates what the firmware build tools
would normally create. This will be used by KUnit tests to generate a
test wmfw file.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20241212143725.1381013-4-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agofirmware: cs_dsp: Add mock DSP memory map for KUnit testing
Richard Fitzgerald [Thu, 12 Dec 2024 14:37:15 +0000 (14:37 +0000)]
firmware: cs_dsp: Add mock DSP memory map for KUnit testing

Add helper functions to implement an emulation of the DSP memory map.

There are three main groups of functionality:

1. Define a mock cs_dsp_region table.
2. Calculate the addresses of memory and algorithms from the firmware
   header in XM.
3. Build a mock XM header in emulated XM.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20241212143725.1381013-3-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agofirmware: cs_dsp: Add mock regmap for KUnit testing
Richard Fitzgerald [Thu, 12 Dec 2024 14:37:14 +0000 (14:37 +0000)]
firmware: cs_dsp: Add mock regmap for KUnit testing

Add a mock regmap implementation to act as a simulated DSP for KUnit
testing. This is built as a utility module so that it could be used by
clients of cs_dsp to create a mock "DSP" for their own testing.

cs_dsp interacts with the DSP only through registers. Most of the
register space of the DSP is RAM. ADSP cores have a small set of control
registers. HALO Core DSPs have a much larger set of control registers but
only a small subset are used.

Most writes are "blind" in the sense that cs_dsp does not expect to
receive any sort of response from the DSP. So there isn't any need to
emulate a "DSP", only a set of registers that can be written and read
back.

The idea of the mock regmap is to use the cache to accumulate writes
which can then be tested against the values that are expected to be in
the registers.

Stray writes can be detected by dropping the cache entries for all
addresses that should have been written and then issuing a regcache_sync().
If this causes bus writes it means there were writes to unexpected
registers.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20241212143725.1381013-2-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agoASoC: SOF: Intel: hda-pcm: Follow the pause_supported flag to drop PAUSE support
Peter Ujfalusi [Fri, 13 Dec 2024 10:11:23 +0000 (12:11 +0200)]
ASoC: SOF: Intel: hda-pcm: Follow the pause_supported flag to drop PAUSE support

If the stream's pause_supported flag is false then mask out the PAUSE
support, so user space will be prevented to use it.

Introduce a module parameter to ignore the pause_supported flag, named as
force_pause_support to allow testing of the PAUSE feature.

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>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Link: https://patch.msgid.link/20241213101123.27318-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agoASoC: SOF: Add support for pause supported tokens from topology
Peter Ujfalusi [Fri, 13 Dec 2024 10:11:22 +0000 (12:11 +0200)]
ASoC: SOF: Add support for pause supported tokens from topology

New tokens are added to topology:
1202: SOF_TKN_STREAM_PLAYBACK_PAUSE_SUPPORTED
1203: SOF_TKN_STREAM_CAPTURE_PAUSE_SUPPORTED

The new tokens are used to advertise support for PAUSE/RESUME operation on
a PCM device depending on firmware product, use case, pipeline topology.

The snd_sof_pcm_stream.pause_supported is updated to reflect the advertised
value for the PCM device.

If the token does not exist then the pause_supported is set to false.

Note: it is up to the platform code to use this flag to decide to advertise
the PAUSE support for user space or not.

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>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Link: https://patch.msgid.link/20241213101123.27318-2-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agoASoC: fsl_easrc: register m2m platform device
Shengjiu Wang [Thu, 12 Dec 2024 07:45:09 +0000 (15:45 +0800)]
ASoC: fsl_easrc: register m2m platform device

Register m2m platform device,that user can
use M2M feature.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Jaroslav Kysela <perex@perex.cz>
Link: https://patch.msgid.link/20241212074509.3445859-7-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agoASoC: fsl_asrc: register m2m platform device
Shengjiu Wang [Thu, 12 Dec 2024 07:45:08 +0000 (15:45 +0800)]
ASoC: fsl_asrc: register m2m platform device

Register m2m platform device, that user can
use M2M feature.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Jaroslav Kysela <perex@perex.cz>
Link: https://patch.msgid.link/20241212074509.3445859-6-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agoASoC: fsl_asrc_m2m: Add memory to memory function
Shengjiu Wang [Thu, 12 Dec 2024 07:45:07 +0000 (15:45 +0800)]
ASoC: fsl_asrc_m2m: Add memory to memory function

Implement the ASRC memory to memory function using
the compress framework, user can use this function with
compress ioctl interface.

This feature can be shared by ASRC and EASRC drivers

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Jaroslav Kysela <perex@perex.cz>
Link: https://patch.msgid.link/20241212074509.3445859-5-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agoASoC: fsl_easrc: define functions for memory to memory usage
Shengjiu Wang [Thu, 12 Dec 2024 07:45:06 +0000 (15:45 +0800)]
ASoC: fsl_easrc: define functions for memory to memory usage

ASRC can be used on memory to memory case, define several
functions for m2m usage and export them as function pointer.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Jaroslav Kysela <perex@perex.cz>
Link: https://patch.msgid.link/20241212074509.3445859-4-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agoASoC: fsl_asrc: define functions for memory to memory usage
Shengjiu Wang [Thu, 12 Dec 2024 07:45:05 +0000 (15:45 +0800)]
ASoC: fsl_asrc: define functions for memory to memory usage

ASRC can be used on memory to memory case, define several
functions for m2m usage.

m2m_prepare: prepare for the start step
m2m_start: the start step
m2m_unprepare: unprepare for stop step, optional
m2m_stop: stop step
m2m_check_format: check format is supported or not
m2m_calc_out_len: calculate output length according to input length
m2m_get_maxburst: burst size for dma
m2m_pair_suspend: suspend function of pair, optional.
m2m_pair_resume: resume function of pair
get_output_fifo_size: get remaining data size in FIFO

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Jaroslav Kysela <perex@perex.cz>
Link: https://patch.msgid.link/20241212074509.3445859-3-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agoALSA: compress: Add output rate and output format support
Shengjiu Wang [Thu, 12 Dec 2024 07:45:04 +0000 (15:45 +0800)]
ALSA: compress: Add output rate and output format support

Add 'pcm_format' for struct snd_codec, add 'pcm_formats' for
struct snd_codec_desc, these are used for accelerator usage.

Current accelerator example is sample rate converter (SRC).
Define struct snd_codec_desc_src for descript minmum and maxmum
sample rates. And add 'src_d' in union snd_codec_options
structure. These are mainly used for capbility query.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Jaroslav Kysela <perex@perex.cz>
Acked-by: Vinod Koul <vkoul@kernel.org>
Link: https://patch.msgid.link/20241212074509.3445859-2-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agoAdd audio support for the Renesas RZ/G3S SoC
Mark Brown [Wed, 11 Dec 2024 17:02:47 +0000 (17:02 +0000)]
Add audio support for the Renesas RZ/G3S SoC

Merge series from Claudiu <claudiu.beznea@tuxon.dev>:

Series enables the audio support for the Renesas RZ/G3S
SoC along with runtime PM and suspend to RAM.

7 months agoASoC: dt-bindings: convert rt5682.txt to dt-schema
Neil Armstrong [Wed, 11 Dec 2024 08:09:55 +0000 (09:09 +0100)]
ASoC: dt-bindings: convert rt5682.txt to dt-schema

Convert the text bindings for the Realtek rt5682 and
rt5682i codecs to dt-schema.

Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20241211-topic-misc-rt5682-convert-v2-1-9e1dd4ff7093@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agoASoC: dt-bindings: renesas,rz-ssi: Document the Renesas RZ/G3S SoC
Claudiu Beznea [Tue, 10 Dec 2024 17:09:48 +0000 (19:09 +0200)]
ASoC: dt-bindings: renesas,rz-ssi: Document the Renesas RZ/G3S SoC

The SSI IP variant present on the Renesas RZ/G3S SoC is similar to the
one found on the Renesas RZ/G2{UL, L, LC} SoCs. Add documentation for
it.

Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://patch.msgid.link/20241210170953.2936724-20-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agoASoC: dt-bindings: renesas,rz-ssi: Remove DMA description
Claudiu Beznea [Tue, 10 Dec 2024 17:09:47 +0000 (19:09 +0200)]
ASoC: dt-bindings: renesas,rz-ssi: Remove DMA description

Remove the DMA description, as it duplicates content from
../dma/renesas,rz-dma.yaml. Additionally, remove the MID/RID examples
mentioned in the dropped description (this information is already
documented in the hardware manual).

Suggested-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Link: https://patch.msgid.link/20241210170953.2936724-19-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agoASoC: renesas: rz-ssi: Add suspend to RAM support
Claudiu Beznea [Tue, 10 Dec 2024 17:09:46 +0000 (19:09 +0200)]
ASoC: renesas: rz-ssi: Add suspend to RAM support

The SSIF-2 IP is available on the Renesas RZ/G3S SoC. The Renesas RZ/G3S
SoC supports a power-saving mode where power to most of the SoC
components is turned off. Add suspend/resume support to the SSIF-2 driver
to support this power-saving mode.

On SNDRV_PCM_TRIGGER_SUSPEND trigger the SSI is stopped (the stream
user pointer is left untouched to avoid breaking user space and the dma
buffer pointer is set to zero), on SNDRV_PCM_TRIGGER_RESUME software reset
is issued for the SSIF-2 IP and the clocks are re-configured.

Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Link: https://patch.msgid.link/20241210170953.2936724-18-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agoASoC: renesas: rz-ssi: Issue software reset in hw_params API
Claudiu Beznea [Tue, 10 Dec 2024 17:09:45 +0000 (19:09 +0200)]
ASoC: renesas: rz-ssi: Issue software reset in hw_params API

The code initially issued software reset on SNDRV_PCM_TRIGGER_START
action only before starting the first stream. This can be easily moved to
hw_params() as the action is similar to setting the clocks. Moreover,
according to the hardware manual (Table 35.7 Bits Initialized by Software
Reset of the SSIFCR.SSIRST Bit) the software reset action acts also on the
clock dividers bits. Due to this issue the software reset in hw_params()
before configuring the clock dividers. This also simplifies the code in
trigger API.

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Link: https://patch.msgid.link/20241210170953.2936724-17-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agoASoC: renesas: rz-ssi: Add runtime PM support
Claudiu Beznea [Tue, 10 Dec 2024 17:09:44 +0000 (19:09 +0200)]
ASoC: renesas: rz-ssi: Add runtime PM support

Add runtime PM support to the ssi driver. This assert/de-assert the
reset lines on runtime suspend/resume. Along with it the de-assertion of
the reset line from probe function was removed as it is not necessary
anymore.

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Link: https://patch.msgid.link/20241210170953.2936724-16-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agoASoC: renesas: rz-ssi: Enable runtime PM autosuspend support
Claudiu Beznea [Tue, 10 Dec 2024 17:09:43 +0000 (19:09 +0200)]
ASoC: renesas: rz-ssi: Enable runtime PM autosuspend support

Enable runtime PM autosuspend support. The chosen autosuspend delay is
zero for immediate autosuspend. In case there are users that need a
different autosuspend delay, it can be adjusted through sysfs.

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Link: https://patch.msgid.link/20241210170953.2936724-15-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agoASoC: renesas: rz-ssi: Rely on the ASoC subsystem to runtime resume/suspend the SSI
Claudiu Beznea [Tue, 10 Dec 2024 17:09:42 +0000 (19:09 +0200)]
ASoC: renesas: rz-ssi: Rely on the ASoC subsystem to runtime resume/suspend the SSI

The ASoC subsystem takes care of runtime resume/suspend the audio
devices when needed. Just enable the runtime PM on the SSI driver and
let the subsystem runtime resume/suspend it. While at it use directly
the devm_pm_runtime_enable().

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Link: https://patch.msgid.link/20241210170953.2936724-14-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agoASoC: renesas: rz-ssi: Use goto label names that specify their actions
Claudiu Beznea [Tue, 10 Dec 2024 17:09:41 +0000 (19:09 +0200)]
ASoC: renesas: rz-ssi: Use goto label names that specify their actions

Use goto label names that specify their action. In this way we can have
a better understanding of what is the action associated with the label
by just reading the label name.

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Link: https://patch.msgid.link/20241210170953.2936724-13-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agoASoC: renesas: rz-ssi: Use temporary variable for struct device
Claudiu Beznea [Tue, 10 Dec 2024 17:09:40 +0000 (19:09 +0200)]
ASoC: renesas: rz-ssi: Use temporary variable for struct device

Use a temporary variable for the struct device pointers to avoid
dereferencing.

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Link: https://patch.msgid.link/20241210170953.2936724-12-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agoASoC: renesas: rz-ssi: Use readl_poll_timeout_atomic()
Claudiu Beznea [Tue, 10 Dec 2024 17:09:39 +0000 (19:09 +0200)]
ASoC: renesas: rz-ssi: Use readl_poll_timeout_atomic()

Use readl_poll_timeout_atomic() instead of hardcoding something similar.
While at it replace dev_info() with dev_warn_ratelimited() as the
rz_ssi_set_idle() can also be called from IRQ context and if the SSI
idle is not properly set this is at least a warning for user.

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Link: https://patch.msgid.link/20241210170953.2936724-11-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agoASoC: renesas: rz-ssi: Remove the first argument of rz_ssi_stream_is_play()
Claudiu Beznea [Tue, 10 Dec 2024 17:09:38 +0000 (19:09 +0200)]
ASoC: renesas: rz-ssi: Remove the first argument of rz_ssi_stream_is_play()

The first argument of the rz_ssi_stream_is_play() is not used. Remove it.

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Link: https://patch.msgid.link/20241210170953.2936724-10-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agoASoC: renesas: rz-ssi: Remove the rz_ssi_get_dai() function
Claudiu Beznea [Tue, 10 Dec 2024 17:09:37 +0000 (19:09 +0200)]
ASoC: renesas: rz-ssi: Remove the rz_ssi_get_dai() function

Remove the rz_ssi_get_dai() function and use directly the
snd_soc_rtd_to_cpu() where needed or the struct device pointer embedded
in the struct rz_ssi_priv objects.

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Link: https://patch.msgid.link/20241210170953.2936724-9-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agoASoC: renesas: rz-ssi: Remove pdev member of struct rz_ssi_priv
Claudiu Beznea [Tue, 10 Dec 2024 17:09:36 +0000 (19:09 +0200)]
ASoC: renesas: rz-ssi: Remove pdev member of struct rz_ssi_priv

Remove the pdev member of struct rz_ssi_priv as it is not used.

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Link: https://patch.msgid.link/20241210170953.2936724-8-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agoASoC: renesas: rz-ssi: Fix typo on SSI_RATES macro comment
Claudiu Beznea [Tue, 10 Dec 2024 17:09:35 +0000 (19:09 +0200)]
ASoC: renesas: rz-ssi: Fix typo on SSI_RATES macro comment

The SSI_RATES macro covers 8KHz-48KHz audio frequencies. Update macro
comment to reflect it.

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Link: https://patch.msgid.link/20241210170953.2936724-7-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agoASoC: renesas: rz-ssi: Use only the proper amount of dividers
Claudiu Beznea [Tue, 10 Dec 2024 17:09:34 +0000 (19:09 +0200)]
ASoC: renesas: rz-ssi: Use only the proper amount of dividers

There is no need to populate the ckdv[] with invalid dividers as that
part will not be indexed anyway. The ssi->audio_mck/bclk_rate should
always be >= 0. While at it, change the ckdv type as u8, as the divider
128 was previously using the s8 sign bit.

Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Fixes: 03e786bd43410fa9 ("ASoC: sh: Add RZ/G2L SSIF-2 driver")
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://patch.msgid.link/20241210170953.2936724-6-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agoASoC: renesas: rz-ssi: Terminate all the DMA transactions
Claudiu Beznea [Tue, 10 Dec 2024 17:09:33 +0000 (19:09 +0200)]
ASoC: renesas: rz-ssi: Terminate all the DMA transactions

The stop trigger invokes rz_ssi_stop() and rz_ssi_stream_quit().
- The purpose of rz_ssi_stop() is to disable TX/RX, terminate DMA
  transactions, and set the controller to idle.
- The purpose of rz_ssi_stream_quit() is to reset the substream-specific
  software data by setting strm->running and strm->substream appropriately.

The function rz_ssi_is_stream_running() checks if both strm->substream and
strm->running are valid and returns true if so. Its implementation is as
follows:

static inline bool rz_ssi_is_stream_running(struct rz_ssi_stream *strm)
{
    return strm->substream && strm->running;
}

When the controller is configured in full-duplex mode (with both playback
and capture active), the rz_ssi_stop() function does not modify the
controller settings when called for the first substream in the full-duplex
setup. Instead, it simply sets strm->running = 0 and returns if the
companion substream is still running. The following code illustrates this:

static int rz_ssi_stop(struct rz_ssi_priv *ssi, struct rz_ssi_stream *strm)
{
    strm->running = 0;

    if (rz_ssi_is_stream_running(&ssi->playback) ||
        rz_ssi_is_stream_running(&ssi->capture))
        return 0;

    // ...
}

The controller settings, along with the DMA termination (for the last
stopped substream), are only applied when the last substream in the
full-duplex setup is stopped.

While applying the controller settings only when the last substream stops
is not problematic, terminating the DMA operations for only one substream
causes failures when starting and stopping full-duplex operations multiple
times in a loop.

To address this issue, call dmaengine_terminate_async() for both substreams
involved in the full-duplex setup when the last substream in the setup is
stopped.

Fixes: 4f8cd05a4305 ("ASoC: sh: rz-ssi: Add full duplex support")
Cc: stable@vger.kernel.org
Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://patch.msgid.link/20241210170953.2936724-5-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agoASoC: simple-card-utils: tidyup for Multi connection
Mark Brown [Tue, 10 Dec 2024 13:46:41 +0000 (13:46 +0000)]
ASoC: simple-card-utils: tidyup for Multi connection

Merge series from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:

These patches tidyup simple-card-utils for Multi connection of
Audio Graph Card, Because of DT node parsing, it should check port
1st instead of endpoint. Otherwise, it can't handle DAI correctly.

7 months agoAdd function to constrain rates
Mark Brown [Tue, 10 Dec 2024 12:37:21 +0000 (12:37 +0000)]
Add function to constrain rates

Merge series from Chancel Liu <chancel.liu@nxp.com>:

Platforms like i.MX93/91 only have one audio PLL. Some sample rates are
not supported. If the PLL source is used for 8kHz series rates, then
11kHz series rates can't be supported. Add common function to constrain
rates according to different clock sources.

In ASoC drivers switch to this new function.

7 months agoASoC: sun4i-spdif: Add 24bit support
Mark Brown [Tue, 10 Dec 2024 12:37:17 +0000 (12:37 +0000)]
ASoC: sun4i-spdif: Add 24bit support

Merge series from codekipper@gmail.com:

I've tested this patch series on the Allwinner H3, A64, H6 and H313 SoCs
up to 192KHz.
24bit support is working on my H313 board but 16bit plays a bit slow and
I suspect that there is an issue with the clock setups. This is even
present without this patch stack. I would look to address this asap,
but for now can you please review what's here.

7 months agoASoC: Intel: boards: updates for 6.14
Mark Brown [Tue, 10 Dec 2024 12:37:13 +0000 (12:37 +0000)]
ASoC: Intel: boards: updates for 6.14

Merge series from Bard Liao <yung-chuan.liao@linux.intel.com>:

1. Fix the incorrect cfg-mics value in card->components string.
2. New codec match entries supports.

Bard Liao (6):
  ASoC: Intel: sof_sdw: correct mach_params->dmic_num
  ASoC: Intel: sof_sdw: reduce log level for not using internal dmic
  ASoC: Intel: sof_sdw: improve the log of DAI link numbers
  ASoC: Intel: soc-acpi-intel-ptl-match: add rt712_vb + rt1320 support
  ASoC: Intel: soc-acpi-intel-lnl-match: add rt713_vb_l2_rt1320_l13
    support
  ASoC: Intel: soc-acpi-intel-ptl-match: add rt713_vb_l2_rt1320_l13
    support

Simon Trimmer (4):
  ASoC: Intel: sof_sdw: Correct quirk for Lenovo Yoga Slim 7
  ASoC: Intel: sof_sdw: Add a dev_dbg message for the SOC_SDW_CODEC_MIC
    quirk
  ASoC: Intel: soc-acpi: arl: Correct naming of a cs35l56 address struct
  ASoC: Intel: soc-acpi: arl: Add match entries for new cs42l43 laptops

 sound/soc/intel/boards/sof_sdw.c              |  33 ++--
 .../intel/common/soc-acpi-intel-arl-match.c   |  45 +++++-
 .../intel/common/soc-acpi-intel-lnl-match.c   |  70 +++++++++
 .../intel/common/soc-acpi-intel-ptl-match.c   | 148 ++++++++++++++++++
 4 files changed, 282 insertions(+), 14 deletions(-)

--
2.43.0

7 months agoASoC: sun4i-spdif: Add working 24bit audio support
Marcus Cooper [Mon, 11 Nov 2024 16:55:31 +0000 (17:55 +0100)]
ASoC: sun4i-spdif: Add working 24bit audio support

24 bit audio file can be detected by the alsa driver as S32_LE.
Add this format to what is supported and change the DMA address
width.

Signed-off-by: Marcus Cooper <codekipper@gmail.com>
Link: https://patch.msgid.link/20241111165600.57219-4-codekipper@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agoASoC: sun4i-spdif: Always set the valid data to be the MSB
Marcus Cooper [Mon, 11 Nov 2024 16:55:30 +0000 (17:55 +0100)]
ASoC: sun4i-spdif: Always set the valid data to be the MSB

This doesn't affect 16bit formats and allows us to properly run
24bit formats.

Signed-off-by: Marcus Cooper <codekipper@gmail.com>
Link: https://patch.msgid.link/20241111165600.57219-3-codekipper@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agoASoC: sun4i-spdif: Add clock multiplier settings
George Lander [Mon, 11 Nov 2024 16:55:29 +0000 (17:55 +0100)]
ASoC: sun4i-spdif: Add clock multiplier settings

There have been intermittent issues with the SPDIF output on H3
and H2+ devices which has been fixed by setting the s_clk to 4
times the audio pll.
Add a quirk for the clock multiplier as not every supported SoC
requires it. Without the multiplier, the audio at normal sampling
rates was distorted and did not play at higher sampling rates.

Fixes: 1bd92af877ab ("ASoC: sun4i-spdif: Add support for the H3 SoC")
Signed-off-by: George Lander <lander@jagmn.com>
Signed-off-by: Marcus Cooper <codekipper@gmail.com>
Link: https://patch.msgid.link/20241111165600.57219-2-codekipper@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agoASoC: wm8985: Remove use of i2c_match_id()
Andrew Davis [Tue, 3 Dec 2024 20:00:01 +0000 (14:00 -0600)]
ASoC: wm8985: Remove use of i2c_match_id()

The function i2c_match_id() is used to fetch the matching ID from
the i2c_device_id table. This is often used to then retrieve the
matching driver_data. This can be done in one step with the helper
i2c_get_match_data().

This helper has a couple other benefits:
 * It doesn't need the i2c_device_id passed in so we do not need
   to have that forward declared, allowing us to remove those or
   move the i2c_device_id table down to its more natural spot
   with the other module info.
 * It also checks for device match data, which allows for OF and
   ACPI based probing. That means we do not have to manually check
   those first and can remove those checks.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://patch.msgid.link/20241203200001.197295-21-afd@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agoASoC: wm8904: Remove use of i2c_match_id()
Andrew Davis [Tue, 3 Dec 2024 20:00:00 +0000 (14:00 -0600)]
ASoC: wm8904: Remove use of i2c_match_id()

The function i2c_match_id() is used to fetch the matching ID from
the i2c_device_id table. This is often used to then retrieve the
matching driver_data. This can be done in one step with the helper
i2c_get_match_data().

This helper has a couple other benefits:
 * It doesn't need the i2c_device_id passed in so we do not need
   to have that forward declared, allowing us to remove those or
   move the i2c_device_id table down to its more natural spot
   with the other module info.
 * It also checks for device match data, which allows for OF and
   ACPI based probing. That means we do not have to manually check
   those first and can remove those checks.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://patch.msgid.link/20241203200001.197295-20-afd@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agoASoC: tpa6130a2: Remove use of i2c_match_id()
Andrew Davis [Tue, 3 Dec 2024 19:59:59 +0000 (13:59 -0600)]
ASoC: tpa6130a2: Remove use of i2c_match_id()

The function i2c_match_id() is used to fetch the matching ID from
the i2c_device_id table. This is often used to then retrieve the
matching driver_data. This can be done in one step with the helper
i2c_get_match_data().

This helper has a couple other benefits:
 * It doesn't need the i2c_device_id passed in so we do not need
   to have that forward declared, allowing us to remove those or
   move the i2c_device_id table down to its more natural spot
   with the other module info.
 * It also checks for device match data, which allows for OF and
   ACPI based probing. That means we do not have to manually check
   those first and can remove those checks.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://patch.msgid.link/20241203200001.197295-19-afd@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agoASoC: tlv320aic3x: Remove use of i2c_match_id()
Andrew Davis [Tue, 3 Dec 2024 19:59:58 +0000 (13:59 -0600)]
ASoC: tlv320aic3x: Remove use of i2c_match_id()

The function i2c_match_id() is used to fetch the matching ID from
the i2c_device_id table. This is often used to then retrieve the
matching driver_data. This can be done in one step with the helper
i2c_get_match_data().

This helper has a couple other benefits:
 * It doesn't need the i2c_device_id passed in so we do not need
   to have that forward declared, allowing us to remove those or
   move the i2c_device_id table down to its more natural spot
   with the other module info.
 * It also checks for device match data, which allows for OF and
   ACPI based probing. That means we do not have to manually check
   those first and can remove those checks.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://patch.msgid.link/20241203200001.197295-18-afd@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agoASoC: tlv320aic31xx: Remove use of i2c_match_id()
Andrew Davis [Tue, 3 Dec 2024 19:59:57 +0000 (13:59 -0600)]
ASoC: tlv320aic31xx: Remove use of i2c_match_id()

The function i2c_match_id() is used to fetch the matching ID from
the i2c_device_id table. This is often used to then retrieve the
matching driver_data. This can be done in one step with the helper
i2c_get_match_data().

This helper has a couple other benefits:
 * It doesn't need the i2c_device_id passed in so we do not need
   to have that forward declared, allowing us to remove those or
   move the i2c_device_id table down to its more natural spot
   with the other module info.
 * It also checks for device match data, which allows for OF and
   ACPI based probing. That means we do not have to manually check
   those first and can remove those checks.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://patch.msgid.link/20241203200001.197295-17-afd@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agoASoC: tlv320adc3xxx: Remove use of i2c_match_id()
Andrew Davis [Tue, 3 Dec 2024 19:59:56 +0000 (13:59 -0600)]
ASoC: tlv320adc3xxx: Remove use of i2c_match_id()

The function i2c_match_id() is used to fetch the matching ID from
the i2c_device_id table. This is often used to then retrieve the
matching driver_data. This can be done in one step with the helper
i2c_get_match_data().

This helper has a couple other benefits:
 * It doesn't need the i2c_device_id passed in so we do not need
   to have that forward declared, allowing us to remove those or
   move the i2c_device_id table down to its more natural spot
   with the other module info.
 * It also checks for device match data, which allows for OF and
   ACPI based probing. That means we do not have to manually check
   those first and can remove those checks.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://patch.msgid.link/20241203200001.197295-16-afd@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agoASoC: tas5720: Remove use of i2c_match_id()
Andrew Davis [Tue, 3 Dec 2024 19:59:55 +0000 (13:59 -0600)]
ASoC: tas5720: Remove use of i2c_match_id()

The function i2c_match_id() is used to fetch the matching ID from
the i2c_device_id table. This is often used to then retrieve the
matching driver_data. This can be done in one step with the helper
i2c_get_match_data().

This helper has a couple other benefits:
 * It doesn't need the i2c_device_id passed in so we do not need
   to have that forward declared, allowing us to remove those or
   move the i2c_device_id table down to its more natural spot
   with the other module info.
 * It also checks for device match data, which allows for OF and
   ACPI based probing. That means we do not have to manually check
   those first and can remove those checks.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://patch.msgid.link/20241203200001.197295-15-afd@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agoASoC: tas2781: Remove use of i2c_match_id()
Andrew Davis [Tue, 3 Dec 2024 19:59:54 +0000 (13:59 -0600)]
ASoC: tas2781: Remove use of i2c_match_id()

The function i2c_match_id() is used to fetch the matching ID from
the i2c_device_id table. This is often used to then retrieve the
matching driver_data. This can be done in one step with the helper
i2c_get_match_data().

This helper has a couple other benefits:
 * It doesn't need the i2c_device_id passed in so we do not need
   to have that forward declared, allowing us to remove those or
   move the i2c_device_id table down to its more natural spot
   with the other module info.
 * It also checks for device match data, which allows for OF and
   ACPI based probing. That means we do not have to manually check
   those first and can remove those checks.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://patch.msgid.link/20241203200001.197295-14-afd@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agoASoC: tas2562: Remove use of i2c_match_id()
Andrew Davis [Tue, 3 Dec 2024 19:59:53 +0000 (13:59 -0600)]
ASoC: tas2562: Remove use of i2c_match_id()

The function i2c_match_id() is used to fetch the matching ID from
the i2c_device_id table. This is often used to then retrieve the
matching driver_data. This can be done in one step with the helper
i2c_get_match_data().

This helper has a couple other benefits:
 * It doesn't need the i2c_device_id passed in so we do not need
   to have that forward declared, allowing us to remove those or
   move the i2c_device_id table down to its more natural spot
   with the other module info.
 * It also checks for device match data, which allows for OF and
   ACPI based probing. That means we do not have to manually check
   those first and can remove those checks.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://patch.msgid.link/20241203200001.197295-13-afd@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agoASoC: ssm2602: Remove use of i2c_match_id()
Andrew Davis [Tue, 3 Dec 2024 19:59:52 +0000 (13:59 -0600)]
ASoC: ssm2602: Remove use of i2c_match_id()

The function i2c_match_id() is used to fetch the matching ID from
the i2c_device_id table. This is often used to then retrieve the
matching driver_data. This can be done in one step with the helper
i2c_get_match_data().

This helper has a couple other benefits:
 * It doesn't need the i2c_device_id passed in so we do not need
   to have that forward declared, allowing us to remove those or
   move the i2c_device_id table down to its more natural spot
   with the other module info.
 * It also checks for device match data, which allows for OF and
   ACPI based probing. That means we do not have to manually check
   those first and can remove those checks.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://patch.msgid.link/20241203200001.197295-12-afd@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agoASoc: pcm6240: Remove use of i2c_match_id()
Andrew Davis [Tue, 3 Dec 2024 19:59:51 +0000 (13:59 -0600)]
ASoc: pcm6240: Remove use of i2c_match_id()

The function i2c_match_id() is used to fetch the matching ID from
the i2c_device_id table. This is often used to then retrieve the
matching driver_data. This can be done in one step with the helper
i2c_get_match_data().

This helper has a couple other benefits:
 * It doesn't need the i2c_device_id passed in so we do not need
   to have that forward declared, allowing us to remove those or
   move the i2c_device_id table down to its more natural spot
   with the other module info.
 * It also checks for device match data, which allows for OF and
   ACPI based probing. That means we do not have to manually check
   those first and can remove those checks.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://patch.msgid.link/20241203200001.197295-11-afd@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agoASoC: pcm186x: Remove use of i2c_match_id()
Andrew Davis [Tue, 3 Dec 2024 19:59:50 +0000 (13:59 -0600)]
ASoC: pcm186x: Remove use of i2c_match_id()

The function i2c_match_id() is used to fetch the matching ID from
the i2c_device_id table. This is often used to then retrieve the
matching driver_data. This can be done in one step with the helper
i2c_get_match_data().

This helper has a couple other benefits:
 * It doesn't need the i2c_device_id passed in so we do not need
   to have that forward declared, allowing us to remove those or
   move the i2c_device_id table down to its more natural spot
   with the other module info.
 * It also checks for device match data, which allows for OF and
   ACPI based probing. That means we do not have to manually check
   those first and can remove those checks.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://patch.msgid.link/20241203200001.197295-10-afd@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agoASoC: max98095: Remove use of i2c_match_id()
Andrew Davis [Tue, 3 Dec 2024 19:59:49 +0000 (13:59 -0600)]
ASoC: max98095: Remove use of i2c_match_id()

The function i2c_match_id() is used to fetch the matching ID from
the i2c_device_id table. This is often used to then retrieve the
matching driver_data. This can be done in one step with the helper
i2c_get_match_data().

This helper has a couple other benefits:
 * It doesn't need the i2c_device_id passed in so we do not need
   to have that forward declared, allowing us to remove those or
   move the i2c_device_id table down to its more natural spot
   with the other module info.
 * It also checks for device match data, which allows for OF and
   ACPI based probing. That means we do not have to manually check
   those first and can remove those checks.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://patch.msgid.link/20241203200001.197295-9-afd@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agoASoC: max98090: Remove use of i2c_match_id()
Andrew Davis [Tue, 3 Dec 2024 19:59:48 +0000 (13:59 -0600)]
ASoC: max98090: Remove use of i2c_match_id()

The function i2c_match_id() is used to fetch the matching ID from
the i2c_device_id table. This is often used to then retrieve the
matching driver_data. This can be done in one step with the helper
i2c_get_match_data().

This helper has a couple other benefits:
 * It doesn't need the i2c_device_id passed in so we do not need
   to have that forward declared, allowing us to remove those or
   move the i2c_device_id table down to its more natural spot
   with the other module info.
 * It also checks for device match data, which allows for OF and
   ACPI based probing. That means we do not have to manually check
   those first and can remove those checks.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://patch.msgid.link/20241203200001.197295-8-afd@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agoASoC: max98088: Remove use of i2c_match_id()
Andrew Davis [Tue, 3 Dec 2024 19:59:47 +0000 (13:59 -0600)]
ASoC: max98088: Remove use of i2c_match_id()

The function i2c_match_id() is used to fetch the matching ID from
the i2c_device_id table. This is often used to then retrieve the
matching driver_data. This can be done in one step with the helper
i2c_get_match_data().

This helper has a couple other benefits:
 * It doesn't need the i2c_device_id passed in so we do not need
   to have that forward declared, allowing us to remove those or
   move the i2c_device_id table down to its more natural spot
   with the other module info.
 * It also checks for device match data, which allows for OF and
   ACPI based probing. That means we do not have to manually check
   those first and can remove those checks.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://patch.msgid.link/20241203200001.197295-7-afd@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agoASoC: alc5632: Remove use of i2c_match_id()
Andrew Davis [Tue, 3 Dec 2024 19:59:46 +0000 (13:59 -0600)]
ASoC: alc5632: Remove use of i2c_match_id()

The function i2c_match_id() is used to fetch the matching ID from
the i2c_device_id table. This is often used to then retrieve the
matching driver_data. This can be done in one step with the helper
i2c_get_match_data().

This helper has a couple other benefits:
 * It doesn't need the i2c_device_id passed in so we do not need
   to have that forward declared, allowing us to remove those or
   move the i2c_device_id table down to its more natural spot
   with the other module info.
 * It also checks for device match data, which allows for OF and
   ACPI based probing. That means we do not have to manually check
   those first and can remove those checks.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://patch.msgid.link/20241203200001.197295-6-afd@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agoASoC: alc5623: Remove use of i2c_match_id()
Andrew Davis [Tue, 3 Dec 2024 19:59:45 +0000 (13:59 -0600)]
ASoC: alc5623: Remove use of i2c_match_id()

The function i2c_match_id() is used to fetch the matching ID from
the i2c_device_id table. This is often used to then retrieve the
matching driver_data. This can be done in one step with the helper
i2c_get_match_data().

This helper has a couple other benefits:
 * It doesn't need the i2c_device_id passed in so we do not need
   to have that forward declared, allowing us to remove those or
   move the i2c_device_id table down to its more natural spot
   with the other module info.
 * It also checks for device match data, which allows for OF and
   ACPI based probing. That means we do not have to manually check
   those first and can remove those checks.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://patch.msgid.link/20241203200001.197295-5-afd@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agoASoC: adau1977: Remove use of i2c_match_id()
Andrew Davis [Tue, 3 Dec 2024 19:59:44 +0000 (13:59 -0600)]
ASoC: adau1977: Remove use of i2c_match_id()

The function i2c_match_id() is used to fetch the matching ID from
the i2c_device_id table. This is often used to then retrieve the
matching driver_data. This can be done in one step with the helper
i2c_get_match_data().

This helper has a couple other benefits:
 * It doesn't need the i2c_device_id passed in so we do not need
   to have that forward declared, allowing us to remove those or
   move the i2c_device_id table down to its more natural spot
   with the other module info.
 * It also checks for device match data, which allows for OF and
   ACPI based probing. That means we do not have to manually check
   those first and can remove those checks.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://patch.msgid.link/20241203200001.197295-4-afd@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agoASoC: adau1781: Remove use of i2c_match_id()
Andrew Davis [Tue, 3 Dec 2024 19:59:43 +0000 (13:59 -0600)]
ASoC: adau1781: Remove use of i2c_match_id()

The function i2c_match_id() is used to fetch the matching ID from
the i2c_device_id table. This is often used to then retrieve the
matching driver_data. This can be done in one step with the helper
i2c_get_match_data().

This helper has a couple other benefits:
 * It doesn't need the i2c_device_id passed in so we do not need
   to have that forward declared, allowing us to remove those or
   move the i2c_device_id table down to its more natural spot
   with the other module info.
 * It also checks for device match data, which allows for OF and
   ACPI based probing. That means we do not have to manually check
   those first and can remove those checks.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://patch.msgid.link/20241203200001.197295-3-afd@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agoASoC: adau1761: Remove use of i2c_match_id()
Andrew Davis [Tue, 3 Dec 2024 19:59:42 +0000 (13:59 -0600)]
ASoC: adau1761: Remove use of i2c_match_id()

The function i2c_match_id() is used to fetch the matching ID from
the i2c_device_id table. This is often used to then retrieve the
matching driver_data. This can be done in one step with the helper
i2c_get_match_data().

This helper has a couple other benefits:
 * It doesn't need the i2c_device_id passed in so we do not need
   to have that forward declared, allowing us to remove those or
   move the i2c_device_id table down to its more natural spot
   with the other module info.
 * It also checks for device match data, which allows for OF and
   ACPI based probing. That means we do not have to manually check
   those first and can remove those checks.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://patch.msgid.link/20241203200001.197295-2-afd@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agoASoC: ad193x: Remove use of i2c_match_id()
Andrew Davis [Tue, 3 Dec 2024 19:59:41 +0000 (13:59 -0600)]
ASoC: ad193x: Remove use of i2c_match_id()

The function i2c_match_id() is used to fetch the matching ID from
the i2c_device_id table. This is often used to then retrieve the
matching driver_data. This can be done in one step with the helper
i2c_get_match_data().

This helper has a couple other benefits:
 * It doesn't need the i2c_device_id passed in so we do not need
   to have that forward declared, allowing us to remove those or
   move the i2c_device_id table down to its more natural spot
   with the other module info.
 * It also checks for device match data, which allows for OF and
   ACPI based probing. That means we do not have to manually check
   those first and can remove those checks.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://patch.msgid.link/20241203200001.197295-1-afd@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agoASoC: dt-bindings: qcom,wcd9335: Drop number of DAIs from the header
Krzysztof Kozlowski [Mon, 9 Dec 2024 09:44:42 +0000 (10:44 +0100)]
ASoC: dt-bindings: qcom,wcd9335: Drop number of DAIs from the header

Number of DAIs in the codec is not really a binding constant, because it
could grow, e.g. when we implement missing features.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20241209094442.38900-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agoASoC: codecs: wcd9335: Add define for number of DAIs
Krzysztof Kozlowski [Mon, 9 Dec 2024 09:44:41 +0000 (10:44 +0100)]
ASoC: codecs: wcd9335: Add define for number of DAIs

Number of DAIs in the codec is not really a binding, because it could
grow, e.g. when we implement missing features.  Add the define to the
driver, which will replace the one in the binding header.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20241209094442.38900-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agoASoC: Intel: soc-acpi: arl: Add match entries for new cs42l43 laptops
Simon Trimmer [Fri, 6 Dec 2024 07:59:03 +0000 (15:59 +0800)]
ASoC: Intel: soc-acpi: arl: Add match entries for new cs42l43 laptops

Add some new match table entries on Arrowlake for some coming cs42l43
laptops.

Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://patch.msgid.link/20241206075903.195730-11-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agoASoC: Intel: soc-acpi: arl: Correct naming of a cs35l56 address struct
Simon Trimmer [Fri, 6 Dec 2024 07:59:02 +0000 (15:59 +0800)]
ASoC: Intel: soc-acpi: arl: Correct naming of a cs35l56 address struct

As there are many combinations these follow a naming scheme to make
the content of link structures clearer:

cs35l56_<controller link>_<l or r><unique instance id>_adr

Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://patch.msgid.link/20241206075903.195730-10-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agoASoC: Intel: soc-acpi-intel-ptl-match: add rt713_vb_l2_rt1320_l13 support
Bard Liao [Fri, 6 Dec 2024 07:59:01 +0000 (15:59 +0800)]
ASoC: Intel: soc-acpi-intel-ptl-match: add rt713_vb_l2_rt1320_l13 support

Add rt713_vb on SoundWire link 2 and rt1320 on SoundWire link 1 and 3
configuration support.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://patch.msgid.link/20241206075903.195730-9-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agoASoC: Intel: soc-acpi-intel-lnl-match: add rt713_vb_l2_rt1320_l13 support
Bard Liao [Fri, 6 Dec 2024 07:59:00 +0000 (15:59 +0800)]
ASoC: Intel: soc-acpi-intel-lnl-match: add rt713_vb_l2_rt1320_l13 support

Add rt713_vb on SoundWire link 2 and rt1320 on SoundWire link 1 and 3
configuration support.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://patch.msgid.link/20241206075903.195730-8-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agoASoC: Intel: soc-acpi-intel-ptl-match: add rt712_vb + rt1320 support
Bard Liao [Fri, 6 Dec 2024 07:58:59 +0000 (15:58 +0800)]
ASoC: Intel: soc-acpi-intel-ptl-match: add rt712_vb + rt1320 support

Add rt712_vb on SDW link 2 and 1 rt1320 on SDW link 1 configuration
support.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://patch.msgid.link/20241206075903.195730-7-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agoASoC: Intel: sof_sdw: Add a dev_dbg message for the SOC_SDW_CODEC_MIC quirk
Simon Trimmer [Fri, 6 Dec 2024 07:58:58 +0000 (15:58 +0800)]
ASoC: Intel: sof_sdw: Add a dev_dbg message for the SOC_SDW_CODEC_MIC quirk

Add debug message when SOC_SDW_CODEC_MIC is enabled (which informs the
machine driver to not bind in the cs42l43 microphone DAI link).

Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://patch.msgid.link/20241206075903.195730-6-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agoASoC: Intel: sof_sdw: Correct quirk for Lenovo Yoga Slim 7
Simon Trimmer [Fri, 6 Dec 2024 07:58:57 +0000 (15:58 +0800)]
ASoC: Intel: sof_sdw: Correct quirk for Lenovo Yoga Slim 7

In addition to changing the DMI match to examine the product name rather
than the SKU, this adds the quirk to inform the machine driver to not
bind in the cs42l43 microphone DAI link.

Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://patch.msgid.link/20241206075903.195730-5-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agoASoC: Intel: sof_sdw: improve the log of DAI link numbers
Bard Liao [Fri, 6 Dec 2024 07:58:56 +0000 (15:58 +0800)]
ASoC: Intel: sof_sdw: improve the log of DAI link numbers

The log shows the number for different type of DAIs. Add "DAI link
numbers:" to make the log be more explicit.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://patch.msgid.link/20241206075903.195730-4-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agoASoC: Intel: sof_sdw: reduce log level for not using internal dmic
Bard Liao [Fri, 6 Dec 2024 07:58:55 +0000 (15:58 +0800)]
ASoC: Intel: sof_sdw: reduce log level for not using internal dmic

ctx->ignore_internal_dmic is set when there is a dedicated SoundWire
DMIC is in the system. In other words, ignoring internal DMIC is
expected, not an error.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://patch.msgid.link/20241206075903.195730-3-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agoASoC: Intel: sof_sdw: correct mach_params->dmic_num
Bard Liao [Fri, 6 Dec 2024 07:58:54 +0000 (15:58 +0800)]
ASoC: Intel: sof_sdw: correct mach_params->dmic_num

mach_params->dmic_num will be used to set the cfg-mics value of
card->components string which should be the dmic channels. However
dmic_num is dmic link number and could be set due to the SOC_SDW_PCH_DMIC
quirk. Set mach_params->dmic_num to the default value if the dmic link
is created due to the SOC_SDW_PCH_DMIC quirk.

Fixes: 7db9f6361170 ("ASoC: Intel: sof_sdw: overwrite mach_params->dmic_num")
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://patch.msgid.link/20241206075903.195730-2-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agoASoC: simple-card-utils: use for_each_of_graph_port() on graph_get_dai_id()
Kuninori Morimoto [Tue, 3 Dec 2024 02:10:32 +0000 (02:10 +0000)]
ASoC: simple-card-utils: use for_each_of_graph_port() on graph_get_dai_id()

Because DT check when compiling become very strict in these days,
we need to add reg = <x> if it has multi port/endpoint, otherwise
it will get error or warning. But it was not so strict and/or
mandatry before.

Current code is counting "endpoint" to get DAI ID, but it should count
"port" instead, otherwise strange ID will be used for DAI if it was multi
connected case (A). There is no issue if it was not multi connected (B).

One note is that this code will be used if neither port/endpoint doesn't
have reg = <x> property on DT.

case (A)

/* This should be handled as DAI-0 */
port@0 {
endpoint@0 {  } /* It will be DAI-0 by endpoint count */
endpoint@1 {  } /* It will be DAI-1 by endpoint count */
};
/* This should be handled as DAI-1 */
port@1 {
endpoint {  } /* It will be DAI-2 by endpoint count */
};

case (B)
/* both endpoint cound and port count are same */
port@0 {
endpoint { ... }
};
port@1 {
endpoint { ... }
};

It will be issue if Audio-Graph-Card is used with Multi Connection.
No issue will be happen with Audio-Graph-Card2 / Simple-Card.

This patch uses for_each_of_graph_port() instead of
for_each_endpoint_of_node(), and thus, we can use "break" to quit
from loop. Because for_each_of_graph_port() uses __free(device_node)
inside.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87o71tfrdz.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agoASoC: simple-card-utils: check port reg first on graph_get_dai_id()
Kuninori Morimoto [Tue, 3 Dec 2024 02:10:28 +0000 (02:10 +0000)]
ASoC: simple-card-utils: check port reg first on graph_get_dai_id()

Because DT check when compiling become very strict in these days,
we need to add reg = <x> if it has multi port/endpoint, otherwise
it will get error or warning. But it was not so strict and/or
mandatry before.

Current code uses reg number as DAI ID, but it will use "endpoint"
reg first and use "port" reg 2nd. But it should use port number as 1st (A)
if it was used for multi connected case. There is no priority for
port/endpoint if it was not multi connected (B).

case (A)
port {
/*
 * "port" and "endpoint" are using different reg number.
 * It should use <x> as DAI ID, not <y> not <z>
 */
reg = <x>;
endpoint@y { reg = <y>; ... };
endpoint@z { reg = <z>; ... };
};

case (B)
port {
/*
 * Both port/endpoint are using same reg numer <x>.
 */
reg = <x>;
endpoint { reg = <x>; ... };
};

It will be issue if Audio-Graph-Card is used with Multi Connection.
No issue will be happen with Audio-Graph-Card2 / Simple-Card.

This patch swtich port/endpoint priority.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87plm9fre3.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agoASoC: simple-card-utils: use __free(device_node) for device node
Kuninori Morimoto [Tue, 3 Dec 2024 02:10:23 +0000 (02:10 +0000)]
ASoC: simple-card-utils: use __free(device_node) for device node

simple-card-utils handles many type of device_node, thus need to
use of_node_put() in many place. Let's use __free(device_node)
and avoid it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87r06pfre8.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agoASoC: fsl_sai: Add sample rate constraint
Chancel Liu [Tue, 26 Nov 2024 11:54:40 +0000 (20:54 +0900)]
ASoC: fsl_sai: Add sample rate constraint

Platforms like i.MX93/91 only have one audio PLL. Some sample rates are
not supported. If the PLL source is used for 8kHz series rates, then
11kHz series rates can't be supported. Use fsl_asoc_constrain_rates()
to constrain rates according to PLL sources.

Signed-off-by: Chancel Liu <chancel.liu@nxp.com>
Link: https://patch.msgid.link/20241126115440.3929061-5-chancel.liu@nxp.com
Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agoASoC: fsl_xcvr: Add sample rate constraint
Chancel Liu [Tue, 26 Nov 2024 11:54:39 +0000 (20:54 +0900)]
ASoC: fsl_xcvr: Add sample rate constraint

Platforms like i.MX93/91 only have one audio PLL. Some sample rates are
not supported. If the PLL source is used for 8kHz series rates, then
11kHz series rates can't be supported. Use fsl_asoc_constrain_rates()
to constrain rates according to PLL sources. This constraint is merely
applicable to playback cases on SPDIF only platforms.

Signed-off-by: Chancel Liu <chancel.liu@nxp.com>
Link: https://patch.msgid.link/20241126115440.3929061-4-chancel.liu@nxp.com
Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agoASoC: fsl_micfil: Switch to common sample rate constraint function
Chancel Liu [Tue, 26 Nov 2024 11:54:38 +0000 (20:54 +0900)]
ASoC: fsl_micfil: Switch to common sample rate constraint function

fsl_asoc_constrain_rates() is a common function to constrain rates.
Let's switch to this function.

Signed-off-by: Chancel Liu <chancel.liu@nxp.com>
Link: https://patch.msgid.link/20241126115440.3929061-3-chancel.liu@nxp.com
Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agoASoC: fsl_utils: Add function to constrain rates
Chancel Liu [Tue, 26 Nov 2024 11:54:37 +0000 (20:54 +0900)]
ASoC: fsl_utils: Add function to constrain rates

Platforms like i.MX93/91 only have one audio PLL. Some sample rates are
not supported. Add common function to constrain rates according to
different clock sources.

Signed-off-by: Chancel Liu <chancel.liu@nxp.com>
Link: https://patch.msgid.link/20241126115440.3929061-2-chancel.liu@nxp.com
Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
7 months agoASoC: Merge up v6.12-rc2
Mark Brown [Mon, 9 Dec 2024 12:50:19 +0000 (12:50 +0000)]
ASoC: Merge up v6.12-rc2

This has fixes for several boards which help my testing a lot.

7 months agoLinux 6.13-rc2 v6.13-rc2
Linus Torvalds [Sun, 8 Dec 2024 22:03:39 +0000 (14:03 -0800)]
Linux 6.13-rc2

7 months agoMerge tag 'kbuild-fixes-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/masah...
Linus Torvalds [Sun, 8 Dec 2024 20:01:06 +0000 (12:01 -0800)]
Merge tag 'kbuild-fixes-v6.13' of git://git./linux/kernel/git/masahiroy/linux-kbuild

Pull Kbuild fixes from Masahiro Yamada:

 - Fix a section mismatch warning in modpost

 - Fix Debian package build error with the O= option

* tag 'kbuild-fixes-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
  kbuild: deb-pkg: fix build error with O=
  modpost: Add .irqentry.text to OTHER_SECTIONS

7 months agoMerge tag 'irq_urgent_for_v6.13_rc2' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sun, 8 Dec 2024 19:54:04 +0000 (11:54 -0800)]
Merge tag 'irq_urgent_for_v6.13_rc2' of git://git./linux/kernel/git/tip/tip

Pull irq fixes from Borislav Petkov:

 - Fix a /proc/interrupts formatting regression

 - Have the BCM2836 interrupt controller enter power management states
   properly

 - Other fixlets

* tag 'irq_urgent_for_v6.13_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  irqchip/stm32mp-exti: CONFIG_STM32MP_EXTI should not default to y when compile-testing
  genirq/proc: Add missing space separator back
  irqchip/bcm2836: Enable SKIP_SET_WAKE and MASK_ON_SUSPEND
  irqchip/gic-v3: Fix irq_complete_ack() comment

7 months agoMerge tag 'timers_urgent_for_v6.13_rc2' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sun, 8 Dec 2024 19:51:29 +0000 (11:51 -0800)]
Merge tag 'timers_urgent_for_v6.13_rc2' of git://git./linux/kernel/git/tip/tip

Pull timer fix from Borislav Petkov:

 - Handle the case where clocksources with small counter width can,
   in conjunction with overly long idle sleeps, falsely trigger the
   negative motion detection of clocksources

* tag 'timers_urgent_for_v6.13_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  clocksource: Make negative motion detection more robust

7 months agoMerge tag 'x86_urgent_for_v6.13_rc2' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sun, 8 Dec 2024 19:38:56 +0000 (11:38 -0800)]
Merge tag 'x86_urgent_for_v6.13_rc2' of git://git./linux/kernel/git/tip/tip

Pull x86 fixes from Borislav Petkov:

 - Have the Automatic IBRS setting check on AMD does not falsely fire in
   the guest when it has been set already on the host

 - Make sure cacheinfo structures memory is allocated to address a boot
   NULL ptr dereference on Intel Meteor Lake which has different numbers
   of subleafs in its CPUID(4) leaf

 - Take care of the GDT restoring on the kexec path too, as expected by
   the kernel

 - Make sure SMP is not disabled when IO-APIC is disabled on the kernel
   cmdline

 - Add a PGD flag _PAGE_NOPTISHADOW to instruct machinery not to
   propagate changes to the kernelmode page tables, to the user portion,
   in PTI

 - Mark Intel Lunar Lake as affected by an issue where MONITOR wakeups
   can get lost and thus user-visible delays happen

 - Make sure PKRU is properly restored with XRSTOR on AMD after a PRKU
   write of 0 (WRPKRU) which will mark PKRU in its init state and thus
   lose the actual buffer

* tag 'x86_urgent_for_v6.13_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/CPU/AMD: WARN when setting EFER.AUTOIBRS if and only if the WRMSR fails
  x86/cacheinfo: Delete global num_cache_leaves
  cacheinfo: Allocate memory during CPU hotplug if not done from the primary CPU
  x86/kexec: Restore GDT on return from ::preserve_context kexec
  x86/cpu/topology: Remove limit of CPUs due to disabled IO/APIC
  x86/mm: Add _PAGE_NOPTISHADOW bit to avoid updating userspace page tables
  x86/cpu: Add Lunar Lake to list of CPUs with a broken MONITOR implementation
  x86/pkeys: Ensure updated PKRU value is XRSTOR'd
  x86/pkeys: Change caller of update_pkru_in_sigframe()

7 months agoMerge tag 'mm-hotfixes-stable-2024-12-07-22-39' of git://git.kernel.org/pub/scm/linux...
Linus Torvalds [Sun, 8 Dec 2024 19:26:13 +0000 (11:26 -0800)]
Merge tag 'mm-hotfixes-stable-2024-12-07-22-39' of git://git./linux/kernel/git/akpm/mm

Pull misc fixes from Andrew Morton:
 "24 hotfixes.  17 are cc:stable.  15 are MM and 9 are non-MM.

  The usual bunch of singletons - please see the relevant changelogs for
  details"

* tag 'mm-hotfixes-stable-2024-12-07-22-39' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (24 commits)
  iio: magnetometer: yas530: use signed integer type for clamp limits
  sched/numa: fix memory leak due to the overwritten vma->numab_state
  mm/damon: fix order of arguments in damos_before_apply tracepoint
  lib: stackinit: hide never-taken branch from compiler
  mm/filemap: don't call folio_test_locked() without a reference in next_uptodate_folio()
  scatterlist: fix incorrect func name in kernel-doc
  mm: correct typo in MMAP_STATE() macro
  mm: respect mmap hint address when aligning for THP
  mm: memcg: declare do_memsw_account inline
  mm/codetag: swap tags when migrate pages
  ocfs2: update seq_file index in ocfs2_dlm_seq_next
  stackdepot: fix stack_depot_save_flags() in NMI context
  mm: open-code page_folio() in dump_page()
  mm: open-code PageTail in folio_flags() and const_folio_flags()
  mm: fix vrealloc()'s KASAN poisoning logic
  Revert "readahead: properly shorten readahead when falling back to do_page_cache_ra()"
  selftests/damon: add _damon_sysfs.py to TEST_FILES
  selftest: hugetlb_dio: fix test naming
  ocfs2: free inode when ocfs2_get_init_inode() fails
  nilfs2: fix potential out-of-bounds memory access in nilfs_find_entry()
  ...

7 months agokbuild: deb-pkg: fix build error with O=
Masahiro Yamada [Sun, 8 Dec 2024 07:56:45 +0000 (16:56 +0900)]
kbuild: deb-pkg: fix build error with O=

Since commit 13b25489b6f8 ("kbuild: change working directory to external
module directory with M="), the Debian package build fails if a relative
path is specified with the O= option.

  $ make O=build bindeb-pkg
    [ snip ]
  dpkg-deb: building package 'linux-image-6.13.0-rc1' in '../linux-image-6.13.0-rc1_6.13.0-rc1-6_amd64.deb'.
  Rebuilding host programs with x86_64-linux-gnu-gcc...
  make[6]: Entering directory '/home/masahiro/linux/build'
  /home/masahiro/linux/Makefile:190: *** specified kernel directory "build" does not exist.  Stop.

This occurs because the sub_make_done flag is cleared, even though the
working directory is already in the output directory.

Passing KBUILD_OUTPUT=. resolves the issue.

Fixes: 13b25489b6f8 ("kbuild: change working directory to external module directory with M=")
Reported-by: Charlie Jenkins <charlie@rivosinc.com>
Closes: https://lore.kernel.org/all/Z1DnP-GJcfseyrM3@ghost/
Tested-by: Charlie Jenkins <charlie@rivosinc.com>
Reviewed-by: Charlie Jenkins <charlie@rivosinc.com>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
7 months agomodpost: Add .irqentry.text to OTHER_SECTIONS
Thomas Gleixner [Sun, 1 Dec 2024 11:17:30 +0000 (12:17 +0100)]
modpost: Add .irqentry.text to OTHER_SECTIONS

The compiler can fully inline the actual handler function of an interrupt
entry into the .irqentry.text entry point. If such a function contains an
access which has an exception table entry, modpost complains about a
section mismatch:

  WARNING: vmlinux.o(__ex_table+0x447c): Section mismatch in reference ...

  The relocation at __ex_table+0x447c references section ".irqentry.text"
  which is not in the list of authorized sections.

Add .irqentry.text to OTHER_SECTIONS to cure the issue.

Reported-by: Sergey Senozhatsky <senozhatsky@chromium.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: stable@vger.kernel.org # needed for linux-5.4-y
Link: https://lore.kernel.org/all/20241128111844.GE10431@google.com/
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>