platform/kernel/linux-starfive.git
17 months agoASoC: mediatek: mt8188: revise AFE driver
Mark Brown [Mon, 15 May 2023 15:30:08 +0000 (00:30 +0900)]
ASoC: mediatek: mt8188: revise AFE driver

Merge series from Trevor Wu <trevor.wu@mediatek.com>:

The series of patches consists of four major changes.
First, remove redundant supply for ADDA DAI dirver. Second, revise ETDM
control including APLL dynamic switch via DAPM, so APLL can be enabled
when it is really required. Third, update AFE probe function. Bus
protection change was dropped at the previous patch because the dependent
change was not accepted at that time. Finally, correct some binding errors
and add required clocks.

17 months agoASoC: Factor out control notification support
Mark Brown [Mon, 15 May 2023 15:17:58 +0000 (00:17 +0900)]
ASoC: Factor out control notification support

Merge series from Charles Keepax <ckeepax@opensource.cirrus.com>:

This series introduces and uses a helper for notifying control changes
to userspace.

17 months agoASoC: SOF: Intel/ipc4: Do not reset BE DAI pipeline
Mark Brown [Mon, 15 May 2023 15:17:51 +0000 (00:17 +0900)]
ASoC: SOF: Intel/ipc4: Do not reset BE DAI pipeline

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

Do not reset pipelines during the stop/suspend triggers in the BE DAI
ops as the BE DAI pipeline needs to be left in the PAUSED state. It should
only be reset during hw_free. This simplification is already done for
the FE pipelines and the DAI trigger only toggles the states between
PAUSED and RUNNING.

17 months agoASoC: SOF: Intel: hda-dai: prepare LNL support
Mark Brown [Mon, 15 May 2023 15:17:44 +0000 (00:17 +0900)]
ASoC: SOF: Intel: hda-dai: prepare LNL support

Merge series from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

The HDAudio support has not changed much since CometLake/2019: the
code was reshuffled for IPC4 support and we used hdac_hda for external
and Display Audio codec, but the hda-dai code was only used for
HDAudio codecs.

In the LunarLake architecture, all endpoints (HDaudio, SSP, DMIC,
SoundWire) are handled with the HDaudio DMA, which requires us to
revisit the definitions of HDA_LINK, and remove the mutual exclusion
between NOCODEC and HDA_LINK: we do want the ability to test SSP/DMIC
in NOCODEC mode even with an HDA DMA.

This code change exposed a number of issues, with a useless .prepare
callback, a DAI number mismatch and the need to support SoundWire
which is handled by a different component in
drivers/soundwire/intel_ace2.c.

17 months agoASoC: Intel: machine driver updates
Mark Brown [Mon, 15 May 2023 15:17:37 +0000 (00:17 +0900)]
ASoC: Intel: machine driver updates

Merge series from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

Several updates for RPL/MTL/LNL, and one fix for SoundWire TGL device.

17 months agoASoC: SOF: ipc4-pcm: reset all pipelines during FE DAI hw_free
Ranjani Sridharan [Mon, 15 May 2023 11:20:22 +0000 (14:20 +0300)]
ASoC: SOF: ipc4-pcm: reset all pipelines during FE DAI hw_free

Do not reset pipelines during the stop/suspend triggers in the BE DAI
ops as the BE DAI pipeline needs to be left in the PAUSED state. It should
only be reset during hw_free. This simplification is already done for
the FE pipelines and the DAI trigger only toggles the states between
PAUSED and RUNNING.

But because the FE DAI hw_free is invoked first and all the pipelines are
freed during this op, we need to make sure that the BE DAI pipeline also
gets reset before it is freed. So do not skip the pipelines that have the
skip_during_fe_trigger flag set when resetting pipelines.

Also, because the pipeline state changes are split between the FE and BE
DAI ops now, protect the BE DAI pipeline state changes with the
pipeline_state_mutex as well.

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
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com
Link: https://lore.kernel.org/r/20230515112022.30297-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: SOF: Intel: hda-dai-ops: Split the get_hext_stream() op for IPC4
Ranjani Sridharan [Mon, 15 May 2023 11:20:21 +0000 (14:20 +0300)]
ASoC: SOF: Intel: hda-dai-ops: Split the get_hext_stream() op for IPC4

Introduce a separate op implementation for get_hext_stream() for IPC4.
This op will also be used to set the skip_during_fe_trigger flag for the
BE DAI pipeline. With this change, we can remove the flag setting in
sof_ipc4_dai_config() which will further simplify support for
DMIC/SSP/Soundwire in the LunarLake platform.

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
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com
Link: https://lore.kernel.org/r/20230515112022.30297-2-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: SOF: Simplify the calculation of variables
Jiapeng Chong [Fri, 12 May 2023 06:42:25 +0000 (14:42 +0800)]
ASoC: SOF: Simplify the calculation of variables

./sound/soc/sof/pcm.c:372:27-29: WARNING !A || A && B is equivalent to !A || B.

Reported-by: Abaci Robot <abaci@linux.alibaba.com
Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4938
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com
Reviewed-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com
Link: https://lore.kernel.org/r/20230512064225.75358-1-jiapeng.chong@linux.alibaba.com
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: SOF: ipc4-topology: Use set_get_data() to send LARGE_CONFIG message
Peter Ujfalusi [Fri, 12 May 2023 10:56:42 +0000 (13:56 +0300)]
ASoC: SOF: ipc4-topology: Use set_get_data() to send LARGE_CONFIG message

Instead of open coding the sending of sink format of the copier with
LARGE_CONFIG_SET message, use the proper function to do so.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com
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/20230512105642.23437-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: SOF: Intel: remove mutual exclusion between NOCODEC and HDA_LINK
Pierre-Louis Bossart [Fri, 12 May 2023 18:17:02 +0000 (13:17 -0500)]
ASoC: SOF: Intel: remove mutual exclusion between NOCODEC and HDA_LINK

The nocodec mode served two purposes so far
a) generate a test driver for DMIC/SSP without any codec connected
b) make sure the use of snd_hdac_ libraries was contained

b) is no longer an option for LunarLake, the HDaudio DMA is used for
DMIC/SSP and the HDA_LINK option needs to be enabled.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com
Reviewed-by: Rander Wang <rander.wang@intel.com
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com
Link: https://lore.kernel.org/r/20230512181702.117483-10-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: SOF: Intel: hda-dai: use HDA_LINK instead of HDA_AUDIO_CODEC
Pierre-Louis Bossart [Fri, 12 May 2023 18:17:01 +0000 (13:17 -0500)]
ASoC: SOF: Intel: hda-dai: use HDA_LINK instead of HDA_AUDIO_CODEC

For LunarLake support, we will have to use HDAudio DMA-based DAIs even
for SSP/DMIC/SoundWire. That's completely different to the
HDA_AUDIO_CODEC, the DAI ops deal with DMA configuration and that can
happen in the absence of any HDAudio codec.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com
Reviewed-by: Rander Wang <rander.wang@intel.com
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com
Link: https://lore.kernel.org/r/20230512181702.117483-9-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: SOF: Intel: hda-dai: mark functions as __maybe_unused
Pierre-Louis Bossart [Fri, 12 May 2023 18:17:00 +0000 (13:17 -0500)]
ASoC: SOF: Intel: hda-dai: mark functions as __maybe_unused

hda_dai_hw_params, hda_dai_trigger(), hda_dai_hw_free are currently
only used for HDaudio codec support, but will be reused for
SSP/DMIC/SoundWire in the LunarLake/ACE2.x case. To avoid 'defined but
not used' errors or added complexity in Kconfig, mark all these
functions as __maybe_used.

When SSP/DMIC/SoundWire are added, some of these changes may be
reverted. For now this avoids compilation warnings.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com
Reviewed-by: Rander Wang <rander.wang@intel.com
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com
Link: https://lore.kernel.org/r/20230512181702.117483-8-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: SOF: Intel: hda-dai: move hda_dai_prepare() code
Pierre-Louis Bossart [Fri, 12 May 2023 18:16:59 +0000 (13:16 -0500)]
ASoC: SOF: Intel: hda-dai: move hda_dai_prepare() code

Before we change the Kconfig support, move code around. No
functionality change with this commit in isolation.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com
Reviewed-by: Rander Wang <rander.wang@intel.com
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com
Link: https://lore.kernel.org/r/20230512181702.117483-7-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: SOF: Intel: Kconfig: move selection of PROBE_WORK_QUEUE
Pierre-Louis Bossart [Fri, 12 May 2023 18:16:58 +0000 (13:16 -0500)]
ASoC: SOF: Intel: Kconfig: move selection of PROBE_WORK_QUEUE

The probe workqueue is only needed if we have a Display Audio codec.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com
Reviewed-by: Rander Wang <rander.wang@intel.com
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com
Link: https://lore.kernel.org/r/20230512181702.117483-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: SOF: Intel: clarify initialization when HDA_AUDIO_CODEC is not used
Pierre-Louis Bossart [Fri, 12 May 2023 18:16:57 +0000 (13:16 -0500)]
ASoC: SOF: Intel: clarify initialization when HDA_AUDIO_CODEC is not used

