platform/kernel/linux-starfive.git
20 months agoASoC: SOF: Intel: hda: Introduce HDA DAI abstraction
Mark Brown [Thu, 9 Mar 2023 14:26:52 +0000 (14:26 +0000)]
ASoC: SOF: Intel: hda: Introduce HDA DAI abstraction

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

This series introduces an abstraction of the HDA DAI handling.

The motivation is to simplify and make the code more flexible regarding to IPC
versions, new features (ChainDMA (IPC4) and DSPless mode) and to pave the way for new
platforms.

For the first look the series might feels a bit too intrusive but it introduces
no functionality change (tested at each commit).

20 months agosoc: fsl: cpm1: qmc: Fix assigned timeslot masks
Herve Codina via Alsa-devel [Tue, 7 Mar 2023 14:15:03 +0000 (15:15 +0100)]
soc: fsl: cpm1: qmc: Fix assigned timeslot masks

The assigned timeslot masks are 64bit values.
In case of 64 timeslots the code uses (1 << 64) which is undefined on a
64bit value. On the PowerPC architecture, this lead to an incorrect
result as (1 << 64) produces the same result as (1 << 0).

Fix the masks values taking care of the 64 timeslots case.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Link: https://lore.kernel.org/r/167819855177.26.11163930602844526001@mailman-core.alsa-project.org
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agodt-bindings: soc: fsl: cpm_qe: cpm1-tsa: Remove unneeded property
Herve Codina [Tue, 7 Mar 2023 14:15:02 +0000 (15:15 +0100)]
dt-bindings: soc: fsl: cpm_qe: cpm1-tsa: Remove unneeded property

Remove the unneeded and unused #fsl,serial-cells property.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Link: https://lore.kernel.org/r/20230307141503.159766-3-herve.codina@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agodt-bindings: soc: fsl: cpm_qe: cpm1-scc-qmc: Remove unneeded property
Herve Codina [Tue, 7 Mar 2023 14:15:01 +0000 (15:15 +0100)]
dt-bindings: soc: fsl: cpm_qe: cpm1-scc-qmc: Remove unneeded property

Remove the unneeded and unused #fsl,chan-cells property.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Link: https://lore.kernel.org/r/20230307141503.159766-2-herve.codina@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: SOF: amd: Enable cont_update_posn variable in pcm hw_params.
V sujith kumar Reddy [Wed, 8 Mar 2023 08:45:09 +0000 (14:15 +0530)]
ASoC: SOF: amd: Enable cont_update_posn variable in pcm hw_params.

Enable cont_update_posn variable to  update host position
in streambox for every dma copy.

Signed-off-by: V sujith kumar Reddy <Vsujithkumar.Reddy@amd.com>
Link: https://lore.kernel.org/r/20230308084509.1496256-3-Vsujithkumar.Reddy@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: SOF: amd: Add pcm pointer callback for amd platforms.
V sujith kumar Reddy [Wed, 8 Mar 2023 08:45:08 +0000 (14:15 +0530)]
ASoC: SOF: amd: Add pcm pointer callback for amd platforms.

Add pcm pointer callback for amd platforms to read host position
update from stream box.

Signed-off-by: V sujith kumar Reddy <Vsujithkumar.Reddy@amd.com>
Link: https://lore.kernel.org/r/20230308084509.1496256-2-Vsujithkumar.Reddy@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: SOF: ipc4: Add core_id support from topology
Mark Brown [Tue, 7 Mar 2023 17:29:00 +0000 (17:29 +0000)]
ASoC: SOF: ipc4: Add core_id support from topology

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

The following series will add support for handling the core_id token which is
needed for supporting multiple cores with complex topologies.

20 months agoASoC: SOF: Intel: hda: remove redundant DAI config during hw_free
Ranjani Sridharan [Tue, 7 Mar 2023 14:04:35 +0000 (16:04 +0200)]
ASoC: SOF: Intel: hda: remove redundant DAI config during hw_free

The DAI widget is freed during FE DAI hw_free and therefore the DAI
config during BE DAI hw_free is redundant.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230307140435.2808-15-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: SOF: Intel: hda: Remove hda_ctrl_dai_widget_setup/free()
Ranjani Sridharan [Tue, 7 Mar 2023 14:04:34 +0000 (16:04 +0200)]
ASoC: SOF: Intel: hda: Remove hda_ctrl_dai_widget_setup/free()

Remove these functions and reuse hda_dai_config().

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230307140435.2808-14-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: SOF: Intel: hda: Unify DAI drv ops for IPC3 and IPC4
Ranjani Sridharan [Tue, 7 Mar 2023 14:04:33 +0000 (16:04 +0200)]
ASoC: SOF: Intel: hda: Unify DAI drv ops for IPC3 and IPC4

Define the post_trigger DMA op for IPC3 and unify the DAI driver ops for
IPC3 and IPC4 for HDA DAI's.

Also, use the post_trigger op to stop the paused streams properly in the
hda_dai_suspend() function. This fixes the suspend while paused case for
IPC4 because previously we weren't resetting the pipeline when suspending
the system with some paused streams.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230307140435.2808-13-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: SOF: Intel: hda-dai: Define DAI widget DMA trigger ops for IPC4
Ranjani Sridharan [Tue, 7 Mar 2023 14:04:32 +0000 (16:04 +0200)]
ASoC: SOF: Intel: hda-dai: Define DAI widget DMA trigger ops for IPC4

Define and use the SOF widget's DMA pre_trigger/trigger/post_trigger ops in
ipc4_hda_dai_trigger().

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230307140435.2808-12-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: SOF: Intel: hda-dai: Use the topology IPC dai_config op
Ranjani Sridharan [Tue, 7 Mar 2023 14:04:31 +0000 (16:04 +0200)]
ASoC: SOF: Intel: hda-dai: Use the topology IPC dai_config op

Use the topology IPC dai_config to update the dai_config for
HDA DAI widgets.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230307140435.2808-11-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: SOF: Intel: hda-dai: Add setup_hext_stream/reset_hext_stream DMA ops
Ranjani Sridharan [Tue, 7 Mar 2023 14:04:30 +0000 (16:04 +0200)]
ASoC: SOF: Intel: hda-dai: Add setup_hext_stream/reset_hext_stream DMA ops

Define and use the setup_hext_stream/reset_hext_stream DMA ops during link
hw_params and cleanup.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230307140435.2808-10-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: SOF: Intel: hda-dai: Define and set the HDA DAI widget DMA ops
Ranjani Sridharan [Tue, 7 Mar 2023 14:04:29 +0000 (16:04 +0200)]
ASoC: SOF: Intel: hda-dai: Define and set the HDA DAI widget DMA ops

Define and set the get_hext_stream, assign_hext_stream and
release_hext_stream DMA ops for HDA DAIs.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230307140435.2808-9-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: SOF: Intel: hda-dai: Introduce DAI widget ops
Ranjani Sridharan [Tue, 7 Mar 2023 14:04:28 +0000 (16:04 +0200)]
ASoC: SOF: Intel: hda-dai: Introduce DAI widget ops

Introduce a new ops structure for HDA DAI widget DMA ops and add a new
field to struct snd_sof_dai that will be used to set the ops pointer for
DAI widgets.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230307140435.2808-8-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: SOF: Intel: hda-dai: Use the dai argument in ipc4_hda_dai_trigger
Ranjani Sridharan [Tue, 7 Mar 2023 14:04:27 +0000 (16:04 +0200)]
ASoC: SOF: Intel: hda-dai: Use the dai argument in ipc4_hda_dai_trigger

No need to define a new variable and look it up again.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230307140435.2808-7-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: SOF: Intel: hda-dai: Pass the CPU dai pointer
Ranjani Sridharan [Tue, 7 Mar 2023 14:04:26 +0000 (16:04 +0200)]
ASoC: SOF: Intel: hda-dai: Pass the CPU dai pointer

Pass the CPU DAI pointer from the ASoC core to hda_link_dma_hw_params() and
ipc3_hda_dai_trigger(). This will avoid looking up the CPU DAI pointer
multiple times.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230307140435.2808-6-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: SOF: Intel: hda-dai: Modify the signature of hda_link_dma_cleanup()
Ranjani Sridharan [Tue, 7 Mar 2023 14:04:25 +0000 (16:04 +0200)]
ASoC: SOF: Intel: hda-dai: Modify the signature of hda_link_dma_cleanup()

Remove the trigger_suspend_stop argument from hda_link_dma_cleanup() and
move the call to snd_hdac_ext_stream_clear() into
snd_hdac_ext_stream_clear(). This is a preparatory step to unify the
trigger ops for IPC3 and IPC4.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230307140435.2808-5-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: SOF: Intel: hda-dai: remove struct hda_pipe_params
Ranjani Sridharan [Tue, 7 Mar 2023 14:04:24 +0000 (16:04 +0200)]
ASoC: SOF: Intel: hda-dai: remove struct hda_pipe_params

Remove the struct definition and use the params argument directly.
Also, use the hlink pointer to set the stream ID instead of looking it
up again.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230307140435.2808-4-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: SOF: Intel: hda-dai: Remove hda_link_dma_params()
Ranjani Sridharan [Tue, 7 Mar 2023 14:04:23 +0000 (16:04 +0200)]
ASoC: SOF: Intel: hda-dai: Remove hda_link_dma_params()

No code change. Just code move from hda_link_dma_params() to
hda_link_dma_hw_params().

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230307140435.2808-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: SOF: Intel: hda-dai: Remove BE DAI DRV ops for SSP DAI's
Ranjani Sridharan [Tue, 7 Mar 2023 14:04:22 +0000 (16:04 +0200)]
ASoC: SOF: Intel: hda-dai: Remove BE DAI DRV ops for SSP DAI's

Now that the DAI_CONFIG IPC is sent after widget setup and before widget
free, there is no need for the BE DAI DRV ops that do the same thing. So
remove them.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230307140435.2808-2-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: SOF: ipc4-mtrace: process pending logs upon FW crash
Kai Vehmanen [Tue, 7 Mar 2023 11:08:46 +0000 (13:08 +0200)]
ASoC: SOF: ipc4-mtrace: process pending logs upon FW crash

If the DSP firmware has crashed, some log messages may be pending in the
mtrace buffer, but not consumed by the driver as no IPC notification has
been sent by the firmware. Check the buffer status for all mtrace slots
and ensure any pending log messages are processed before DSP is possibly
powered down and the log buffer contents is lost.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Péter 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>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230307110846.2265-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: SOF: ipc4-topology: don't allocate blob if it will not be used
Bard Liao [Tue, 7 Mar 2023 11:08:30 +0000 (13:08 +0200)]
ASoC: SOF: ipc4-topology: don't allocate blob if it will not be used

A copier blob will be only used when a copier is connected in the
topology. An ALH copier in playback direction that doesn't have any
source means the copier is not connected in the topology. Thus, we
don't need to allocate the blob.
The patch doesn't do the same test before freeing the blob because
the blob is null and it is fine to free null.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230307110830.2178-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: SOF: Intel: mtl: Access MTL_HFPWRCTL from HDA_DSP_BAR
Yong Zhi [Tue, 7 Mar 2023 09:52:51 +0000 (11:52 +0200)]
ASoC: SOF: Intel: mtl: Access MTL_HFPWRCTL from HDA_DSP_BAR

The Host Power Management/Clock Control (ULP) Registers in
the HDA BAR shadow the values of the same registers in the DSP BAR,
so let's modify the latter - as done already for other accesses.

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230307095251.3058-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: SOF: Intel: hda-loader: use SOF helper for consistency
Pierre-Louis Bossart [Tue, 7 Mar 2023 09:51:58 +0000 (11:51 +0200)]
ASoC: SOF: Intel: hda-loader: use SOF helper for consistency

Update code to remove mix between legacy and SOF definitions. No
functionality change.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230307095158.2818-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: SOF: loader: Remove log prefixes for snd_sof_run_firmware
Curtis Malainey [Tue, 7 Mar 2023 11:50:18 +0000 (13:50 +0200)]
ASoC: SOF: loader: Remove log prefixes for snd_sof_run_firmware

Prefixs are unneeded since log level explains the same information

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230307115018.5588-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: SOF: ipc4-topology: add core token in each module extended token list
Rander Wang [Tue, 7 Mar 2023 12:35:56 +0000 (14:35 +0200)]
ASoC: SOF: ipc4-topology: add core token in each module extended token list

Add core token in extended token list for each module to support multi-core
feature.

Signed-off-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Chao Song <chao.song@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230307123556.31328-4-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: SOF: ipc4-topology: Add support for core_id for pipelines
Peter Ujfalusi [Tue, 7 Mar 2023 12:35:55 +0000 (14:35 +0200)]
ASoC: SOF: ipc4-topology: Add support for core_id for pipelines

Token SOF_TKN_SCHED_CORE in topology file can specify the target core for
the pipeline, if it is missing it is going to be 0 (as it is right now).

Firmware will double-check all information retrieved by topology and
report errors if required. This will allow policy and changes in
topologies without a need for a synchronized kernel change.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20230307123556.31328-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: SOF: ipc4: Add macro to set the core_id in create_pipe message
Peter Ujfalusi [Tue, 7 Mar 2023 12:35:54 +0000 (14:35 +0200)]
ASoC: SOF: ipc4: Add macro to set the core_id in create_pipe message

The create pipeline message can carry the target code_id which is set to
0 at the moment.

Add macros to set the core_id in the message extension.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20230307123556.31328-2-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoAdd CS35L41 shared boost feature
Mark Brown [Mon, 6 Mar 2023 20:30:09 +0000 (20:30 +0000)]
Add CS35L41 shared boost feature

Merge series from Lucas Tanure <lucas.tanure@collabora.com>:

Valve's Steam Deck uses CS35L41 in shared boost mode, where both speakers
share the boost circuit.
Add this support in the shared lib, but for now, shared boost is not
supported in HDA systems as would require BIOS changes.

Based on David Rhodes shared boost patches.

Also, fix boost config overwriting in IRQ found in the review and do a
small refactor of the code.

20 months agoASoC: soc-core.c: remove useless dev_dbg()
Kuninori Morimoto [Mon, 6 Mar 2023 01:44:13 +0000 (01:44 +0000)]
ASoC: soc-core.c: remove useless dev_dbg()

soc-core.c is using dev_dbg(), but some of them are useless.
It indicates many dev_dbg() at snd_soc_runtime_get_dai_fmt(),
but all of them are just noise, almost no meanings.

dev_dbg() on soc_probe_link_dais() indicates dai link and its
loop order, but it is just noise, no information.

dev_dbg() on snd_soc_register_dai() is duplicated.

This patch cleanup these.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87ttyy64cy.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoRefactor Vangogh acp5x machine driver
Mark Brown [Mon, 6 Mar 2023 13:30:28 +0000 (13:30 +0000)]
Refactor Vangogh acp5x machine driver

Merge series from Lucas Tanure <lucas.tanure@collabora.com>:

Provide small fixes and refactor the code for easier insertion of a new
platform using the same acp5x machine driver.