For LunarLake support, we need to enable HDA_LINK but we also want the
ability to remove HDaudio codec support, e.g. for 'nocodec'
tests. This requires a small change in the bus initialization without
any codec-specific callbacks provided.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com
Reviewed-by: Rander Wang <rander.wang@intel.com
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com
Link: https://lore.kernel.org/r/20230512181702.117483-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: SOF: Intel: fix DAI number mismatch
Pierre-Louis Bossart [Fri, 12 May 2023 18:16:56 +0000 (13:16 -0500)]
ASoC: SOF: Intel: fix DAI number mismatch

The number of DAIs was based on a Kconfig option and the declaration
on another. Fix before changing the dependencies.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com
Reviewed-by: Rander Wang <rander.wang@intel.com
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com
Link: https://lore.kernel.org/r/20230512181702.117483-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: SOF: Intel: hda-dai: remove use of cpu_dai->component drvdata
Pierre-Louis Bossart [Fri, 12 May 2023 18:16:55 +0000 (13:16 -0500)]
ASoC: SOF: Intel: hda-dai: remove use of cpu_dai->component drvdata

The existing code relies on conversions from cpu_dai to the sdev
structure pointer based on the cpu_dai component. This works fine for
HDaudio but will not work for SoundWire DAIs which are registered by a
different component. That's a problem preventing reuse of the HDaudio
DMA stream allocation for SoundWire DAIs starting with the LunarLake
platform.

This patch introduces a set of helpers to perform the conversion, and
an indirect way of retrieving the sdev pointer based on the
swidget->comp intermediate pointer.

Suggested-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com
Reviewed-by: Rander Wang <rander.wang@intel.com
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com
Link: https://lore.kernel.org/r/20230512181702.117483-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: SOF: Intel: hda-dai: simplify .prepare callback
Pierre-Louis Bossart [Fri, 12 May 2023 18:16:54 +0000 (13:16 -0500)]
ASoC: SOF: Intel: hda-dai: simplify .prepare callback

The code has been cleaned-up multiple times, but while adding the new
abstractions for DMIC/SSP/SoundWire it appears that we don't really
need a specific sequence for .prepare, and we can reuse what
.hw_params already does.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com
Reviewed-by: Rander Wang <rander.wang@intel.com
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com
Link: https://lore.kernel.org/r/20230512181702.117483-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: Intel: sof_sdw: add quirk for LNL RVP
Peter Ujfalusi [Fri, 12 May 2023 17:33:05 +0000 (12:33 -0500)]
ASoC: Intel: sof_sdw: add quirk for LNL RVP

We should use RT711_JD2_100K for on board rt711

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com
Link: https://lore.kernel.org/r/20230512173305.65399-9-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: Intel: soc-acpi: add tables for LunarLake
Pierre-Louis Bossart [Fri, 12 May 2023 17:33:04 +0000 (12:33 -0500)]
ASoC: Intel: soc-acpi: add tables for LunarLake

These tables are used for 'nocodec' and SoundWire mockups+RVP tests.
The LNL RVP has a single rt711-sdca SoundWire codec.

Co-developed-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com
Link: https://lore.kernel.org/r/20230512173305.65399-8-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: Intel: sof_sdw: add new mapping for HP Spectre x360
Pierre-Louis Bossart [Fri, 12 May 2023 17:33:03 +0000 (12:33 -0500)]
ASoC: Intel: sof_sdw: add new mapping for HP Spectre x360

A BIOS/DMI update seems to have broken some devices, let's add a new
mapping.

Link: https://github.com/thesofproject/linux/issues/4323
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com
Reviewed-by: Rander Wang <rander.wang@intel.com
Link: https://lore.kernel.org/r/20230512173305.65399-7-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: Intel: sof_sdw: start set codec init function with an adr index
Bard Liao [Fri, 12 May 2023 17:33:02 +0000 (12:33 -0500)]
ASoC: Intel: sof_sdw: start set codec init function with an adr index

Currently, set_codec_init_func always start with link->adr_d[0] because
we assumed all adr_d on the same link are the same devices. The
assumption is no longer valid when different devices on the same sdw link
are supported.

Fixes: c8db7b50128b ("ASoC: Intel: sof_sdw: support different devices on the same sdw link")
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com
Link: https://lore.kernel.org/r/20230512173305.65399-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: Intel: soc-acpi: add support for MTL SDCA boards
Chao Song [Fri, 12 May 2023 17:33:01 +0000 (12:33 -0500)]
ASoC: Intel: soc-acpi: add support for MTL SDCA boards

The description and board layout is changed and different
from previous ones for CometLake and Tigerlake.

The new codec layout for MTL is:
  SDW0: RT711 Headphone
  SDW1: RT714 DMIC
  SDW2: RT1316 Speaker
  SDW3: RT1316 Speaker

The previous codec layout for CML and TGL is:
  SDW0: RT711 Headphone
  SDW1: RT1316 Speaker
  SDW2: RT1316 Speaker
  SDW3: RT714 DMIC

Signed-off-by: Chao Song <chao.song@linux.intel.com
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
Link: https://lore.kernel.org/r/20230512173305.65399-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: Intel: sof_sdw: add quirk for MTL RVP
Bard Liao [Fri, 12 May 2023 17:33:00 +0000 (12:33 -0500)]
ASoC: Intel: sof_sdw: add quirk for MTL RVP

We should use RT711_JD2_100K for on board rt711.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com
Link: https://lore.kernel.org/r/20230512173305.65399-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: Intel: sof_sdw: remove SOF_SDW_TGL_HDMI for MeteorLake devices
Bard Liao [Fri, 12 May 2023 17:32:59 +0000 (12:32 -0500)]
ASoC: Intel: sof_sdw: remove SOF_SDW_TGL_HDMI for MeteorLake devices

Topologies support three HDMI links on MeteorLake devices only.

Fixes: 18489174e4fb ("ASoC: intel: sof_sdw: add RT711 SDCA card for MTL platform")
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com
Link: https://lore.kernel.org/r/20230512173305.65399-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: Intel: Add rpl_max98373_8825 driver
Terry Cheong [Fri, 12 May 2023 17:32:58 +0000 (12:32 -0500)]
ASoC: Intel: Add rpl_max98373_8825 driver

Boards were using this in older kernels before adl and rpl ids were
split. Add this back to maintain support.

Signed-off-by: Terry Cheong <htcheong@chromium.org
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com
Link: https://lore.kernel.org/r/20230512173305.65399-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: wm_adsp: Update to use new component control notify helepr
Charles Keepax [Fri, 12 May 2023 12:28:32 +0000 (13:28 +0100)]
ASoC: wm_adsp: Update to use new component control notify helepr

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com
Link: https://lore.kernel.org/r/20230512122838.243002-5-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: ak4118: Update to use new component control notify helper
Charles Keepax [Fri, 12 May 2023 12:28:31 +0000 (13:28 +0100)]
ASoC: ak4118: Update to use new component control notify helper

Update the driver to use the new ASoC core control notify helper.
This also fixes a bug where the control would not be found if the
CODEC was given a name prefix.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com
Link: https://lore.kernel.org/r/20230512122838.243002-4-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: soc-component: Add notify control helper function
Charles Keepax [Fri, 12 May 2023 12:28:30 +0000 (13:28 +0100)]
ASoC: soc-component: Add notify control helper function

Add a function to allow ASoC drivers to easily notify an ALSA control
change. This function will automatically add any component naming
prefix into the control name.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com
Link: https://lore.kernel.org/r/20230512122838.243002-3-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: dt-bindings: mediatek,mt8188-afe: add audio properties
Trevor Wu [Wed, 10 May 2023 03:55:26 +0000 (11:55 +0800)]
ASoC: dt-bindings: mediatek,mt8188-afe: add audio properties

Add apll1_d4 to clocks for switching the parent of top_a1sys_hp
dynamically and add property "mediatek,infracfg" for bus protection.

Because no mt8188 upstream dts exists, the change won't break anything.
In addition, apll2_d4, apll12_div4, top_a2sys and top_aud_iec are also
included in clocks, because these clocks are possibly used in the future.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org
Link: https://lore.kernel.org/r/20230510035526.18137-10-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: dt-bindings: mediatek,mt8188-afe: correct clock name
Trevor Wu [Wed, 10 May 2023 03:55:25 +0000 (11:55 +0800)]
ASoC: dt-bindings: mediatek,mt8188-afe: correct clock name

The original clock names are different from the list in driver code.
Correct the mismatched binding names in the patch.

Because no mt8188 upstream dts exists, it doesn't affect the existing
dts file.

Fixes: 692d25b67e10 ("ASoC: dt-bindings: mediatek,mt8188-afe: add audio afe document")
Signed-off-by: Trevor Wu <trevor.wu@mediatek.com
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org
Link: https://lore.kernel.org/r/20230510035526.18137-9-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: mediatek: mt8188: add required clocks
Trevor Wu [Wed, 10 May 2023 03:55:24 +0000 (11:55 +0800)]
ASoC: mediatek: mt8188: add required clocks

apll2_d4, apll12_div4, top_a2sys and top_aud_iec are possibly used in
the future. To prevent from breaking binding ABI after any mt8188 dts
upstream, add these clocks to clock list in advance.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com
Link: https://lore.kernel.org/r/20230510035526.18137-8-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: mediatek: mt8188: add bus protection
Trevor Wu [Wed, 10 May 2023 03:55:23 +0000 (11:55 +0800)]
ASoC: mediatek: mt8188: add bus protection