20 months agoAdd "mclk" support for maxim,max9867
Mark Brown [Mon, 6 Mar 2023 13:30:21 +0000 (13:30 +0000)]
Add "mclk" support for maxim,max9867

Merge series from richard.leitner@linux.dev:

This series adds support for the clocks properties in the
maxim,max9867 bindings. Furthermore the binding definitions are
converted from txt to yaml.

The clock property is needed to define the mclk for one of our
boards which uses the the i.MX8MP SAI MCLK as clock for the
maxim,max9867.

20 months agoAdd support for the TAS5733
Mark Brown [Mon, 6 Mar 2023 13:30:13 +0000 (13:30 +0000)]
Add support for the TAS5733

Merge series from Kamel Bouhara <kamel.bouhara@bootlin.com>:

This small series extends the tas571x driver to support the TAS5733
audio power amplifier.

20 months agoASoC: microchip: some cleanups for AT91 sound drivers
Mark Brown [Mon, 6 Mar 2023 13:30:05 +0000 (13:30 +0000)]
ASoC: microchip: some cleanups for AT91 sound drivers

Merge series from Claudiu Beznea <claudiu.beznea@microchip.com>:

This series does some cleanups for Microchip AT91 sound drivers.  Along
with it I took the chance and updated MAINTAINERS file.

20 months agoRZ/G2L SSI: Update interrupt numbers
Mark Brown [Mon, 6 Mar 2023 13:29:58 +0000 (13:29 +0000)]
RZ/G2L SSI: Update interrupt numbers

Merge series from Prabhakar <prabhakar.csengg@gmail.com>:

Hi All,

This patch series aims to fix interrupt numbers for SSI channels and updates
the DT binding and the driver accordingly.

Note, this patch series applies on top of [0].

[0] https://patchwork.kernel.org/project/linux-renesas-soc/cover/20230131223529.11905-1-prabhakar.mahadev-lad.rj@bp.renesas.com/

Cheers,
Prabhakar

Lad Prabhakar (4):
  ASoC: dt-bindings: renesas,rz-ssi: Update interrupts and
    interrupt-names properties
  ASoC: sh: rz-ssi: Update interrupt handling for half duplex channels
  arm64: dts: renesas: r9a07g044: Update IRQ numbers for SSI channels
  arm64: dts: renesas: r9a07g043: Update IRQ numbers for SSI channels

 .../bindings/sound/renesas,rz-ssi.yaml        | 21 ++++---
 arch/arm64/boot/dts/renesas/r9a07g043.dtsi    | 19 +++---
 arch/arm64/boot/dts/renesas/r9a07g044.dtsi    | 19 +++---
 sound/soc/sh/rz-ssi.c                         | 63 +++++++++++++------
 4 files changed, 70 insertions(+), 52 deletions(-)

--
2.25.1

20 months agoSoC: SOF: Intel: hda/mtl: Improve and enable DMI L1
Mark Brown [Mon, 6 Mar 2023 13:29:52 +0000 (13:29 +0000)]
SoC: SOF: Intel: hda/mtl: Improve and enable DMI L1

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

The first patch will improve the managing of DMI L1 by tracking it's
enabled/disabled state to avoid unconditional changes to it's state.

The remaining two patch will enable the DMI L1 for MTL platforms (ACE 1.0)

20 months agoAdd the PowerQUICC audio support using the QMC
Mark Brown [Mon, 6 Mar 2023 13:29:46 +0000 (13:29 +0000)]
Add the PowerQUICC audio support using the QMC

Merge series from Herve Codina <herve.codina@bootlin.com>:

This series adds support for audio using the QMC controller available in
some Freescale PowerQUICC SoCs.

This series contains three parts in order to show the different blocks
hierarchy and their usage in this support.

The first one is related to TSA (Time Slot Assigner).
The TSA handles the data present at the pin level (TDM with up to 64
time slots) and dispatchs them to one or more serial controller (SCC).

The second is related to QMC (QUICC Multichannel Controller).
The QMC handles the data at the serial controller (SCC) level and splits
again the data to creates some virtual channels.

The last one is related to the audio component (QMC audio).
It is the glue between the QMC controller and the ASoC component. It
handles one or more QMC virtual channels and creates one DAI per QMC
virtual channels handled.

20 months agoASoC: dt-bindings: qcom,wcd9335: Convert to dtschema
Krzysztof Kozlowski [Mon, 20 Feb 2023 09:56:43 +0000 (10:56 +0100)]
ASoC: dt-bindings: qcom,wcd9335: Convert to dtschema

Convert the Qualcomm WCD9335 audio codec binding to DT schema.

Changes against original binding:
1. Drop "mclk2" from clocks as neither Linux driver nor DTS uses it.
2. Do not require vdd-micbias-supply as several DTS do not provide it.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20230220095643.64898-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: dt-bindings: qcom,wcd934x: Reference dai-common
Krzysztof Kozlowski [Mon, 20 Feb 2023 09:56:42 +0000 (10:56 +0100)]
ASoC: dt-bindings: qcom,wcd934x: Reference dai-common

Reference common DAI properties to get sound-dai-cells description and
allow name-prefix.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20230220095643.64898-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: jack: allow multiple interrupt per gpio
Svyatoslav Ryhel [Tue, 21 Feb 2023 18:32:03 +0000 (20:32 +0200)]
ASoC: jack: allow multiple interrupt per gpio

This feature is required for coupled hp-mic quirk used
by some Nvidia Tegra 3 based devices work properly.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Link: https://lore.kernel.org/r/20230221183211.21964-3-clamor95@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: dt-bindings: renesas,rsnd.yaml: add R-Car Gen4 support
Kuninori Morimoto [Mon, 13 Feb 2023 02:13:06 +0000 (02:13 +0000)]
ASoC: dt-bindings: renesas,rsnd.yaml: add R-Car Gen4 support

There are no compatible for "reg/reg-names" and "clock-name"
between previous R-Car series and R-Car Gen4.

"reg/reg-names" needs 3 categorize (for Gen1, for Gen2/Gen3, for Gen4),
therefore, use 3 if-then to avoid nested if-then-else.

Move "clock-name" detail properties to under allOf to use if-then-else
for Gen4 or others.

Link: https://lore.kernel.org/all/87zg9vk0ex.wl-kuninori.morimoto.gx@renesas.com/#r
Link: https://lore.kernel.org/all/87r0v2uvm7.wl-kuninori.morimoto.gx@renesas.com/#r
Link: https://lore.kernel.org/all/87r0v1t02h.wl-kuninori.morimoto.gx@renesas.com/#r
Link: https://lore.kernel.org/all/87y1p7bpma.wl-kuninori.morimoto.gx@renesas.com/#r
Reported-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/87sffa8g99.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: SOF: ipc4-topology: Replace fake flexible arrays with flexible-array member
Gustavo A. R. Silva [Fri, 24 Feb 2023 03:42:26 +0000 (21:42 -0600)]
ASoC: SOF: ipc4-topology: Replace fake flexible arrays with flexible-array member

Zero-length arrays as fake flexible arrays are deprecated and we are
moving towards adopting C99 flexible-array members, instead.

Use the DECLARE_FLEX_ARRAY() helper macro to transform zero-length
arrays in unions with flexible-array members.