Add bus protection for reset controller.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com
Link: https://lore.kernel.org/r/20230510035526.18137-7-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: mediatek: mt8188: combine afe component registration
Trevor Wu [Wed, 10 May 2023 03:55:22 +0000 (11:55 +0800)]
ASoC: mediatek: mt8188: combine afe component registration

There is no benefit to separate two components for AFE, so DAI driver
registration is moved to dev_snd_soc_register_component to merge these
two components.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com
Link: https://lore.kernel.org/r/20230510035526.18137-6-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: mediatek: mt8188: refine APLL control
Trevor Wu [Wed, 10 May 2023 03:55:21 +0000 (11:55 +0800)]
ASoC: mediatek: mt8188: refine APLL control

Currently, APLL is only used in ETDM module, so APLL and APLL tuner
don't need to be enabled when AFE is used. Integrate APLL control into
ETDM DAPM routes, so that APLL can be enabled when it is really required.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com
Link: https://lore.kernel.org/r/20230510035526.18137-5-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: mediatek: mt8188: revise ETDM control flow
Trevor Wu [Wed, 10 May 2023 03:55:20 +0000 (11:55 +0800)]
ASoC: mediatek: mt8188: revise ETDM control flow

Replace register controls in snd_soc_dai_ops with snd_soc_dapm_widgets.
startup, shutdown and trigger ops are removed, and create DAPM_SUPPLY
to handle mclk, clock gating and etdm enabling. Additionally, mclk setup
sequence is also updated because of new supply enabling sequence.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com
Link: https://lore.kernel.org/r/20230510035526.18137-4-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: mediatek: mt8188: complete set_tdm_slot function
Trevor Wu [Wed, 10 May 2023 03:55:19 +0000 (11:55 +0800)]
ASoC: mediatek: mt8188: complete set_tdm_slot function

User can configures slot number of TDM mode via set_tdm_slot callback.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com
Link: https://lore.kernel.org/r/20230510035526.18137-3-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: mediatek: mt8188: remove supply AUDIO_HIRES
Trevor Wu [Wed, 10 May 2023 03:55:18 +0000 (11:55 +0800)]
ASoC: mediatek: mt8188: remove supply AUDIO_HIRES

AUDIO_HIRES is not required in MT8188. Because top_audio_h is disabled
when hires clock is not used, set_parent is a redundant operation.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com
Link: https://lore.kernel.org/r/20230510035526.18137-2-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: Merge up fixes for CI
Mark Brown [Fri, 12 May 2023 04:14:20 +0000 (13:14 +0900)]
ASoC: Merge up fixes for CI

Avoid tripping over fixed issues in CI.

17 months agoASoC SSM3515 codec driver
Mark Brown [Fri, 12 May 2023 04:08:20 +0000 (13:08 +0900)]
ASoC SSM3515 codec driver

Merge series from Martin Povišer <povik+lin@cutebit.org>:

Analog Devices SSM3515 is a simple speaker amp that Apple is
using in their 2021 iMacs, possibly elsewhere.

17 months agoASoC: amd: yc: Add MECHREVO Jiaolong Series MRID6 into DMI table
Rsplwe [Thu, 11 May 2023 15:04:11 +0000 (23:04 +0800)]
ASoC: amd: yc: Add MECHREVO Jiaolong Series MRID6 into DMI table

This model requires an additional detection quirk to enable the internal microphone.

Signed-off-by: Rsplwe <i@rsplwe.com
Link: https://lore.kernel.org/r/tencent_3C6819728B6704C39A864762FB0BB77DF509@qq.com
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: dt-bindings: nau8825: Convert to dtschema
David Lin [Thu, 11 May 2023 11:36:08 +0000 (19:36 +0800)]
ASoC: dt-bindings: nau8825: Convert to dtschema

Convert the NAU8825 audio CODEC bindings to DT schema.

Signed-off-by: David Lin <CTLIN0@nuvoton.com
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org
Link: https://lore.kernel.org/r/20230511113607.595184-1-CTLIN0@nuvoton.com
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: ssm3515: Add new amp driver
Martin Povišer [Thu, 11 May 2023 15:05:46 +0000 (17:05 +0200)]
ASoC: ssm3515: Add new amp driver

The Analog Devices' SSM3515 is a mono audio amplifier with digital
input, equipped on Apple's 2021 iMacs. Add an ASoC driver for it, and
register both the driver code and schema in MAINTAINERS.

Signed-off-by: Martin Povišer <povik+lin@cutebit.org
Link: https://lore.kernel.org/r/20230511150546.8499-3-povik+lin@cutebit.org
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: dt-bindings: Add adi,ssm3515 amp schema
Martin Povišer [Thu, 11 May 2023 15:05:45 +0000 (17:05 +0200)]
ASoC: dt-bindings: Add adi,ssm3515 amp schema

Add a DT schema for the SSM3515 amp by Analog Devices. It's a simple
mono amplifier with digital input.

Signed-off-by: Martin Povišer <povik+lin@cutebit.org
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org
Link: https://lore.kernel.org/r/20230511150546.8499-2-povik+lin@cutebit.org
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: ssm2602: Add workaround for playback distortions
Paweł Anikiel [Mon, 8 May 2023 11:30:37 +0000 (13:30 +0200)]
ASoC: ssm2602: Add workaround for playback distortions

Apply a workaround for what appears to be a hardware quirk.

The problem seems to happen when enabling "whole chip power" (bit D7
register R6) for the very first time after the chip receives power. If
either "output" (D4) or "DAC" (D3) aren't powered on at that time,
playback becomes very distorted later on.

This happens on the Google Chameleon v3, as well as on a ZYBO Z7-10:
https://ez.analog.com/audio/f/q-a/543726/solved-ssm2603-right-output-offset-issue/480229
I suspect this happens only when using an external MCLK signal (which
is the case for both of these boards).

Here are some experiments run on a Google Chameleon v3. These were run
in userspace using a wrapper around the i2cset utility:
ssmset() {
        i2cset -y 0 0x1a $(($1*2)) $2
}

For each of the following sequences, we apply power to the ssm2603
chip, set the configuration registers R0-R5 and R7-R8, run the selected
sequence, and check for distortions on playback.

  ssmset 0x09 0x01 # core
  ssmset 0x06 0x07 # chip, out, dac
  OK

  ssmset 0x09 0x01 # core
  ssmset 0x06 0x87 # out, dac
  ssmset 0x06 0x07 # chip
  OK

  (disable MCLK)
  ssmset 0x09 0x01 # core
  ssmset 0x06 0x1f # chip
  ssmset 0x06 0x07 # out, dac
  (enable MCLK)
  OK

  ssmset 0x09 0x01 # core
  ssmset 0x06 0x1f # chip
  ssmset 0x06 0x07 # out, dac
  NOT OK

  ssmset 0x06 0x1f # chip
  ssmset 0x09 0x01 # core
  ssmset 0x06 0x07 # out, dac
  NOT OK

  ssmset 0x09 0x01 # core
  ssmset 0x06 0x0f # chip, out
  ssmset 0x06 0x07 # dac
  NOT OK

  ssmset 0x09 0x01 # core
  ssmset 0x06 0x17 # chip, dac
  ssmset 0x06 0x07 # out
  NOT OK

For each of the following sequences, we apply power to the ssm2603
chip, run the selected sequence, issue a reset with R15, configure
R0-R5 and R7-R8, run one of the NOT OK sequences from above, and check
for distortions.

  ssmset 0x09 0x01 # core
  ssmset 0x06 0x07 # chip, out, dac
  OK

  (disable MCLK)
  ssmset 0x09 0x01 # core
  ssmset 0x06 0x07 # chip, out, dac
  (enable MCLK after reset)
  NOT OK

  ssmset 0x09 0x01 # core
  ssmset 0x06 0x17 # chip, dac
  NOT OK

  ssmset 0x09 0x01 # core
  ssmset 0x06 0x0f # chip, out
  NOT OK

  ssmset 0x06 0x07 # chip, out, dac
  NOT OK

Signed-off-by: Paweł Anikiel <pan@semihalf.com
Link: https://lore.kernel.org/r/20230508113037.137627-8-pan@semihalf.com
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: qcom: add display port module support.
Mark Brown [Thu, 11 May 2023 06:01:27 +0000 (15:01 +0900)]
ASoC: qcom: add display port module support.

Merge series from Srinivas Kandagatla <srinivas.kandagatla@linaro.org>:

This patchset adds support to displayport on AudioReach.
Patches are tested on X13s with two display ports.

17 months agoASoC: ingenic: Add compatible string for X1000 SoC
Aidan MacDonald [Tue, 9 May 2023 12:42:37 +0000 (13:42 +0100)]
ASoC: ingenic: Add compatible string for X1000 SoC

The audio controller in the X1000 is similar to the JZ47xx SoCs.

Signed-off-by: Aidan MacDonald <aidanmacdonald.0x0@gmail.com
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org
Link: https://lore.kernel.org/r/20230509124238.195191-2-aidanmacdonald.0x0@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: jz4740-i2s: Add support for X1000 SoC
Aidan MacDonald [Tue, 9 May 2023 12:42:36 +0000 (13:42 +0100)]
ASoC: jz4740-i2s: Add support for X1000 SoC