Address the following warnings found with GCC-13 and
-fstrict-flex-arrays=3 enabled:
sound/soc/sof/ipc4-control.c:176:77: warning: array subscript i is outside array bounds of ‘struct sof_ipc4_ctrl_value_chan[0]’ [-Warray-bounds=]
sound/soc/sof/ipc4-control.c:78:29: warning: array subscript 0 is outside array bounds of ‘struct sof_ipc4_ctrl_value_chan[0]’ [-Warray-bounds=]
sound/soc/sof/ipc4-control.c:80:33: warning: array subscript i is outside array bounds of ‘struct sof_ipc4_ctrl_value_chan[0]’ [-Warray-bounds=]
sound/soc/sof/ipc4-control.c:95:53: warning: array subscript i is outside array bounds of ‘struct sof_ipc4_ctrl_value_chan[0]’ [-Warray-bounds=]
sound/soc/sof/ipc4-control.c:96:53: warning: array subscript i is outside array bounds of ‘struct sof_ipc4_ctrl_value_chan[0]’ [-Warray-bounds=]
sound/soc/sof/ipc4-control.c:93:53: warning: array subscript 0 is outside array bounds of ‘struct sof_ipc4_ctrl_value_chan[0]’ [-Warray-bounds=]
sound/soc/sof/ipc4-control.c:140:58: warning: array subscript i is outside array bounds of ‘struct sof_ipc4_ctrl_value_chan[0]’ [-Warray-bounds=]
sound/soc/sof/ipc4-control.c:141:29: warning: array subscript i is outside array bounds of ‘struct sof_ipc4_ctrl_value_chan[0]’ [-Warray-bounds=]
sound/soc/sof/ipc4-control.c:142:29: warning: array subscript i is outside array bounds of ‘struct sof_ipc4_ctrl_value_chan[0]’ [-Warray-bounds=]
sound/soc/sof/ipc4-topology.c:1475:36: warning: array subscript i is outside array bounds of ‘struct sof_ipc4_ctrl_value_chan[0]’ [-Warray-bounds=]
sound/soc/sof/ipc4-topology.c:1476:36: warning: array subscript i is outside array bounds of ‘struct sof_ipc4_ctrl_value_chan[0]’ [-Warray-bounds=]

This helps with the ongoing efforts to tighten the FORTIFY_SOURCE
routines on memcpy() and help us make progress towards globally
enabling -fstrict-flex-arrays=3 [1].

Link: https://github.com/KSPP/linux/issues/21
Link: https://github.com/KSPP/linux/issues/193
Link: https://github.com/KSPP/linux/issues/258
Link: https://gcc.gnu.org/pipermail/gcc-patches/2022-October/602902.html
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Acked-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/Y/gyIg1qZduhigPi@work
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: nau8821: Implement DRC controls
Seven Lee [Fri, 17 Feb 2023 09:25:23 +0000 (17:25 +0800)]
ASoC: nau8821: Implement DRC controls

This patch is support dynamic range compression controls.

Signed-off-by: Seven Lee <wtli@nuvoton.com>
Signed-off-by: Seven Lee <scott6986@gmail.com>
Link: https://lore.kernel.org/r/20230217092523.357142-1-wtli@nuvoton.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: qcom: common: add kcontrol to jack pins
Srinivas Kandagatla [Thu, 2 Mar 2023 10:46:16 +0000 (10:46 +0000)]
ASoC: qcom: common: add kcontrol to jack pins

Add Kcontrol to jack pins so that device switch in ucm can be done correctly.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230302104616.26318-1-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: dt-bindings: wlf,wm8524: Convert to json-schema
Chancel Liu [Mon, 27 Feb 2023 09:19:37 +0000 (17:19 +0800)]
ASoC: dt-bindings: wlf,wm8524: Convert to json-schema

Convert the Wolfson WM8524 24-bit 192KHz Stereo DAC device tree
binding documentation to json-schema.

Signed-off-by: Chancel Liu <chancel.liu@nxp.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230227091938.1671416-1-chancel.liu@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: dt-bindings: wlf,wm8960: Convert to dtschema
Krzysztof Kozlowski [Fri, 17 Feb 2023 15:06:25 +0000 (16:06 +0100)]
ASoC: dt-bindings: wlf,wm8960: Convert to dtschema

Convert the Wolfson WM8960 audio codecs bindings to DT schema.

Changes against original binding:
1. Document clocks and clock-names - already present in DTS and used
   by Linux driver.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230217150627.779764-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: Intel: avs: Use struct_size for struct avs_modcfg_ext size
Jacob Keller [Fri, 3 Mar 2023 18:04:57 +0000 (10:04 -0800)]
ASoC: Intel: avs: Use struct_size for struct avs_modcfg_ext size

The struct avs_modcfg_ext structure has a flexible array member for the
pin_fmts array, and the size should be calculated using struct_size to
prevent the potential for overflow with the allocation.

Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Reviewed-by: "Amadeusz Sławiński" <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Link: https://lore.kernel.org/r/20230303180457.2457069-1-jacob.e.keller@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoMAINTAINERS: update Microchip AT91 sound entries with documentation files
Claudiu Beznea [Wed, 1 Mar 2023 11:38:07 +0000 (13:38 +0200)]
MAINTAINERS: update Microchip AT91 sound entries with documentation files

Add documentation files to Microchip AT91 sound entries.

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Link: https://lore.kernel.org/r/20230301113807.24036-9-claudiu.beznea@microchip.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoMAINTAINERS: add myself as maintainer for Microchip AT91 sound drivers
Claudiu Beznea [Wed, 1 Mar 2023 11:38:06 +0000 (13:38 +0200)]
MAINTAINERS: add myself as maintainer for Microchip AT91 sound drivers

Codrin is not with Microchip anymore. As I worked lately with Microchip
AT91 sound drivers add myself as maintainer for these.

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Link: https://lore.kernel.org/r/20230301113807.24036-8-claudiu.beznea@microchip.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: mchp-pdmc: avoid casting to/from void pointer
Claudiu Beznea [Wed, 1 Mar 2023 11:38:05 +0000 (13:38 +0200)]
ASoC: mchp-pdmc: avoid casting to/from void pointer

Do not cast to and from void pointer. There is no need for this.

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/20230301113807.24036-7-claudiu.beznea@microchip.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: mchp-pdmc: return directly ret
Claudiu Beznea [Wed, 1 Mar 2023 11:38:04 +0000 (13:38 +0200)]
ASoC: mchp-pdmc: return directly ret

Return directly ret instead of having different branches for error and
OK paths.

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/20230301113807.24036-6-claudiu.beznea@microchip.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: mchp-pdmc: use FIELD_PREP() where possible
Claudiu Beznea [Wed, 1 Mar 2023 11:38:03 +0000 (13:38 +0200)]
ASoC: mchp-pdmc: use FIELD_PREP() where possible

Use FIELD_PREP() macro where possible instead of driver local defined
macros.

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/20230301113807.24036-5-claudiu.beznea@microchip.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: mchp-spdiftx: update debug message
Claudiu Beznea [Wed, 1 Mar 2023 11:38:02 +0000 (13:38 +0200)]
ASoC: mchp-spdiftx: update debug message

Previous debug message states that there was a failure and tx was not
disabled. Which is not true as the TX in this function could also be
enabled. Thus improve a bit the debug message by s/disable/start\/stop/.

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/20230301113807.24036-4-claudiu.beznea@microchip.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: mchp-spdiftx: use regmap_update_bits()
Claudiu Beznea [Wed, 1 Mar 2023 11:38:01 +0000 (13:38 +0200)]
ASoC: mchp-spdiftx: use regmap_update_bits()

Use regmap_update_bits() instead of regmap_read(), running variable,
regmap_write(). There is no need for extra variables and checks around
it as regmap_update_bits() already does this. With this code becomes
simpler.

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/20230301113807.24036-3-claudiu.beznea@microchip.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: mchp-spdiftx: use FIELD_PREP() where possible
Claudiu Beznea [Wed, 1 Mar 2023 11:38:00 +0000 (13:38 +0200)]
ASoC: mchp-spdiftx: use FIELD_PREP() where possible

Use directly FIELD_PREP() marco where possible. There is no need for
the extra wrappers.

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/20230301113807.24036-2-claudiu.beznea@microchip.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: maxim,max9867: add "mclk" support
Benjamin Bara [Fri, 3 Mar 2023 10:04:03 +0000 (11:04 +0100)]
ASoC: maxim,max9867: add "mclk" support

Add basic support for the codecs' mclk.
Enable it on SND_SOC_BIAS_ON, disable it on SND_SOC_BIAS_OFF.

Signed-off-by: Benjamin Bara <benjamin.bara@skidata.com>
Signed-off-by: Richard Leitner <richard.leitner@skidata.com>
Link: https://lore.kernel.org/r/20230302-max9867-v2-3-fd2036d5e825@skidata.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: dt-bindings: maxim,max9867: add clocks property
Richard Leitner [Fri, 3 Mar 2023 10:04:02 +0000 (11:04 +0100)]
ASoC: dt-bindings: maxim,max9867: add clocks property

Add clocks property to require a "mclk" definition for the
maxim,max9867 codec.

Signed-off-by: Richard Leitner <richard.leitner@skidata.com>
Link: https://lore.kernel.org/r/20230302-max9867-v2-2-fd2036d5e825@skidata.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: dt-bindings: maxim,max9867: convert txt bindings to yaml
Richard Leitner [Fri, 3 Mar 2023 10:04:01 +0000 (11:04 +0100)]
ASoC: dt-bindings: maxim,max9867: convert txt bindings to yaml

Convert from max9867.txt to maxim,max9867.yaml and add missing
'#sound-dai-cells' property.

Signed-off-by: Richard Leitner <richard.leitner@skidata.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230302-max9867-v2-1-fd2036d5e825@skidata.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: SOF: Intel: MTL: Enable DMI L1
Ranjani Sridharan [Mon, 20 Feb 2023 07:58:04 +0000 (09:58 +0200)]
ASoC: SOF: Intel: MTL: Enable DMI L1

DMI L1 should be enabled unconditionally after FW boot is complete.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230220075804.4829-4-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: SOF: Intel: hda: Restrict DMI L1 disable workaround
Ranjani Sridharan [Mon, 20 Feb 2023 07:58:03 +0000 (09:58 +0200)]
ASoC: SOF: Intel: hda: Restrict DMI L1 disable workaround

The workaround to disable DMI L1 should be restricted to only the CAVS
IP's.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230220075804.4829-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: SOF: Intel: hda: Do not re-enable L1 if disabled before suspend
Ranjani Sridharan [Mon, 20 Feb 2023 07:58:02 +0000 (09:58 +0200)]
ASoC: SOF: Intel: hda: Do not re-enable L1 if disabled before suspend

We have a workaround in place to address a known issue with host DMA
running into xruns when capture streams are running. But when resuming
from Sx, we unconditionally re-enable DMI L1 without taking the
workaround into account and this could lead to xruns when a suspended
capture stream is restarted.

To fix this rename the flag l1_support_enabled to l1_disabled in struct
sof_intel_hda_dev to save the L1 disabled status which can be
set/cleared when we get/put a stream and use the flag to determine if DMI
L1 should enabled or not during the post_fw_run op.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230220075804.4829-2-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: amd: vangogh: Add components prefix in structs and function names
Lucas Tanure [Fri, 17 Feb 2023 11:08:50 +0000 (11:08 +0000)]
ASoC: amd: vangogh: Add components prefix in structs and function names

Add prefixes 8821/35l41 in structs and function names so future platforms
can be added and reference the correct sound card.
Also include acp5x prefix to cs35l41_conf.

Signed-off-by: Lucas Tanure <lucas.tanure@collabora.com>
Link: https://lore.kernel.org/r/20230217110850.1045250-10-lucas.tanure@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: amd: vangogh: Centralize strings definition
Lucas Tanure [Fri, 17 Feb 2023 11:08:49 +0000 (11:08 +0000)]
ASoC: amd: vangogh: Centralize strings definition

Replace occurrences of strings by their definition, avoiding
bugs where the string changed, but not all places have been modified.
While at it rename defines to use NAU8821 codec name instead of NUVOTON
and align with the other defines.

Signed-off-by: Lucas Tanure <lucas.tanure@collabora.com>
Link: https://lore.kernel.org/r/20230217110850.1045250-9-lucas.tanure@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: amd: vangogh: Move nau8821 and CPU side code up for future platform
Lucas Tanure [Fri, 17 Feb 2023 11:08:48 +0000 (11:08 +0000)]
ASoC: amd: vangogh: Move nau8821 and CPU side code up for future platform

Move nau8821 and CPU side code up in the source so future platforms can
be added.

Signed-off-by: Lucas Tanure <lucas.tanure@collabora.com>
Link: https://lore.kernel.org/r/20230217110850.1045250-8-lucas.tanure@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: amd: vangogh: Check Bit Clock rate before snd_soc_dai_set_pll
Lucas Tanure [Fri, 17 Feb 2023 11:08:47 +0000 (11:08 +0000)]
ASoC: amd: vangogh: Check Bit Clock rate before snd_soc_dai_set_pll

Check bit clock is valid before setting it with snd_soc_dai_set_pll

Signed-off-by: Lucas Tanure <lucas.tanure@collabora.com>
Link: https://lore.kernel.org/r/20230217110850.1045250-7-lucas.tanure@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: amd: vangogh: use for_each_rtd_components instead of for
Lucas Tanure [Fri, 17 Feb 2023 11:08:46 +0000 (11:08 +0000)]
ASoC: amd: vangogh: use for_each_rtd_components instead of for

To iterate over components use for_each_rtd_components
And compare to component name, so asoc_rtd_to_codec and the dai code can
be removed

Signed-off-by: Lucas Tanure <lucas.tanure@collabora.com>
Link: https://lore.kernel.org/r/20230217110850.1045250-6-lucas.tanure@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: amd: vangogh: remove unnecessarily included headers
Lucas Tanure [Fri, 17 Feb 2023 11:08:45 +0000 (11:08 +0000)]
ASoC: amd: vangogh: remove unnecessarily included headers

Remove unused includes and replace <linux/input.h> by
<linux/input-event-codes.h>

Signed-off-by: Lucas Tanure <lucas.tanure@collabora.com>
Link: https://lore.kernel.org/r/20230217110850.1045250-5-lucas.tanure@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: amd: vangogh: use sizeof of variable instead of struct type
Lucas Tanure [Fri, 17 Feb 2023 11:08:44 +0000 (11:08 +0000)]
ASoC: amd: vangogh: use sizeof of variable instead of struct type

Use sizeof(*machine) instead of sizeof(struct acp5x_platform_info)

There is a possibility of bug when variable type has changed but
corresponding struct passed to the sizeof has not.

Signed-off-by: Lucas Tanure <lucas.tanure@collabora.com>
Link: https://lore.kernel.org/r/20230217110850.1045250-4-lucas.tanure@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: amd: vangogh: Small code refactor
Lucas Tanure [Fri, 17 Feb 2023 11:08:43 +0000 (11:08 +0000)]
ASoC: amd: vangogh: Small code refactor

Small refactor of the code:
 - sort includes in alphabetical order
 - sort variables declarations by line length
 - remove unnecessary "struct snd_soc_card *card" lines
 - insert blank lines before return
 - break/unbreak some lines for better read
 - align defines