The X1000's AIC is similar to the AIC found on other Ingenic SoCs.
It has symmetric playback/capture rates like the JZ4740, but more
flexible clocking when outputting the system or bit clocks.

Signed-off-by: Aidan MacDonald <aidanmacdonald.0x0@gmail.com
Link: https://lore.kernel.org/r/20230509124238.195191-1-aidanmacdonald.0x0@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: qcom: q6apm: add support to display ports in lpass dais
Srinivas Kandagatla [Tue, 9 May 2023 11:22:02 +0000 (12:22 +0100)]
ASoC: qcom: q6apm: add support to display ports in lpass dais

This patch adds support to q6apm lpass display port dais. This support
is required to get DP audio on x13s.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org
Link: https://lore.kernel.org/r/20230509112202.21471-5-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: qcom: q6dsp: add support to more display ports
Srinivas Kandagatla [Tue, 9 May 2023 11:22:01 +0000 (12:22 +0100)]
ASoC: qcom: q6dsp: add support to more display ports

Existing code base only supports one display port, this patch adds
support upto 8 display ports. This support is required to allow platforms
like X13s which have 3 display ports, and some of the Qualcomm SoCs
there are upto 7 Display ports.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org
Link: https://lore.kernel.org/r/20230509112202.21471-4-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: qcom: audioreach: add support for DISPLAY PORT SINK module
Srinivas Kandagatla [Tue, 9 May 2023 11:22:00 +0000 (12:22 +0100)]
ASoC: qcom: audioreach: add support for DISPLAY PORT SINK module

Add support for DISPLAY PORT SINK module and associated configuration.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org
Link: https://lore.kernel.org/r/20230509112202.21471-3-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: qcom: q6dsp-common: move channel allocation to common
Srinivas Kandagatla [Tue, 9 May 2023 11:21:59 +0000 (12:21 +0100)]
ASoC: qcom: q6dsp-common: move channel allocation to common

move hdmi/dp channel allocation to a common function
q6dsp_get_channel_allocation() so that we can reuse this across
q6afe and q6apm drivers.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org
Link: https://lore.kernel.org/r/20230509112202.21471-2-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: dt-bindings: Adjust #sound-dai-cells on TI's single-DAI codecs
Martin Povišer [Tue, 9 May 2023 15:34:12 +0000 (17:34 +0200)]
ASoC: dt-bindings: Adjust #sound-dai-cells on TI's single-DAI codecs

A bunch of TI's codecs have binding schemas which force #sound-dai-cells
to one despite those codecs only having a single DAI. Allow for bindings
with zero DAI cells and deprecate the former non-zero value.

Signed-off-by: Martin Povišer <povik+lin@cutebit.org
Link: https://lore.kernel.org/r/20230509153412.62847-1-povik+lin@cutebit.org
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: jz4740-i2s: Make I2S divider calculations more robust
Aidan MacDonald [Tue, 9 May 2023 12:51:34 +0000 (13:51 +0100)]
ASoC: jz4740-i2s: Make I2S divider calculations more robust

When the CPU supplies bit/frame clocks, the system clock (clk_i2s)
is divided to produce the bit clock. This is a simple 1/N divider
with a fairly limited range, so for a given system clock frequency
only a few sample rates can be produced. Usually a wider range of
sample rates is supported by varying the system clock frequency.

The old calculation method was not very robust and could easily
produce the wrong clock rate, especially with non-standard rates.
For example, if the system clock is 1.99x the target bit clock
rate, the divider would be calculated as 1 instead of the more
accurate 2.

Instead, use a more accurate method that considers two adjacent
divider settings and selects the one that produces the least error
versus the requested rate. If the error is 5% or higher then the
rate setting is rejected to prevent garbled audio.

Skip divider calculation when the codec is supplying both the bit
and frame clock; in that case, the divider outputs are unused and
we don't want to constrain the sample rate.

Signed-off-by: Aidan MacDonald <aidanmacdonald.0x0@gmail.com
Link: https://lore.kernel.org/r/20230509125134.208129-1-aidanmacdonald.0x0@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: add and use asoc_dummy_dlc
Mark Brown [Tue, 9 May 2023 09:31:38 +0000 (18:31 +0900)]
ASoC: add and use asoc_dummy_dlc

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

Many ASoC drivers are using dummy DAI.
I have 2 concern about it. 1st one is there is no guarantee that local
strings ("snd-soc-dummy-dai",  "snd-soc-dummy") are kept until the card
was binded if it was added at subfunction.
2nd one is we can use common snd_soc_dai_link_component for it.
This patch-set adds common asoc_dummy_dlc, and use it.

17 months agoASoC: rt722-sdca: Add RT722 SDCA driver
Jack Yu [Fri, 21 Apr 2023 03:01:16 +0000 (11:01 +0800)]
ASoC: rt722-sdca: Add RT722 SDCA driver

This is the initial codec driver for rt722-sdca.

Signed-off-by: Jack Yu <jack.yu@realtek.com
Link: https://lore.kernel.org/r/20230421030116.26245-1-jack.yu@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: MediaTek MT8195/86 Cleanups
Mark Brown [Tue, 9 May 2023 06:34:56 +0000 (15:34 +0900)]
ASoC: MediaTek MT8195/86 Cleanups

Merge series from AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>:

This series performs some cleanups for mainly MT8195 and switches
both MT8195 and MT8186's SOF driver to the snd_sof_ipc_process_reply()
helper.

17 months agoASoC: SOF: amd: Fix NULL pointer crash in acp_sof_ipc_msg_data function
V sujith kumar Reddy [Mon, 8 May 2023 07:05:08 +0000 (12:35 +0530)]
ASoC: SOF: amd: Fix NULL pointer crash in acp_sof_ipc_msg_data function

Check substream and runtime variables before assigning.

Signed-off-by: V sujith kumar Reddy <Vsujithkumar.Reddy@amd.com
Link: https://lore.kernel.org/r/20230508070510.6100-1-Vsujithkumar.Reddy@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: fsl_micfil: Fix error handler with pm_runtime_enable
Shengjiu Wang [Mon, 8 May 2023 10:16:36 +0000 (18:16 +0800)]
ASoC: fsl_micfil: Fix error handler with pm_runtime_enable

There is error message when defer probe happens:

fsl-micfil-dai 30ca0000.micfil: Unbalanced pm_runtime_enable!

Fix the error handler with pm_runtime_enable and add
fsl_micfil_remove() for pm_runtime_disable.

Fixes: 47a70e6fc9a8 ("ASoC: Add MICFIL SoC Digital Audio Interface driver.")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com
Link: https://lore.kernel.org/r/1683540996-6136-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: dwc: limit the number of overrun messages
Maxim Kochetkov [Fri, 5 May 2023 06:28:20 +0000 (09:28 +0300)]
ASoC: dwc: limit the number of overrun messages

On slow CPU (FPGA/QEMU emulated) printing overrun messages from
interrupt handler to uart console may leads to more overrun errors.
So use dev_err_ratelimited to limit the number of error messages.

Signed-off-by: Maxim Kochetkov <fido_max@inbox.ru
Link: https://lore.kernel.org/r/20230505062820.21840-1-fido_max@inbox.ru
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: amd: yc: Add DMI entry to support System76 Pangolin 12
Jeremy Soller [Fri, 5 May 2023 16:14:58 +0000 (10:14 -0600)]
ASoC: amd: yc: Add DMI entry to support System76 Pangolin 12

Add pang12 quirk to enable the internal microphone.

Signed-off-by: Jeremy Soller <jeremy@system76.com
Signed-off-by: Tim Crawford <tcrawford@system76.com
Link: https://lore.kernel.org/r/20230505161458.19676-1-tcrawford@system76.com
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: fsl_sai: MCLK bind with TX/RX enable bit
Shengjiu Wang [Fri, 5 May 2023 07:55:22 +0000 (15:55 +0800)]
ASoC: fsl_sai: MCLK bind with TX/RX enable bit

On i.MX8MP, the sai MCLK is bound with TX/RX enable bit,
which means the TX/RE enable bit need to be enabled then
MCLK can be output on PAD.

Some codec (for example: WM8962) needs the MCLK output
earlier, otherwise there will be issue for codec
configuration.

Add new soc data "mclk_with_tere" for this platform and
enable the MCLK output in startup stage.

As "mclk_with_tere" only applied to i.MX8MP, currently
The soc data is shared with i.MX8MN, so need to add
an i.MX8MN own soc data with "mclk_with_tere" disabled.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com
Link: https://lore.kernel.org/r/1683273322-2525-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: codecs: wcd938x: Remove unneeded semicolon
Yang Li [Fri, 5 May 2023 00:45:38 +0000 (08:45 +0800)]
ASoC: codecs: wcd938x: Remove unneeded semicolon

./sound/soc/codecs/wcd938x-sdw.c:1274:2-3: Unneeded semicolon