Signed-off-by: Lucas Tanure <lucas.tanure@collabora.com>
Link: https://lore.kernel.org/r/20230217110850.1045250-3-lucas.tanure@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: amd: vangogh: Remove unnecessary init function
Lucas Tanure [Fri, 17 Feb 2023 11:08:42 +0000 (11:08 +0000)]
ASoC: amd: vangogh: Remove unnecessary init function

Remove empty acp5x_cs35l41_init function

Signed-off-by: Lucas Tanure <lucas.tanure@collabora.com>
Link: https://lore.kernel.org/r/20230217110850.1045250-2-lucas.tanure@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoMAINTAINERS: add the Freescale QMC audio entry
Herve Codina [Fri, 17 Feb 2023 14:56:45 +0000 (15:56 +0100)]
MAINTAINERS: add the Freescale QMC audio entry

After contributing the component, add myself as the maintainer
for the Freescale QMC audio ASoC component.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Link: https://lore.kernel.org/r/20230217145645.1768659-11-herve.codina@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: fsl: Add support for QMC audio
Herve Codina [Fri, 17 Feb 2023 14:56:44 +0000 (15:56 +0100)]
ASoC: fsl: Add support for QMC audio

The QMC audio is an ASoC component which provides DAIs
that use the QMC (QUICC Multichannel Controller) to transfer
the audio data.

It provides as many DAIs as the number of QMC channels it
references.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Tested-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Link: https://lore.kernel.org/r/20230217145645.1768659-10-herve.codina@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agodt-bindings: sound: Add support for QMC audio
Herve Codina [Fri, 17 Feb 2023 14:56:43 +0000 (15:56 +0100)]
dt-bindings: sound: Add support for QMC audio

The QMC (QUICC mutichannel controller) is a controller
present in some PowerQUICC SoC such as MPC885.
The QMC audio is an ASoC component that uses the QMC
controller to transfer the audio data.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Link: https://lore.kernel.org/r/20230217145645.1768659-9-herve.codina@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoMAINTAINERS: add the Freescale QMC controller entry
Herve Codina [Fri, 17 Feb 2023 14:56:42 +0000 (15:56 +0100)]
MAINTAINERS: add the Freescale QMC controller entry

After contributing the driver, add myself as the maintainer
for the Freescale QMC controller.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Link: https://lore.kernel.org/r/20230217145645.1768659-8-herve.codina@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agosoc: fsl: cpm1: Add support for QMC
Herve Codina [Fri, 17 Feb 2023 14:56:41 +0000 (15:56 +0100)]
soc: fsl: cpm1: Add support for QMC

The QMC (QUICC Multichannel Controller) emulates up to 64
channels within one serial controller using the same TDM
physical interface routed from the TSA.

It is available in some PowerQUICC SoC such as the
MPC885 or MPC866.

It is also available on some Quicc Engine SoCs.
This current version support CPM1 SoCs only and some
enhancement are needed to support Quicc Engine SoCs.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Acked-by: Li Yang <leoyang.li@nxp.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Link: https://lore.kernel.org/r/20230217145645.1768659-7-herve.codina@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agodt-bindings: soc: fsl: cpm_qe: Add QMC controller
Herve Codina [Fri, 17 Feb 2023 14:56:40 +0000 (15:56 +0100)]
dt-bindings: soc: fsl: cpm_qe: Add QMC controller

Add support for the QMC (QUICC Multichannel Controller)
available in some PowerQUICC SoC such as MPC885 or MPC866.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Link: https://lore.kernel.org/r/20230217145645.1768659-6-herve.codina@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agopowerpc/8xx: Use a larger CPM1 command check mask
Herve Codina [Fri, 17 Feb 2023 14:56:39 +0000 (15:56 +0100)]
powerpc/8xx: Use a larger CPM1 command check mask

The CPM1 command mask is defined for use with the standard
CPM1 command register as described in the user's manual:
  0  |1        3|4    7|8   11|12      14| 15|
  RST|    -     |OPCODE|CH_NUM|     -    |FLG|

In the QMC extension the CPM1 command register is redefined
(QMC supplement user's manuel) with the following mapping:
  0  |1        3|4    7|8           13|14| 15|
  RST|QMC OPCODE|  1110|CHANNEL_NUMBER| -|FLG|

Extend the check command mask in order to support both the
standard CH_NUM field and the QMC extension CHANNEL_NUMBER
field.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Acked-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Acked-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20230217145645.1768659-5-herve.codina@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoMAINTAINERS: add the Freescale TSA controller entry
Herve Codina [Fri, 17 Feb 2023 14:56:38 +0000 (15:56 +0100)]
MAINTAINERS: add the Freescale TSA controller entry

After contributing the driver, add myself as the maintainer
for the Freescale TSA controller.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Link: https://lore.kernel.org/r/20230217145645.1768659-4-herve.codina@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agosoc: fsl: cpm1: Add support for TSA
Herve Codina [Fri, 17 Feb 2023 14:56:37 +0000 (15:56 +0100)]
soc: fsl: cpm1: Add support for TSA

The TSA (Time Slot Assigner) purpose is to route some
TDM time-slots to other internal serial controllers.

It is available in some PowerQUICC SoC such as the
MPC885 or MPC866.

It is also available on some Quicc Engine SoCs.
This current version support CPM1 SoCs only and some
enhancement are needed to support Quicc Engine SoCs.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Acked-by: Li Yang <leoyang.li@nxp.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Link: https://lore.kernel.org/r/20230217145645.1768659-3-herve.codina@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agodt-bindings: soc: fsl: cpm_qe: Add TSA controller
Herve Codina [Fri, 17 Feb 2023 14:56:36 +0000 (15:56 +0100)]
dt-bindings: soc: fsl: cpm_qe: Add TSA controller

Add support for the time slot assigner (TSA)
available in some PowerQUICC SoC such as MPC885
or MPC866.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Link: https://lore.kernel.org/r/20230217145645.1768659-2-herve.codina@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: tas571x: add support for TAS5733
Kamel Bouhara [Wed, 22 Feb 2023 08:33:00 +0000 (09:33 +0100)]
ASoC: tas571x: add support for TAS5733

This adds support for TAS5733.

Signed-off-by: Kamel Bouhara <kamel.bouhara@bootlin.com>
Link: https://lore.kernel.org/r/20230222083300.218523-3-kamel.bouhara@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: tas571x: add tas5733 compatible
Kamel Bouhara [Wed, 22 Feb 2023 08:32:59 +0000 (09:32 +0100)]
ASoC: tas571x: add tas5733 compatible

This adds the tas5733 to the TAS571X binding.

Signed-off-by: Kamel Bouhara <kamel.bouhara@bootlin.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230222083300.218523-2-kamel.bouhara@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: sh: rz-ssi: Update interrupt handling for half duplex channels
Lad Prabhakar [Fri, 17 Feb 2023 18:52:23 +0000 (18:52 +0000)]
ASoC: sh: rz-ssi: Update interrupt handling for half duplex channels

For half duplex channels we dont have separate interrupts for Tx and Rx
instead we have single interrupt Rt (where the signal for Rx and Tx is
muxed). To handle such a case install a handler in case we have a dma_rt
interrupt specified in the DT for the PIO mode.

Note, for backward compatibility we check if the Rx and Tx interrupts
are present first instead of checking Rt interrupt.

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>
Link: https://lore.kernel.org/r/20230217185225.43310-3-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: dt-bindings: renesas,rz-ssi: Update interrupts and interrupt-names properties
Lad Prabhakar [Fri, 17 Feb 2023 18:52:22 +0000 (18:52 +0000)]
ASoC: dt-bindings: renesas,rz-ssi: Update interrupts and interrupt-names properties

From R01UH0914EJ0120 Rev.1.20 HW manual, for full duplex channels
(SSI0/1/3) dma_rt interrupt has now being marked as reserved and similarly
for half duplex channel (SSI2) dma_rx and dma_tx interrupts have now being
marked as reserved (this applies to RZ/G2L and alike SoC's). This patch
updates the binding doc to match the same.

While at it also updated the example node.

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230217185225.43310-2-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: dt-bindings: cirrus,cs35l41: Document CS35l41 shared boost
Lucas Tanure [Thu, 23 Feb 2023 08:43:24 +0000 (08:43 +0000)]
ASoC: dt-bindings: cirrus,cs35l41: Document CS35l41 shared boost

Describe the properties used for shared boost configuration.
Based on David Rhodes shared boost patches.

Signed-off-by: Lucas Tanure <lucas.tanure@collabora.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: David Rhodes <david.rhodes@cirrus.com>
Link: https://lore.kernel.org/r/20230223084324.9076-5-lucas.tanure@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoALSA: cs35l41: Add shared boost feature
Lucas Tanure [Thu, 23 Feb 2023 08:43:23 +0000 (08:43 +0000)]
ALSA: cs35l41: Add shared boost feature

Shared boost allows two amplifiers to share a single boost circuit by
communicating on the MDSYNC bus.
The passive amplifier does not control the boost and receives data from
the active amplifier.

Shared Boost is not supported in HDA Systems.
Based on David Rhodes shared boost patches.

Signed-off-by: Lucas Tanure <lucas.tanure@collabora.com>
Reviewed-by: David Rhodes <david.rhodes@cirrus.com>
Link: https://lore.kernel.org/r/20230223084324.9076-4-lucas.tanure@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: cs35l41: Refactor error release code
Lucas Tanure [Thu, 23 Feb 2023 08:43:22 +0000 (08:43 +0000)]
ASoC: cs35l41: Refactor error release code

Add cs35l41_error_release function to handle error release sequences.

Signed-off-by: Lucas Tanure <lucas.tanure@collabora.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: David Rhodes <david.rhodes@cirrus.com>
Link: https://lore.kernel.org/r/20230223084324.9076-3-lucas.tanure@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: cs35l41: Only disable internal boost
Lucas Tanure [Thu, 23 Feb 2023 08:43:21 +0000 (08:43 +0000)]
ASoC: cs35l41: Only disable internal boost

In error situations, only the internal boost case should be disabled and
re-enabled.
Also, for other boost cases re-enabling the boost to the default internal
boost config is incorrect.

Fixes: 6450ef559056 ("ASoC: cs35l41: CS35L41 Boosted Smart Amplifier")
Signed-off-by: Lucas Tanure <lucas.tanure@collabora.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: David Rhodes <david.rhodes@cirrus.com>
Link: https://lore.kernel.org/r/20230223084324.9076-2-lucas.tanure@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoLinux 6.3-rc1
Linus Torvalds [Sun, 5 Mar 2023 22:52:03 +0000 (14:52 -0800)]
Linux 6.3-rc1

20 months agocpumask: re-introduce constant-sized cpumask optimizations
Linus Torvalds [Sat, 4 Mar 2023 21:35:43 +0000 (13:35 -0800)]
cpumask: re-introduce constant-sized cpumask optimizations

Commit aa47a7c215e7 ("lib/cpumask: deprecate nr_cpumask_bits") resulted
in the cpumask operations potentially becoming hugely less efficient,
because suddenly the cpumask was always considered to be variable-sized.

The optimization was then later added back in a limited form by commit
6f9c07be9d02 ("lib/cpumask: add FORCE_NR_CPUS config option"), but that
FORCE_NR_CPUS option is not useful in a generic kernel and more of a
special case for embedded situations with fixed hardware.

Instead, just re-introduce the optimization, with some changes.

Instead of depending on CPUMASK_OFFSTACK being false, and then always
using the full constant cpumask width, this introduces three different
cpumask "sizes":

 - the exact size (nr_cpumask_bits) remains identical to nr_cpu_ids.

   This is used for situations where we should use the exact size.

 - the "small" size (small_cpumask_bits) is the NR_CPUS constant if it
   fits in a single word and the bitmap operations thus end up able
   to trigger the "small_const_nbits()" optimizations.

   This is used for the operations that have optimized single-word
   cases that get inlined, notably the bit find and scanning functions.

 - the "large" size (large_cpumask_bits) is the NR_CPUS constant if it
   is an sufficiently small constant that makes simple "copy" and
   "clear" operations more efficient.

   This is arbitrarily set at four words or less.

As a an example of this situation, without this fixed size optimization,
cpumask_clear() will generate code like

        movl    nr_cpu_ids(%rip), %edx
        addq    $63, %rdx
        shrq    $3, %rdx
        andl    $-8, %edx
        callq   memset@PLT

on x86-64, because it would calculate the "exact" number of longwords
that need to be cleared.

In contrast, with this patch, using a MAX_CPU of 64 (which is quite a
reasonable value to use), the above becomes a single

movq $0,cpumask

instruction instead, because instead of caring to figure out exactly how
many CPU's the system has, it just knows that the cpumask will be a
single word and can just clear it all.

Note that this does end up tightening the rules a bit from the original
version in another way: operations that set bits in the cpumask are now
limited to the actual nr_cpu_ids limit, whereas we used to do the
nr_cpumask_bits thing almost everywhere in the cpumask code.

But if you just clear bits, or scan for bits, we can use the simpler
compile-time constants.

In the process, remove 'cpumask_complement()' and 'for_each_cpu_not()'
which were not useful, and which fundamentally have to be limited to
'nr_cpu_ids'.  Better remove them now than have somebody introduce use
of them later.

Of course, on x86-64 with MAXSMP there is no sane small compile-time
constant for the cpumask sizes, and we end up using the actual CPU bits,
and will generate the above kind of horrors regardless.  Please don't
use MAXSMP unless you really expect to have machines with thousands of
cores.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
20 months agoMerge tag 'v6.3-p2' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Linus Torvalds [Sun, 5 Mar 2023 19:32:30 +0000 (11:32 -0800)]
Merge tag 'v6.3-p2' of git://git./linux/kernel/git/herbert/crypto-2.6

Pull crypto fix from Herbert Xu:
 "Fix a regression in the caam driver"

* tag 'v6.3-p2' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
  crypto: caam - Fix edesc/iv ordering mixup

20 months agoMerge tag 'x86-urgent-2023-03-05' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Sun, 5 Mar 2023 19:27:48 +0000 (11:27 -0800)]
Merge tag 'x86-urgent-2023-03-05' of git://git./linux/kernel/git/tip/tip

Pull x86 updates from Thomas Gleixner:
 "A small set of updates for x86:

   - Return -EIO instead of success when the certificate buffer for SEV
     guests is not large enough

   - Allow STIPB to be enabled with legacy IBSR. Legacy IBRS is cleared
     on return to userspace for performance reasons, but the leaves user
     space vulnerable to cross-thread attacks which STIBP prevents.
     Update the documentation accordingly"

* tag 'x86-urgent-2023-03-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  virt/sev-guest: Return -EIO if certificate buffer is not large enough
  Documentation/hw-vuln: Document the interaction between IBRS and STIBP
  x86/speculation: Allow enabling STIBP with legacy IBRS

20 months agoMerge tag 'irq-urgent-2023-03-05' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Sun, 5 Mar 2023 19:19:16 +0000 (11:19 -0800)]
Merge tag 'irq-urgent-2023-03-05' of git://git./linux/kernel/git/tip/tip