Reported-by: Abaci Robot <abaci@linux.alibaba.com
Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4862
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com
Link: https://lore.kernel.org/r/20230505004538.70270-1-yang.lee@linux.alibaba.com
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: dt-bindings: nau8540: Convert to dtschema
Anup Sharma [Sat, 6 May 2023 10:52:09 +0000 (16:22 +0530)]
ASoC: dt-bindings: nau8540: Convert to dtschema

Convert the NAU8540 audio CODEC bindings to DT schema

Signed-off-by: Anup Sharma <anupnewsmail@gmail.com
Changes:
V1 -> V2: Adhere to the correct procedure by including the maintainer's name.
          Drop Mark from maintainer.

Link: https://lore.kernel.org/r/ZFYxWVdE9YkMKvXv@yoga
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: amd: ps: refactor acp power on and reset functions.
Syed Saba Kareem [Wed, 26 Apr 2023 12:22:02 +0000 (17:52 +0530)]
ASoC: amd: ps: refactor acp power on and reset functions.

Instead of a busy waiting while loop using udelay in
acp63_power_on and acp63_reset functions use readl_poll_timeout
function to check the condition.

Signed-off-by: Syed Saba Kareem <Syed.SabaKareem@amd.com
Reviewed-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com
Link: https://lore.kernel.org/r/20230426122219.3745586-2-Syed.SabaKareem@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: amd: ps: remove the register read and write wrappers.
Syed Saba Kareem [Wed, 26 Apr 2023 12:22:01 +0000 (17:52 +0530)]
ASoC: amd: ps: remove the register read and write wrappers.

Instead of acp63_readl() and acp63_writel() wrappers
readl and writel functions can be used directly.
Remove acp63_readl() and acp63_writel() wrappers.

Signed-off-by: Syed Saba Kareem <Syed.SabaKareem@amd.com
Reviewed-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com
Link: https://lore.kernel.org/r/20230426122219.3745586-1-Syed.SabaKareem@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: Switch i2c drivers back to use .probe()
Uwe Kleine-König [Tue, 25 Apr 2023 09:57:16 +0000 (11:57 +0200)]
ASoC: Switch i2c drivers back to use .probe()

After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new()
call-back type"), all drivers being converted to .probe_new() and then
03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert
back to (the new) .probe() to be able to eventually drop .probe_new() from
struct i2c_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de
Link: https://lore.kernel.org/r/20230425095716.331419-1-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: amd: ps: Update copyright notice
Carlos Bilbao [Thu, 20 Apr 2023 18:02:12 +0000 (18:02 +0000)]
ASoC: amd: ps: Update copyright notice

The most recent changes to ASoC, such as new module parameters, date to the
year 2023. Update copyright statement accordingly.

Signed-off-by: Carlos Bilbao <carlos.bilbao@amd.com
Link: https://lore.kernel.org/r/20230420180212.3101178-1-carlos.bilbao@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: dwc: extend supported formats
Maxim Kochetkov [Fri, 5 May 2023 05:35:21 +0000 (08:35 +0300)]
ASoC: dwc: extend supported formats

The COMP1_TX_WORDSIZE_0/COMP2_RX_WORDSIZE_0 fields in the comp
registers indicate the maximum wordsize supported. DWC I2S controller
can operate with any smaller wordsize. So extend the formats to let
I2S to operate in any allowed modes.

Signed-off-by: Maxim Kochetkov <fido_max@inbox.ru
Link: https://lore.kernel.org/r/20230505053521.18233-1-fido_max@inbox.ru
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: rt5682: Use a maple tree based register cache
Mark Brown [Tue, 25 Apr 2023 17:22:46 +0000 (18:22 +0100)]
ASoC: rt5682: Use a maple tree based register cache

regmap has introduced a maple tree based register cache which makes use of
this more advanced data structure which has been added to the kernel
recently. Maple trees are much flatter than rbtrees, meaning that they do
not grow to such depths when the register map is sparse which makes access
a bit more efficient. The maple tree cache type is still a bit of a work
in progress but should be effective for some devices already.

RT5682 seems like a good candidate for maple tree. It only supports single
register read/write operations so will gain minimal benefit from storing
the register data in device native format like rbtree does (none for
SoundWire) and has some sparsity in the register map which is a good fit
for maple tree.

Convert to use maple tree. There should be little if any visible difference
at runtime.

Signed-off-by: Mark Brown <broonie@kernel.org
Link: https://lore.kernel.org/r/20230419-asoc-rt5682-maple-v1-1-ed40369c9099@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: dt-bindings: More dropping unneeded quotes
Rob Herring [Fri, 21 Apr 2023 21:48:10 +0000 (16:48 -0500)]
ASoC: dt-bindings: More dropping unneeded quotes

Another batch of dropping unneeded quotes on $id and $schema which were
missed in the last round. Once all these are fixed, checking for this can
be enabled in yamllint.

Signed-off-by: Rob Herring <robh@kernel.org
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org
Link: https://lore.kernel.org/r/20230421214810.1811962-1-robh@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: dt-bindings: google,sc7180-trogdor: allow up to four codec DAIs
Krzysztof Kozlowski [Sun, 7 May 2023 17:45:43 +0000 (19:45 +0200)]
ASoC: dt-bindings: google,sc7180-trogdor: allow up to four codec DAIs

SC7180 Trogdor sound cards come with multiple audio amplifiers, so allow
up to four of them to fix dtbs_check warnings like:

  sc7180-trogdor-homestar-r3.dtb: sound: dai-link@1:codec:sound-dai: [[275], [276], [277], [278]] is too long

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org
Acked-by: Conor Dooley <conor.dooley@microchip.com
Link: https://lore.kernel.org/r/20230507174543.264987-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: rt715: Use maple tree register cache
Mark Brown [Fri, 21 Apr 2023 16:35:46 +0000 (17:35 +0100)]
ASoC: rt715: Use maple tree register cache

regmap has introduced a maple tree based register cache which makes use of
this more advanced data structure which has been added to the kernel
recently. Maple trees are much flatter than rbtrees, meaning that they do
not grow to such depths when the register map is sparse which makes access
a bit more efficient. The maple tree cache type is still a bit of a work
in progress but should be effective for some devices already.

RT715 seems like a good candidate for maple tree. It is a SoundWire MBQ
device and therefore supports only single register read/write operations
which do not use raw I/O and will therefore save the cost of converting
to and from device native format when accessing the cache while not having
a negative impact from the current lack of bulk operations in maple tree
cache sync. It has a moderately large and quite sparse register map which
is a good fit for storing in a maple tree.

Convert to use maple tree. There should be little if any visible difference
at runtime.

Signed-off-by: Mark Brown <broonie@kernel.org
Link: https://lore.kernel.org/r/20230412-asoc-rt715-maple-v1-1-200a84835fde@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: dt-bindings: designware-i2s: add optional resets
Maxim Kochetkov [Thu, 4 May 2023 07:16:18 +0000 (10:16 +0300)]
ASoC: dt-bindings: designware-i2s: add optional resets

Some SoC may have resets for I2S subsystem. So add optional resets support.

Signed-off-by: Maxim Kochetkov <fido_max@inbox.ru
Link: https://lore.kernel.org/r/20230504071618.52012-2-fido_max@inbox.ru
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: dwc: add optional reset support
Maxim Kochetkov [Thu, 4 May 2023 07:16:17 +0000 (10:16 +0300)]
ASoC: dwc: add optional reset support

Some SoC may have resets for I2S subsystem. So add optional reset support.

Signed-off-by: Maxim Kochetkov <fido_max@inbox.ru
Link: https://lore.kernel.org/r/20230504071618.52012-1-fido_max@inbox.ru
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: mediatek: mt8195-afe-pcm: Simplify with dev_err_probe()
AngeloGioacchino Del Regno [Wed, 3 May 2023 11:34:12 +0000 (13:34 +0200)]
ASoC: mediatek: mt8195-afe-pcm: Simplify with dev_err_probe()

Shorten the probe function by switching to dev_err_probe() where
possible.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com
Link: https://lore.kernel.org/r/20230503113413.149235-5-angelogioacchino.delregno@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: mediatek: mt8195-afe-pcm: Simplify runtime PM during probe
AngeloGioacchino Del Regno [Wed, 3 May 2023 11:34:11 +0000 (13:34 +0200)]
ASoC: mediatek: mt8195-afe-pcm: Simplify runtime PM during probe

Use devm_pm_runtime_enable() and pm_runtime_resume_and_get() to
to simplify the probe function.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com
Link: https://lore.kernel.org/r/20230503113413.149235-4-angelogioacchino.delregno@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: mediatek: mt8195-afe-pcm: Clean up unnecessary functions
AngeloGioacchino Del Regno [Wed, 3 May 2023 11:34:13 +0000 (13:34 +0200)]
ASoC: mediatek: mt8195-afe-pcm: Clean up unnecessary functions

Function mt8195_afe_init_registers() performs just a single call to
regmap_multi_reg_write(), it returns int and it's not error checked;
move that call to the probe function and also add some error check.

While at it, also move the contents of mt8195_afe_parse_of() to the
probe function as well: since this is getting a handle to topckgen
and since that's optional, the ifdef for CONFIG_SND_SOC_MT6359 can
also be removed.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com
Acked-by: Trevor Wu <trevor.wu@mediatek.com
Link: https://lore.kernel.org/r/20230503113413.149235-6-angelogioacchino.delregno@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: SOF: mediatek: mt8186: Use snd_sof_ipc_process_reply() helper
AngeloGioacchino Del Regno [Wed, 3 May 2023 11:34:10 +0000 (13:34 +0200)]
ASoC: SOF: mediatek: mt8186: Use snd_sof_ipc_process_reply() helper

Function mt8186_get_reply() performs practically the same operation
as the common snd_sof_ipc_get_reply() helper: removing the custom
function allows us to simply perform a call to the sof-priv helper
snd_sof_ipc_process_reply(), simplifying and shortening this driver
and getting all the benefits of using a common API.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com
Link: https://lore.kernel.org/r/20230503113413.149235-3-angelogioacchino.delregno@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: SOF: mediatek: mt8195: Use snd_sof_ipc_process_reply() helper
AngeloGioacchino Del Regno [Wed, 3 May 2023 11:34:09 +0000 (13:34 +0200)]
ASoC: SOF: mediatek: mt8195: Use snd_sof_ipc_process_reply() helper

Function mt8195_get_reply() performs practically the same operation
as the common snd_sof_ipc_get_reply() helper: removing the custom
function allows us to simply perform a call to the sof-priv helper
snd_sof_ipc_process_reply(), simplifying and shortening this driver
and getting all the benefits of using a common API.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com
Link: https://lore.kernel.org/r/20230503113413.149235-2-angelogioacchino.delregno@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: soc-topology.c: add comment for Platform/Codec
Kuninori Morimoto [Mon, 24 Apr 2023 02:37:38 +0000 (02:37 +0000)]
ASoC: soc-topology.c: add comment for Platform/Codec

Not only Platform but Codec also might be overwritten on Topology.
This patch adds comment about it not to use asoc_dummy_dlc here.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com
Link: https://lore.kernel.org/r/87sfcqyphq.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: simple_card_utils.c: use asoc_dummy_dlc
Kuninori Morimoto [Mon, 24 Apr 2023 02:37:24 +0000 (02:37 +0000)]
ASoC: simple_card_utils.c: use asoc_dummy_dlc

Now we can share asoc_dummy_dlc. This patch use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com
Link: https://lore.kernel.org/r/87ttx6ypi3.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: intel: skylake: use asoc_dummy_dlc
Kuninori Morimoto [Mon, 24 Apr 2023 02:37:17 +0000 (02:37 +0000)]
ASoC: intel: skylake: use asoc_dummy_dlc

Now we can share asoc_dummy_dlc. This patch use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com
Link: https://lore.kernel.org/r/87v8hmypia.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: intel: sof: use asoc_dummy_dlc
Kuninori Morimoto [Mon, 24 Apr 2023 02:37:11 +0000 (02:37 +0000)]
ASoC: intel: sof: use asoc_dummy_dlc

Now we can share asoc_dummy_dlc. This patch use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com
Link: https://lore.kernel.org/r/87wn22ypig.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: intel: avs: use asoc_dummy_dlc
Kuninori Morimoto [Mon, 24 Apr 2023 02:37:06 +0000 (02:37 +0000)]
ASoC: intel: avs: use asoc_dummy_dlc

Now we can share asoc_dummy_dlc. This patch use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com
Link: https://lore.kernel.org/r/87y1miypim.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: meson: use asoc_dummy_dlc
Kuninori Morimoto [Mon, 24 Apr 2023 02:36:59 +0000 (02:36 +0000)]
ASoC: meson: use asoc_dummy_dlc

Now we can share asoc_dummy_dlc. This patch use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com
Link: https://lore.kernel.org/r/87zg6yypit.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: atmel: use asoc_dummy_dlc
Kuninori Morimoto [Mon, 24 Apr 2023 02:36:52 +0000 (02:36 +0000)]
ASoC: atmel: use asoc_dummy_dlc

Now we can share asoc_dummy_dlc. This patch use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com
Link: https://lore.kernel.org/r/871qka0zwb.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: qcom: use asoc_dummy_dlc
Kuninori Morimoto [Mon, 24 Apr 2023 02:36:44 +0000 (02:36 +0000)]
ASoC: qcom: use asoc_dummy_dlc

Now we can share asoc_dummy_dlc. This patch use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com
Link: https://lore.kernel.org/r/87354q0zwj.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: fsl: use asoc_dummy_dlc
Kuninori Morimoto [Mon, 24 Apr 2023 02:36:37 +0000 (02:36 +0000)]
ASoC: fsl: use asoc_dummy_dlc

Now we can share asoc_dummy_dlc. This patch use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com
Link: https://lore.kernel.org/r/874jp60zwq.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: amd: use asoc_dummy_dlc
Kuninori Morimoto [Mon, 24 Apr 2023 02:36:28 +0000 (02:36 +0000)]
ASoC: amd: use asoc_dummy_dlc

Now we can share asoc_dummy_dlc. This patch use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com
Link: https://lore.kernel.org/r/875y9m0zwz.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: sof: use asoc_dummy_dlc
Kuninori Morimoto [Mon, 24 Apr 2023 02:36:19 +0000 (02:36 +0000)]
ASoC: sof: use asoc_dummy_dlc

Now we can share asoc_dummy_dlc. This patch use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com
Link: https://lore.kernel.org/r/877cu20zx8.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: ti: use asoc_dummy_dlc
Kuninori Morimoto [Mon, 24 Apr 2023 02:36:04 +0000 (02:36 +0000)]
ASoC: ti: use asoc_dummy_dlc

Now we can share asoc_dummy_dlc. This patch use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com
Link: https://lore.kernel.org/r/878rei0zxn.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoASoC: soc-utils.c: add asoc_dummy_dlc
Kuninori Morimoto [Mon, 24 Apr 2023 02:35:32 +0000 (02:35 +0000)]
ASoC: soc-utils.c: add asoc_dummy_dlc

ASoC uses dummy Component, sharing snd_soc_dai_link_component
for it is better idea. This patch adds it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com
Link: https://lore.kernel.org/r/87a5yy0zyk.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org
17 months agoLinux 6.4-rc1
Linus Torvalds [Sun, 7 May 2023 20:34:35 +0000 (13:34 -0700)]
Linux 6.4-rc1

17 months agoMerge tag 'perf-tools-for-v6.4-3-2023-05-06' of git://git.kernel.org/pub/scm/linux...
Linus Torvalds [Sun, 7 May 2023 18:32:18 +0000 (11:32 -0700)]
Merge tag 'perf-tools-for-v6.4-3-2023-05-06' of git://git./linux/kernel/git/acme/linux