Pull irq updates from Thomas Gleixner:
 "A set of updates for the interrupt susbsystem:

   - Prevent possible NULL pointer derefences in
     irq_data_get_affinity_mask() and irq_domain_create_hierarchy()

   - Take the per device MSI lock before invoking code which relies on
     it being hold

   - Make sure that MSI descriptors are unreferenced before freeing
     them. This was overlooked when the platform MSI code was converted
     to use core infrastructure and results in a fals positive warning

   - Remove dead code in the MSI subsystem

   - Clarify the documentation for pci_msix_free_irq()

   - More kobj_type constification"

* tag 'irq-urgent-2023-03-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  genirq/msi, platform-msi: Ensure that MSI descriptors are unreferenced
  genirq/msi: Drop dead domain name assignment
  irqdomain: Add missing NULL pointer check in irq_domain_create_hierarchy()
  genirq/irqdesc: Make kobj_type structures constant
  PCI/MSI: Clarify usage of pci_msix_free_irq()
  genirq/msi: Take the per-device MSI lock before validating the control structure
  genirq/ipi: Fix NULL pointer deref in irq_data_get_affinity_mask()

20 months agoMerge tag 'pull-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Linus Torvalds [Sun, 5 Mar 2023 19:11:52 +0000 (11:11 -0800)]
Merge tag 'pull-misc' of git://git./linux/kernel/git/viro/vfs

Pull vfs update from Al Viro:
 "Adding Christian Brauner as VFS co-maintainer"

* tag 'pull-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
  Adding VFS co-maintainer

20 months agoMerge tag 'pull-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Linus Torvalds [Sun, 5 Mar 2023 19:07:58 +0000 (11:07 -0800)]
Merge tag 'pull-fixes' of git://git./linux/kernel/git/viro/vfs

Pull VM_FAULT_RETRY fixes from Al Viro:
 "Some of the page fault handlers do not deal with the following case
  correctly:

   - handle_mm_fault() has returned VM_FAULT_RETRY

   - there is a pending fatal signal

   - fault had happened in kernel mode

  Correct action in such case is not "return unconditionally" - fatal
  signals are handled only upon return to userland and something like
  copy_to_user() would end up retrying the faulting instruction and
  triggering the same fault again and again.

  What we need to do in such case is to make the caller to treat that as
  failed uaccess attempt - handle exception if there is an exception
  handler for faulting instruction or oops if there isn't one.

  Over the years some architectures had been fixed and now are handling
  that case properly; some still do not. This series should fix the
  remaining ones.

  Status:

   - m68k, riscv, hexagon, parisc: tested/acked by maintainers.

   - alpha, sparc32, sparc64: tested locally - bug has been reproduced
     on the unpatched kernel and verified to be fixed by this series.

   - ia64, microblaze, nios2, openrisc: build, but otherwise completely
     untested"

* tag 'pull-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
  openrisc: fix livelock in uaccess
  nios2: fix livelock in uaccess
  microblaze: fix livelock in uaccess
  ia64: fix livelock in uaccess
  sparc: fix livelock in uaccess
  alpha: fix livelock in uaccess
  parisc: fix livelock in uaccess
  hexagon: fix livelock in uaccess
  riscv: fix livelock in uaccess
  m68k: fix livelock in uaccess

20 months agoRemove Intel compiler support
Masahiro Yamada [Sun, 16 Oct 2022 18:23:49 +0000 (03:23 +0900)]
Remove Intel compiler support

include/linux/compiler-intel.h had no update in the past 3 years.

We often forget about the third C compiler to build the kernel.

For example, commit a0a12c3ed057 ("asm goto: eradicate CC_HAS_ASM_GOTO")
only mentioned GCC and Clang.

init/Kconfig defines CC_IS_GCC and CC_IS_CLANG but not CC_IS_ICC,
and nobody has reported any issue.

I guess the Intel Compiler support is broken, and nobody is caring
about it.

Harald Arnesen pointed out ICC (classic Intel C/C++ compiler) is
deprecated:

    $ icc -v
    icc: remark #10441: The Intel(R) C++ Compiler Classic (ICC) is
    deprecated and will be removed from product release in the second half
    of 2023. The Intel(R) oneAPI DPC++/C++ Compiler (ICX) is the recommended
    compiler moving forward. Please transition to use this compiler. Use
    '-diag-disable=10441' to disable this message.
    icc version 2021.7.0 (gcc version 12.1.0 compatibility)

Arnd Bergmann provided a link to the article, "Intel C/C++ compilers
complete adoption of LLVM".

lib/zstd/common/compiler.h and lib/zstd/compress/zstd_fast.c were kept
untouched for better sync with https://github.com/facebook/zstd

Link: https://www.intel.com/content/www/us/en/developer/articles/technical/adoption-of-llvm-complete-icx.html
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Miguel Ojeda <ojeda@kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
20 months agoAdding VFS co-maintainer
Al Viro [Sun, 5 Mar 2023 01:27:29 +0000 (20:27 -0500)]
Adding VFS co-maintainer

Acked-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
20 months agoMerge tag 'i2c-for-6.3-rc1-part2' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Sat, 4 Mar 2023 22:48:29 +0000 (14:48 -0800)]
Merge tag 'i2c-for-6.3-rc1-part2' of git://git./linux/kernel/git/wsa/linux

Pull more i2c updates from Wolfram Sang:
 "Some improvements/fixes for the newly added GXP driver and a Kconfig
  dependency fix"

* tag 'i2c-for-6.3-rc1-part2' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
  i2c: gxp: fix an error code in probe
  i2c: gxp: return proper error on address NACK
  i2c: gxp: remove "empty" switch statement
  i2c: Disable I2C_APPLE when I2C_PASEMI is a builtin

20 months agomm: avoid gcc complaint about pointer casting
Linus Torvalds [Sat, 4 Mar 2023 22:03:27 +0000 (14:03 -0800)]
mm: avoid gcc complaint about pointer casting

The migration code ends up temporarily stashing information of the wrong
type in unused fields of the newly allocated destination folio.  That
all works fine, but gcc does complain about the pointer type mis-use:

    mm/migrate.c: In function ‘__migrate_folio_extract’:
    mm/migrate.c:1050:20: note: randstruct: casting between randomized structure pointer types (ssa): ‘struct anon_vma’ and ‘struct address_space’

     1050 |         *anon_vmap = (void *)dst->mapping;
          |         ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~

and gcc is actually right to complain since it really doesn't understand
that this is a very temporary special case where this is ok.

This could be fixed in different ways by just obfuscating the assignment
sufficiently that gcc doesn't see what is going on, but the truly
"proper C" way to do this is by explicitly using a union.

Using unions for type conversions like this is normally hugely ugly and
syntactically nasty, but this really is one of the few cases where we
want to make it clear that we're not doing type conversion, we're really
re-using the value bit-for-bit just using another type.

IOW, this should not become a common pattern, but in this one case using
that odd union is probably the best way to document to the compiler what
is conceptually going on here.

[ Side note: there are valid cases where we convert pointers to other
  pointer types, notably the whole "folio vs page" situation, where the
  types actually have fundamental commonalities.

  The fact that the gcc note is limited to just randomized structures
  means that we don't see equivalent warnings for those cases, but it
  migth also mean that we miss other cases where we do play these kinds
  of dodgy games, and this kind of explicit conversion might be a good
  idea. ]

I verified that at least for an allmodconfig build on x86-64, this
generates the exact same code, apart from line numbers and assembler
comment changes.

Fixes: 64c8902ed441 ("migrate_pages: split unmap_and_move() to _unmap() and _move()")
Cc: Huang, Ying <ying.huang@intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>