Pull perf tool updates from Arnaldo Carvalho de Melo:
 "Third version of perf tool updates, with the build problems with with
  using a 'vmlinux.h' generated from the main build fixed, and the bpf
  skeleton build disabled by default.

  Build:

   - Require libtraceevent to build, one can disable it using
     NO_LIBTRACEEVENT=1.

     It is required for tools like 'perf sched', 'perf kvm', 'perf
     trace', etc.

     libtraceevent is available in most distros so installing
     'libtraceevent-devel' should be a one-time event to continue
     building perf as usual.

     Using NO_LIBTRACEEVENT=1 produces tooling that is functional and
     sufficient for lots of users not interested in those libtraceevent
     dependent features.

   - Allow Python support in 'perf script' when libtraceevent isn't
     linked, as not all features requires it, for instance Intel PT does
     not use tracepoints.

   - Error if the python interpreter needed for jevents to work isn't
     available and NO_JEVENTS=1 isn't set, preventing a build without
     support for JSON vendor events, which is a rare but possible
     condition. The two check error messages:

        $(error ERROR: No python interpreter needed for jevents generation. Install python or build with NO_JEVENTS=1.)
        $(error ERROR: Python interpreter needed for jevents generation too old (older than 3.6). Install a newer python or build with NO_JEVENTS=1.)

   - Make libbpf 1.0 the minimum required when building with out of
     tree, distro provided libbpf.

   - Use libsdtc++'s and LLVM's libcxx's __cxa_demangle, a portable C++
     demangler, add 'perf test' entry for it.

   - Make binutils libraries opt in, as distros disable building with it
     due to licensing, they were used for C++ demangling, for instance.

   - Switch libpfm4 to opt-out rather than opt-in, if libpfm-devel (or
     equivalent) isn't installed, we'll just have a build warning:

       Makefile.config:1144: libpfm4 not found, disables libpfm4 support. Please install libpfm4-dev

   - Add a feature test for scandirat(), that is not implemented so far
     in musl and uclibc, disabling features that need it, such as
     scanning for tracepoints in /sys/kernel/tracing/events.

  perf BPF filters:

   - New feature where BPF can be used to filter samples, for instance:

      $ sudo ./perf record -e cycles --filter 'period > 1000' true
      $ sudo ./perf script
           perf-exec 2273949 546850.708501:       5029 cycles:  ffffffff826f9e25 finish_wait+0x5 ([kernel.kallsyms])
           perf-exec 2273949 546850.708508:      32409 cycles:  ffffffff826f9e25 finish_wait+0x5 ([kernel.kallsyms])
           perf-exec 2273949 546850.708526:     143369 cycles:  ffffffff82b4cdbf xas_start+0x5f ([kernel.kallsyms])
           perf-exec 2273949 546850.708600:     372650 cycles:  ffffffff8286b8f7 __pagevec_lru_add+0x117 ([kernel.kallsyms])
           perf-exec 2273949 546850.708791:     482953 cycles:  ffffffff829190de __mod_memcg_lruvec_state+0x4e ([kernel.kallsyms])
                true 2273949 546850.709036:     501985 cycles:  ffffffff828add7c tlb_gather_mmu+0x4c ([kernel.kallsyms])
                true 2273949 546850.709292:     503065 cycles:      7f2446d97c03 _dl_map_object_deps+0x973 (/usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2)

   - In addition to 'period' (PERF_SAMPLE_PERIOD), the other
     PERF_SAMPLE_ can be used for filtering, and also some other sample
     accessible values, from tools/perf/Documentation/perf-record.txt:

        Essentially the BPF filter expression is:

        <term> <operator> <value> (("," | "||") <term> <operator> <value>)*

     The <term> can be one of:
        ip, id, tid, pid, cpu, time, addr, period, txn, weight, phys_addr,
        code_pgsz, data_pgsz, weight1, weight2, weight3, ins_lat, retire_lat,
        p_stage_cyc, mem_op, mem_lvl, mem_snoop, mem_remote, mem_lock,
        mem_dtlb, mem_blk, mem_hops

     The <operator> can be one of:
        ==, !=, >, >=, <, <=, &

     The <value> can be one of:
        <number> (for any term)
        na, load, store, pfetch, exec (for mem_op)
        l1, l2, l3, l4, cxl, io, any_cache, lfb, ram, pmem (for mem_lvl)
        na, none, hit, miss, hitm, fwd, peer (for mem_snoop)
        remote (for mem_remote)
        na, locked (for mem_locked)
        na, l1_hit, l1_miss, l2_hit, l2_miss, any_hit, any_miss, walk, fault (for mem_dtlb)
        na, by_data, by_addr (for mem_blk)
        hops0, hops1, hops2, hops3 (for mem_hops)

  perf lock contention:

   - Show lock type with address.

   - Track and show mmap_lock, siglock and per-cpu rq_lock with address.
     This is done for mmap_lock by following the current->mm pointer:

      $ sudo ./perf lock con -abl -- sleep 10
       contended   total wait     max wait     avg wait            address   symbol
       ...
           16344    312.30 ms      2.22 ms     19.11 us   ffff8cc702595640
           17686    310.08 ms      1.49 ms     17.53 us   ffff8cc7025952c0
               3     84.14 ms     45.79 ms     28.05 ms   ffff8cc78114c478   mmap_lock
            3557     76.80 ms     68.75 us     21.59 us   ffff8cc77ca3af58
               1     68.27 ms     68.27 ms     68.27 ms   ffff8cda745dfd70
               9     54.53 ms      7.96 ms      6.06 ms   ffff8cc7642a48b8   mmap_lock
           14629     44.01 ms     60.00 us      3.01 us   ffff8cc7625f9ca0
            3481     42.63 ms    140.71 us     12.24 us   ffffffff937906ac   vmap_area_lock
           16194     38.73 ms     42.15 us      2.39 us   ffff8cd397cbc560
              11     38.44 ms     10.39 ms      3.49 ms   ffff8ccd6d12fbb8   mmap_lock
               1      5.43 ms      5.43 ms      5.43 ms   ffff8cd70018f0d8
            1674      5.38 ms    422.93 us      3.21 us   ffffffff92e06080   tasklist_lock
             581      4.51 ms    130.68 us      7.75 us   ffff8cc9b1259058
               5      3.52 ms      1.27 ms    703.23 us   ffff8cc754510070
             112      3.47 ms     56.47 us     31.02 us   ffff8ccee38b3120
             381      3.31 ms     73.44 us      8.69 us   ffffffff93790690   purge_vmap_area_lock
             255      3.19 ms     36.35 us     12.49 us   ffff8d053ce30c80

   - Update default map size to 16384.

   - Allocate single letter option -M for --map-nr-entries, as it is
     proving being frequently used.

   - Fix struct rq lock access for older kernels with BPF's CO-RE
     (Compile once, run everywhere).

   - Fix problems found with MSAn.

  perf report/top:

   - Add inline information when using --call-graph=fp or lbr, as was
     already done to the --call-graph=dwarf callchain mode.

   - Improve the 'srcfile' sort key performance by really using an
     optimization introduced in 6.2 for the 'srcline' sort key that
     avoids calling addr2line for comparision with each sample.

  perf sched:

   - Make 'perf sched latency/map/replay' to use "sched:sched_waking"
     instead of "sched:sched_waking", consistent with 'perf record'
     since d566a9c2d482 ("perf sched: Prefer sched_waking event when it
     exists").

  perf ftrace:

   - Make system wide the default target for latency subcommand, run the
     following command then generate some network traffic and press
     control+C:

       # perf ftrace latency -T __kfree_skb
     ^C
         DURATION     |      COUNT | GRAPH                                          |
          0 - 1    us |         27 | #############                                  |
          1 - 2    us |         22 | ###########                                    |
          2 - 4    us |          8 | ####                                           |
          4 - 8    us |          5 | ##                                             |
          8 - 16   us |         24 | ############                                   |
         16 - 32   us |          2 | #                                              |
         32 - 64   us |          1 |                                                |
         64 - 128  us |          0 |                                                |
        128 - 256  us |          0 |                                                |
        256 - 512  us |          0 |                                                |
        512 - 1024 us |          0 |                                                |
          1 - 2    ms |          0 |                                                |
          2 - 4    ms |          0 |                                                |
          4 - 8    ms |          0 |                                                |
          8 - 16   ms |          0 |                                                |
         16 - 32   ms |          0 |                                                |
         32 - 64   ms |          0 |                                                |
         64 - 128  ms |          0 |                                                |
        128 - 256  ms |          0 |                                                |
        256 - 512  ms |          0 |                                                |
        512 - 1024 ms |          0 |                                                |
          1 - ...   s |          0 |                                                |
       #

  perf top:

   - Add --branch-history (LBR: Last Branch Record) option, just like
     already available for 'perf record'.

   - Fix segfault in thread__comm_len() where thread->comm was being
     used outside thread->comm_lock.

  perf annotate:

   - Allow configuring objdump and addr2line in ~/.perfconfig., so that
     you can use alternative binaries, such as llvm's.

  perf kvm:

   - Add TUI mode for 'perf kvm stat report'.

  Reference counting:

   - Add reference count checking infrastructure to check for use after
     free, done to the 'cpumap', 'namespaces', 'maps' and 'map' structs,
     more to come.

     To build with it use -DREFCNT_CHECKING=1 in the make command line
     to build tools/perf. Documented at:

       https://perf.wiki.kernel.org/index.php/Reference_Count_Checking

   - The above caught, for instance, fix, present in this series:

        - Fix maps use after put in 'perf test "Share thread maps"':

          'maps' is copied from leader, but the leader is put on line 79
          and then 'maps' is used to read the reference count below - so
          a use after put, with the put of maps happening within
          thread__put.

     Fixed by reversing the order of puts so that the leader is put
     last.

   - Also several fixes were made to places where reference counts were
     not being held.

   - Make this one of the tests in 'make -C tools/perf build-test' to
     regularly build test it and to make sure no direct access to the
     reference counted structs are made, doing that via accessors to
     check the validity of the struct pointer.

  ARM64:

   - Fix 'perf report' segfault when filtering coresight traces by
     sparse lists of CPUs.

   - Add support for 'simd' as a sort field for 'perf report', to show
     ARM's NEON SIMD's predicate flags: "partial" and "empty".

  arm64 vendor events:

   - Add N1 metrics.

  Intel vendor events:

   - Add graniterapids, grandridge and sierraforrest events.

   - Refresh events for: alderlake, aldernaken, broadwell, broadwellde,
     broadwellx, cascadelakx, haswell, haswellx, icelake, icelakex,
     jaketown, meteorlake, knightslanding, sandybridge, sapphirerapids,
     silvermont, skylake, tigerlake and westmereep-dp

   - Refresh metrics for alderlake-n, broadwell, broadwellde,
     broadwellx, haswell, haswellx, icelakex, ivybridge, ivytown and
     skylakex.

  perf stat:

   - Implement --topdown using JSON metrics.

   - Add TopdownL1 JSON metric as a default if present, but disable it
     for now for some Intel hybrid architectures, a series of patches
     addressing this is being reviewed and will be submitted for v6.5.

   - Use metrics for --smi-cost.

   - Update topdown documentation.

  Vendor events (JSON) infrastructure:

   - Add support for computing and printing metric threshold values. For
     instance, here is one found in thesapphirerapids json file:

       {
           "BriefDescription": "Percentage of cycles spent in System Management Interrupts.",
           "MetricExpr": "((msr@aperf@ - cycles) / msr@aperf@ if msr@smi@ > 0 else 0)",
           "MetricGroup": "smi",
           "MetricName": "smi_cycles",
           "MetricThreshold": "smi_cycles > 0.1",
           "ScaleUnit": "100%"
       },

   - Test parsing metric thresholds with the fake PMU in 'perf test
     pmu-events'.

   - Support for printing metric thresholds in 'perf list'.

   - Add --metric-no-threshold option to 'perf stat'.

   - Add rand (reverse and) and has_pmem (optane memory) support to
     metrics.

   - Sort list of input files to avoid depending on the order from
     readdir() helping in obtaining reproducible builds.

  S/390:

   - Add common metrics: - CPI (cycles per instruction), prbstate (ratio
     of instructions executed in problem state compared to total number
     of instructions), l1mp (Level one instruction and data cache misses
     per 100 instructions).

   - Add cache metrics for z13, z14, z15 and z16.

   - Add metric for TLB and cache.

  ARM:

   - Add raw decoding for SPE (Statistical Profiling Extension) v1.3 MTE
     (Memory Tagging Extension) and MOPS (Memory Operations) load/store.

  Intel PT hardware tracing:

   - Add event type names UINTR (User interrupt delivered) and UIRET
     (Exiting from user interrupt routine), documented in table 32-50
     "CFE Packet Type and Vector Fields Details" in the Intel Processor
     Trace chapter of The Intel SDM Volume 3 version 078.

   - Add support for new branch instructions ERETS and ERETU.

   - Fix CYC timestamps after standalone CBR

  ARM CoreSight hardware tracing:

   - Allow user to override timestamp and contextid settings.

   - Fix segfault in dso lookup.

   - Fix timeless decode mode detection.

   - Add separate decode paths for timeless and per-thread modes.

  auxtrace:

   - Fix address filter entire kernel size.

  Miscellaneous:

   - Fix use-after-free and unaligned bugs in the PLT handling routines.

   - Use zfree() to reduce chances of use after free.

   - Add missing 0x prefix for addresses printed in hexadecimal in 'perf
     probe'.

   - Suppress massive unsupported target platform errors in the unwind
     code.

   - Fix return incorrect build_id size in elf_read_build_id().

   - Fix 'perf scripts intel-pt-events.py' IPC output for Python 2 .

   - Add missing new parameter in kfree_skb tracepoint to the python
     scripts using it.

   - Add 'perf bench syscall fork' benchmark.

   - Add support for printing PERF_MEM_LVLNUM_UNC (Uncached access) in
     'perf mem'.

   - Fix wrong size expectation for perf test 'Setup struct
     perf_event_attr' caused by the patch adding
     perf_event_attr::config3.

   - Fix some spelling mistakes"

* tag 'perf-tools-for-v6.4-3-2023-05-06' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux: (365 commits)
  Revert "perf build: Make BUILD_BPF_SKEL default, rename to NO_BPF_SKEL"
  Revert "perf build: Warn for BPF skeletons if endian mismatches"
  perf metrics: Fix SEGV with --for-each-cgroup
  perf bpf skels: Stop using vmlinux.h generated from BTF, use subset of used structs + CO-RE
  perf stat: Separate bperf from bpf_profiler
  perf test record+probe_libc_inet_pton: Fix call chain match on x86_64
  perf test record+probe_libc_inet_pton: Fix call chain match on s390
  perf tracepoint: Fix memory leak in is_valid_tracepoint()
  perf cs-etm: Add fix for coresight trace for any range of CPUs
  perf build: Fix unescaped # in perf build-test
  perf unwind: Suppress massive unsupported target platform errors
  perf script: Add new parameter in kfree_skb tracepoint to the python scripts using it
  perf script: Print raw ip instead of binary offset for callchain
  perf symbols: Fix return incorrect build_id size in elf_read_build_id()
  perf list: Modify the warning message about scandirat(3)
  perf list: Fix memory leaks in print_tracepoint_events()
  perf lock contention: Rework offset calculation with BPF CO-RE
  perf lock contention: Fix struct rq lock access
  perf stat: Disable TopdownL1 on hybrid
  perf stat: Avoid SEGV on counter->name
  ...

17 months agoMerge tag 'core-debugobjects-2023-05-06' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sun, 7 May 2023 18:04:26 +0000 (11:04 -0700)]
Merge tag 'core-debugobjects-2023-05-06' of git://git./linux/kernel/git/tip/tip

Pull debugobjects fix from Thomas Gleixner:
 "A single fix for debugobjects:

  The recent fix to ensure atomicity of lookup and allocation
  inadvertently broke the pool refill mechanism, so that debugobject
  OOMs now in certain situations. The reason is that the functions which
  got updated no longer invoke debug_objecs_init(), which is now the
  only place to care about refilling the tracking object pool.

  Restore the original behaviour by adding explicit refill opportunities
  to those places"

* tag 'core-debugobjects-2023-05-06' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  debugobject: Ensure pool refill (again)

17 months agoMerge tag 'v6.4-p2' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Linus Torvalds [Sun, 7 May 2023 17:57:14 +0000 (10:57 -0700)]
Merge tag 'v6.4-p2' of git://git./linux/kernel/git/herbert/crypto-2.6

Pull crypto fixes from Herbert Xu:

 - A long-standing bug in crypto_engine

 - A buggy but harmless check in the sun8i-ss driver

 - A regression in the CRYPTO_USER interface

* tag 'v6.4-p2' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
  crypto: api - Fix CRYPTO_USER checks for report function
  crypto: engine - fix crypto_queue backlog handling
  crypto: sun8i-ss - Fix a test in sun8i_ss_setup_ivs()

17 months agoMerge tag '6.4-rc-smb3-client-fixes-part2' of git://git.samba.org/sfrench/cifs-2.6
Linus Torvalds [Sun, 7 May 2023 17:46:21 +0000 (10:46 -0700)]
Merge tag '6.4-rc-smb3-client-fixes-part2' of git://git.samba.org/sfrench/cifs-2.6

Pull cifs fixes from Steve French:
 "smb3 client fixes, mostly DFS or reconnect related:

   - Two DFS connection sharing fixes

   - DFS refresh fix

   - Reconnect fix

   - Two potential use after free fixes

   - Also print prefix patch in mount debug msg

   - Two small cleanup fixes"

* tag '6.4-rc-smb3-client-fixes-part2' of git://git.samba.org/sfrench/cifs-2.6:
  cifs: Remove unneeded semicolon
  cifs: fix sharing of DFS connections
  cifs: avoid potential races when handling multiple dfs tcons
  cifs: protect access of TCP_Server_Info::{origin,leaf}_fullpath
  cifs: fix potential race when tree connecting ipc
  cifs: fix potential use-after-free bugs in TCP_Server_Info::hostname
  cifs: print smb3_fs_context::source when mounting
  cifs: protect session status check in smb2_reconnect()
  SMB3.1.1: correct definition for app_instance_id create contexts

17 months agoMerge tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux
Linus Torvalds [Sun, 7 May 2023 17:31:45 +0000 (10:31 -0700)]
Merge tag 'clk-for-linus' of git://git./linux/kernel/git/clk/linux

Pull clk fixes from Stephen Boyd:
 "A couple more patches that would be good to get into -rc1:

   - Revert an i.MX patch that's causing video failures because division
     math goes sideways

   - Fix a clang + W=1 build isue where FIELD_PREP() is taking a 32-bit
     variable instead of the usual u64 type

   - Fix a Kconfig bug in the StarFive JH7110 clk config that selects a
     reset controller when it can't be selected"

* tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux:
  clk: starfive: Fix RESET_STARFIVE_JH7110 can't be selected in a specified case
  clk: sp7021: Adjust width of _m in HWM_FIELD_PREP()
  Revert "clk: imx: composite-8m: Add support to determine_rate"

17 months agoMerge tag 'mailbox-v6.4' of git://git.linaro.org/landing-teams/working/fujitsu/integr...
Linus Torvalds [Sun, 7 May 2023 17:17:33 +0000 (10:17 -0700)]
Merge tag 'mailbox-v6.4' of git://git.linaro.org/landing-teams/working/fujitsu/integration

Pull mailbox updates from Jassi Brar:

 - mailbox api: allow direct registration to a channel and convert omap
   and pcc to use mbox_bind_client

 - omap and hi6220 : use of_property_read_bool

 - test: fix double-free and use spinlock header

 - rockchip and bcm-pdc: drop of_match_ptr

 - mpfs: change config symbol

 - mediatek gce: support MT6795

 - qcom apcs: consolidate of_device_id and support IPQ9574

* tag 'mailbox-v6.4' of git://git.linaro.org/landing-teams/working/fujitsu/integration:
  dt-bindings: mailbox: qcom: add compatible for IPQ9574 SoC
  mailbox: qcom-apcs-ipc: do not grow the of_device_id
  dt-bindings: mailbox: qcom,apcs-kpss-global: use fallbacks for few variants
  dt-bindings: mailbox: mediatek,gce-mailbox: Add support for MT6795
  mailbox: mpfs: convert SOC_MICROCHIP_POLARFIRE to ARCH_MICROCHIP_POLARFIRE
  mailbox: bcm-pdc: drop of_match_ptr for ID table
  mailbox: rockchip: drop of_match_ptr for ID table
  mailbox: mailbox-test: Fix potential double-free in mbox_test_message_write()
  mailbox: mailbox-test: Explicitly include header for spinlock support
  mailbox: Use of_property_read_bool() for boolean properties
  mailbox: pcc: Use mbox_bind_client
  mailbox: omap: Use mbox_bind_client
  mailbox: Allow direct registration to a channel