platform/kernel/linux-starfive.git
13 months agoASoC: codecs: wsa883x: use existing define instead of raw value
Krzysztof Kozlowski [Wed, 7 Jun 2023 17:13:26 +0000 (19:13 +0200)]
ASoC: codecs: wsa883x: use existing define instead of raw value

Use existing define for WSA883X_GLOBAL_PA_ENABLE instead of hard-coded
value, just like in other places in this driver.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230607171326.179527-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Intel: HDA: two cleanups
Mark Brown [Wed, 7 Jun 2023 17:22:08 +0000 (18:22 +0100)]
ASoC: Intel: HDA: two cleanups

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

One removal of a non-existent Kconfig initialization and one
correction to enable SoundWire link when no HDaudio external codec is
detected. This will generate more information and help resolve cases
where the ACPI information is incorrect.

13 months agoASoC: mediatek: mt8188-mt6359: add i2c dependency
Arnd Bergmann [Wed, 7 Jun 2023 12:08:15 +0000 (14:08 +0200)]
ASoC: mediatek: mt8188-mt6359: add i2c dependency

The newly added driver is missing this dependency, causing a possible
build failure:

WARNING: unmet direct dependencies detected for SND_SOC_MAX98390
WARNING: unmet direct dependencies detected for SND_SOC_NAU8825
  Depends on [m]: SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && I2C [=m]
  Selected by [y]:
  - SND_SOC_MT8188_MT6359 [=y] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && SND_SOC_MT8188 [=y] && MTK_PMIC_WRAP [=y]
aarch64-linux-ld: sound/soc/codecs/max98390.o: in function `max98390_i2c_probe':
max98390.c:(.text+0x514): undefined reference to `__devm_regmap_init_i2c'

Fixes: 9f08dcbddeb30 ("ASoC: mediatek: mt8188-mt6359: support new board with nau88255")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20230607120831.3587379-1-arnd@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: SOF: Intel: hda-pcm: remove kernel parameter init
Pierre-Louis Bossart [Tue, 6 Jun 2023 22:25:29 +0000 (17:25 -0500)]
ASoC: SOF: Intel: hda-pcm: remove kernel parameter init

The 'hda_disable_rewinds' kernel parameter is initialized with a
non-existent CONFIG_SND_SOC_SOF_HDA_DISABLE_REWINDS.

We probably forgot to clean this up when this Kconfig option was
removed when upstreaming in 2021.

Reported-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: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230606222529.57156-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: SOF: Intel: fix SoundWire/HDaudio mutual exclusion
Pierre-Louis Bossart [Tue, 6 Jun 2023 22:25:28 +0000 (17:25 -0500)]
ASoC: SOF: Intel: fix SoundWire/HDaudio mutual exclusion

The functionality described in Commit 61bef9e68dca ("ASoC: SOF: Intel: hda: enforce exclusion between HDaudio and SoundWire")
does not seem to be properly implemented with two issues that need to
be corrected.

a) The test used is incorrect when DisplayAudio codecs are not supported.

b) Conversely when only Display Audio codecs can be found, we do want
to start the SoundWire links, if any. That will help add the relevant
topologies and machine descriptors, and identify cases where the
SoundWire information in ACPI needs to be modified with a quirk.

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/20230606222529.57156-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: add snd_soc_get_stream_cpu()
Kuninori Morimoto [Thu, 1 Jun 2023 00:42:49 +0000 (00:42 +0000)]
ASoC: add snd_soc_get_stream_cpu()

We are using get_stream_cpu() to get CPU stream which cares
Codec2Codec. But it is static function for now, and we want to use it
from other files. This patch makes it global function.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87fs7cj9mf.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: soc.h: remove snd_soc_compr_ops :: trigger
Kuninori Morimoto [Thu, 1 Jun 2023 00:43:02 +0000 (00:43 +0000)]
ASoC: soc.h: remove snd_soc_compr_ops :: trigger

ASoC framework is not using trigger call-back for snd_soc_compr_ops.
This patch remove it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87edmwj9m1.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Intel: machine driver updates for 6.5
Mark Brown [Tue, 6 Jun 2023 15:41:59 +0000 (16:41 +0100)]
ASoC: Intel: machine driver updates for 6.5

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

An unusually large set of patches to deal with new SoundWire-based
platforms.

The bulk of the patches addresses support for MTL using RT712, RT713,
MAX98363, CS42L42 jack codec and amplifiers. The sof_sdw machine
driver had to be updated to remove limitations on number of codecs per
links, dai types, dai naming, etc. We also moved parts of the Realtek
and Maxim support in common code to avoid duplication.

Community users also reported two Dell SKUs which were not supported
in the mainline due to hardware permutations.

13 months agoASoC: mt8188: add new board support
Mark Brown [Mon, 5 Jun 2023 17:29:36 +0000 (18:29 +0100)]
ASoC: mt8188: add new board support

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

In the series, we extend the capability of mt8188-mt6359 driver.

The following changes are included.
1. Divide ADDA BE dai into two dais for SOF.
2. Register hdmi/dp jack pins.
3. dai_fmt can be configured from device tree.
4. Add some I2S codecs support.

In addition, new compatible string "mediatek,mt8188-nau8825" is
included for a new board support.

13 months agoASoC: SOF: Intel: LunarLake preparation patches
Mark Brown [Mon, 5 Jun 2023 17:29:30 +0000 (18:29 +0100)]
ASoC: SOF: Intel: LunarLake preparation patches

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

This patchset adds the changes required for the hda-dai extension to
deal with SSSP/DMIC/SoundWire starting with LunarLake, as well as the
new TLV IPC to provide the DMA stream_tag to the DSP firmware.

LunarLake support for SSP/DMIC is ready but is gated by the patch
"ASoC: SOF: Intel: shim: add enum for ACE 2.0 IP used in LunarLake"
currently only present in the SoundWire tree.

13 months agoASoC: SOF: Intel: hda: add helper to extract SoundWire link count
Pierre-Louis Bossart [Fri, 2 Jun 2023 20:56:20 +0000 (15:56 -0500)]
ASoC: SOF: Intel: hda: add helper to extract SoundWire link count

The register changed with the HDaudio integration, the information is
present in the extended link descriptor and not in the SHIM.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230602205620.310879-10-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: SOF: Intel: mtl: prepare for code reuse
Pierre-Louis Bossart [Fri, 2 Jun 2023 20:56:19 +0000 (15:56 -0500)]
ASoC: SOF: Intel: mtl: prepare for code reuse

Some functions can be used for newer LNL hardware.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230602205620.310879-9-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: SOF: ipc4-topology: add DMA config TLV to IPC data
Pierre-Louis Bossart [Fri, 2 Jun 2023 20:56:18 +0000 (15:56 -0500)]
ASoC: SOF: ipc4-topology: add DMA config TLV to IPC data

This patch adds a DMA config TLV structure and the relevant code to
copy this TLV after the gateway configuration. For now this is an
iso-functionality change, the TLVs are not configured just
yet. Additional patches will be needed for DMIC/SSP/ALH (aka
SoundWire).

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230602205620.310879-8-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: SOF: ipc4-topology: introduce DMA config TLV
Pierre-Louis Bossart [Fri, 2 Jun 2023 20:56:17 +0000 (15:56 -0500)]
ASoC: SOF: ipc4-topology: introduce DMA config TLV

Starting with LunarLake, the DMIC/SSP/SoundWire audio interfaces will
use the HDaudio DMA. This patch adds the DMA configuration structure
to be passed as a TLV appended at the end of each gateway
configuration.

This patch only provides the definitions for now, the TLV will be
added in the actual blobs separately for each interface.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230602205620.310879-7-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: SOF: ipc4-topology: extend ALH-specific data structure
Pierre-Louis Bossart [Fri, 2 Jun 2023 20:56:16 +0000 (15:56 -0500)]
ASoC: SOF: ipc4-topology: extend ALH-specific data structure

LunarLake introduces a new TLV blob passed to the firmware for DMA
configuration. This TLV structure is directly inspired by the ALH
multi-gateway structure used so far. This patch suggest a transition
to the more abstract structure with no references to ALH.

This is an iso-functionality redefinition of structure, the TLV will
be added in a follow-up patch.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230602205620.310879-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: SOF: Intel: hda-dai: add get_hlink callback
Pierre-Louis Bossart [Fri, 2 Jun 2023 20:56:15 +0000 (15:56 -0500)]
ASoC: SOF: Intel: hda-dai: add get_hlink callback

The existing code for HDAudio DAIs cannot be extended to other types
of DAIs, specific programming sequences need to be abstracted
away.

This patch hides the mechanism to determine the multi-link structure
related to the DAI and program the LOSIDV register. An added benefit
is that we can remove all references to the codec DAI from what should
be a CPU dai configuration only.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230602205620.310879-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: SOF: Intel: hda-dai: add calc_stream_format callback
Pierre-Louis Bossart [Fri, 2 Jun 2023 20:56:14 +0000 (15:56 -0500)]
ASoC: SOF: Intel: hda-dai: add calc_stream_format callback

The existing code for HDAudio DAIs cannot be extended to other types
of DAIs, specific programming sequences need to be abstracted away.

This patch hides the stream format setup which is currently completely
related to the HDaudio codec setup - not something that will work for
other types of DAIs.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230602205620.310879-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: SOF: Intel: hda-dai: add codec_dai_set_stream callback
Pierre-Louis Bossart [Fri, 2 Jun 2023 20:56:13 +0000 (15:56 -0500)]
ASoC: SOF: Intel: hda-dai: add codec_dai_set_stream callback

The existing code for HDAudio DAIs cannot be extended to other types
of DAIs, specific programming sequences need to be abstracted
away. Start here with hiding the stream_tag needed by the HDAudio
codec_dai.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230602205620.310879-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: SOF: Intel: hda-dai: add error checks to prevent static analysis warnings
Pierre-Louis Bossart [Fri, 2 Jun 2023 20:56:12 +0000 (15:56 -0500)]
ASoC: SOF: Intel: hda-dai: add error checks to prevent static analysis warnings

make KCFLAGS='-fanalyzer' sound/soc/sof/intel/ reports several NULL
pointer dereference paths.

Example log:
ops = hda_dai_get_ops(substream, cpu_dai);
  |      |                          ^~~~~
  |      |                          |
  |      |               (14) return of NULL to ‘non_hda_dai_hw_params’ from ‘hda_dai_get_ops’
  |  353 |         sdev = widget_to_sdev(w);
  |  354 |         hext_stream = ops->get_hext_stream(sdev, cpu_dai, substream);
  |      |                       ~~~~~~~~~~~~~~~~~~~~
  |      |                          |
  |      |                          (15) dereference of NULL ‘ops’

The function hda_dai_get_ops() can return NULL, but the return value
is not checked across the board. It's not a problem today, since we do
check in the first use of the function, but static analysis tools are
not aware of the different ALSA stages. Rather than argue forever,
let's just add the error checks consistently and make sure this tool
can be added to the CI checks.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20230602205620.310879-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Intel: soc-acpi: add Rex CS42l42 and MAX98363 SoundWire entries
Uday M Bhat [Fri, 2 Jun 2023 20:22:25 +0000 (15:22 -0500)]
ASoC: Intel: soc-acpi: add Rex CS42l42 and MAX98363 SoundWire entries

Add support to the following daughter card for rex:

SDW0: CS42l42 Headset
SDW2: MX98363 Speaker

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Yong Zhi <yong.zhi@intel.com>
Signed-off-by: Uday M Bhat <uday.m.bhat@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230602202225.249209-29-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Intel: sof_sdw: Add support for Rex soundwire
Uday M Bhat [Fri, 2 Jun 2023 20:22:24 +0000 (15:22 -0500)]
ASoC: Intel: sof_sdw: Add support for Rex soundwire

Add rex entry in the soundwire quirk table

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Yong Zhi <yong.zhi@intel.com>
Signed-off-by: Uday M Bhat <uday.m.bhat@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230602202225.249209-28-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Intel: sof_sdw: Add support for MAX98363 codec
Uday M Bhat [Fri, 2 Jun 2023 20:22:23 +0000 (15:22 -0500)]
ASoC: Intel: sof_sdw: Add support for MAX98363 codec

Add support for MAX98363 soundwire codec. Update build
configuration to include this codec.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Yong Zhi <yong.zhi@intel.com>
Signed-off-by: Uday M Bhat <uday.m.bhat@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230602202225.249209-27-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Intel: sof_sdw: Modify maxim helper functions and structure names
Uday M Bhat [Fri, 2 Jun 2023 20:22:22 +0000 (15:22 -0500)]
ASoC: Intel: sof_sdw: Modify maxim helper functions and structure names

Init function and structure names are modified to use maxim
instead of max98373. Card components and speaker names are
updated based on part id.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Yong Zhi <yong.zhi@intel.com>
Signed-off-by: Uday M Bhat <uday.m.bhat@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230602202225.249209-26-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Intel: sof_sdw: Rename sof_sdw_max98373.c file to sof_sdw_maxim.c
Uday M Bhat [Fri, 2 Jun 2023 20:22:21 +0000 (15:22 -0500)]
ASoC: Intel: sof_sdw: Rename sof_sdw_max98373.c file to sof_sdw_maxim.c

This is needed to use the common implementation for other maxim
soundwire codecs

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Yong Zhi <yong.zhi@intel.com>
Signed-off-by: Uday M Bhat <uday.m.bhat@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230602202225.249209-25-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Intel: sof_sdw: Add helper function for cs42l42 codec
Uday M Bhat [Fri, 2 Jun 2023 20:22:20 +0000 (15:22 -0500)]
ASoC: Intel: sof_sdw: Add helper function for cs42l42 codec

Helper functions added to support CS42l42 soundwire codec.
Build configuration is updated to include this codec.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Yong Zhi <yong.zhi@intel.com>
Signed-off-by: Uday M Bhat <uday.m.bhat@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230602202225.249209-24-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Intel: Add rpl_rt1019_rt5682 driver
Terry Cheong [Fri, 2 Jun 2023 20:22:19 +0000 (15:22 -0500)]
ASoC: Intel: Add rpl_rt1019_rt5682 driver

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

Reviewed-by: Curtis Malainey <cujomalainey@chromium.org>
Signed-off-by: Terry Cheong <htcheong@chromium.org>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230602202225.249209-23-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Intel: Sof_ssp_amp: Correcting author name.
Balamurugan C [Fri, 2 Jun 2023 20:22:18 +0000 (15:22 -0500)]
ASoC: Intel: Sof_ssp_amp: Correcting author name.

Corrected the author name camel case and initial.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Balamurugan C <balamurugan.c@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230602202225.249209-22-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Intel: ADL: Moving amp only boards into end of the table.
Balamurugan C [Fri, 2 Jun 2023 20:22:17 +0000 (15:22 -0500)]
ASoC: Intel: ADL: Moving amp only boards into end of the table.

Moving amp only boards into end of the match table to have
better order and maintenance.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Balamurugan C <balamurugan.c@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230602202225.249209-21-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Intel: ADL: Enable HDMI-In capture feature support for non-I2S codec boards.
Balamurugan C [Fri, 2 Jun 2023 20:22:16 +0000 (15:22 -0500)]
ASoC: Intel: ADL: Enable HDMI-In capture feature support for non-I2S codec boards.

Adding HDMI-In capture support for the products doesn't have onboard
I2S codec.but need to support HDMI-In capture via I2S and audio playback
through HDMI/DP monitor.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Balamurugan C <balamurugan.c@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230602202225.249209-20-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Intel: sof-sdw: add Dell SKU 0B34
Pierre-Louis Bossart [Fri, 2 Jun 2023 20:22:15 +0000 (15:22 -0500)]
ASoC: Intel: sof-sdw: add Dell SKU 0B34

This device has no 3.5mm jack, only a single amplifier and mic codec.

Closes: https://github.com/thesofproject/linux/issues/4399
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230602202225.249209-19-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Intel: soc-acpi: add tables for Dell SKU 0B34
Pierre-Louis Bossart [Fri, 2 Jun 2023 20:22:14 +0000 (15:22 -0500)]
ASoC: Intel: soc-acpi: add tables for Dell SKU 0B34

Yet another permutation of devices.

Closes: https://github.com/thesofproject/linux/issues/4399
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230602202225.249209-18-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Intel: sof_sdw: add quick for Dell SKU 0BDA
Pierre-Louis Bossart [Fri, 2 Jun 2023 20:22:13 +0000 (15:22 -0500)]
ASoC: Intel: sof_sdw: add quick for Dell SKU 0BDA

The SKU numbering isn't quite consistent with the existing RaptorLake
SKUs but the PCI ID is definitively RaptorLake.

Closes: https://github.com/thesofproject/linux/issues/4380
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230602202225.249209-17-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Intel: soc-acpi: add table for RPL Dell SKU 0BDA
Pierre-Louis Bossart [Fri, 2 Jun 2023 20:22:12 +0000 (15:22 -0500)]
ASoC: Intel: soc-acpi: add table for RPL Dell SKU 0BDA

This is a standard configuration we've seen before for TGL.

Closes: https://github.com/thesofproject/linux/issues/4380
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230602202225.249209-16-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Intel: sof_sdw: increase sdw pin index for each sdw link
Bard Liao [Fri, 2 Jun 2023 20:22:11 +0000 (15:22 -0500)]
ASoC: Intel: sof_sdw: increase sdw pin index for each sdw link

To support multiple codecs per SoundWire link, we have to assign multiple
CPU DAIs to different DAI links sharing the same physical link. This is
not possible with the existing code since we assume that only 'Pin2' is
used for playback and 'Pin3' used for capture - additional DAIs cannot
be handled.

This patch enables more CPU DAIs to be used, e.g. "SDW0 Pin2",
"SDW0 Pin3", and "SDW0 Pin4" for SDW0-Playback-SimpleJack,
SDW0-Capture-SimpleJack, and SDW0-Playback-SmartAmp DAI links on physical
link #0.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230602202225.249209-15-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Intel: sof_sdw: add rt713 support
Bard Liao [Fri, 2 Jun 2023 20:22:10 +0000 (15:22 -0500)]
ASoC: Intel: sof_sdw: add rt713 support

rt713 is rt712 but without amp.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230602202225.249209-14-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Intel: soc-acpi-intel-mtl-match: add rt712 ID
Bard Liao [Fri, 2 Jun 2023 20:22:09 +0000 (15:22 -0500)]
ASoC: Intel: soc-acpi-intel-mtl-match: add rt712 ID

Add rt712 ID for MTL.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230602202225.249209-13-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Intel: soc-acpi-intel-tgl-match: add rt712 ID
Bard Liao [Fri, 2 Jun 2023 20:22:08 +0000 (15:22 -0500)]
ASoC: Intel: soc-acpi-intel-tgl-match: add rt712 ID

Add rt712 ID for TGL.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230602202225.249209-12-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Intel: sof_sdw: add rt712 support
Bard Liao [Fri, 2 Jun 2023 20:22:07 +0000 (15:22 -0500)]
ASoC: Intel: sof_sdw: add rt712 support

Rt712 is a multi function codec which shpports headset, amp, and dmic
functions. Rt712 has two sdw interfaces and codec drivers, one for jack
and amp, the other for dmic. part id 0x712 is for jack and amp, and 0x1712
is for dmic.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230602202225.249209-11-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Intel: sof_sdw: make rt711_sdca be generic
Bard Liao [Fri, 2 Jun 2023 20:22:06 +0000 (15:22 -0500)]
ASoC: Intel: sof_sdw: make rt711_sdca be generic

Let rename rt711_sdca to rt_sdca_jack and let it be used for all
Realtek sdca jacks.
The commit uses component->name_prefix to construct card->components,
and determine which codec it is. So, we have to set name_prefix
properly.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230602202225.249209-10-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Intel: sof_sdw: rename SOF_RT711_JDSRC to SOF_JACK_JDSRC
Bard Liao [Fri, 2 Jun 2023 20:22:05 +0000 (15:22 -0500)]
ASoC: Intel: sof_sdw: rename SOF_RT711_JDSRC to SOF_JACK_JDSRC

Jack Detection source can be applied to all jacks, not only rt711.
No function changes.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230602202225.249209-9-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Intel: sof_sdw_rt_sdca_jack_common: test SOF_JACK_JDSRC in _exit
Bard Liao [Fri, 2 Jun 2023 20:22:04 +0000 (15:22 -0500)]
ASoC: Intel: sof_sdw_rt_sdca_jack_common: test SOF_JACK_JDSRC in _exit

if (!SOF_RT711_JDSRC(sof_sdw_quirk)) is tested in rt711_sdca_add_codec_
device_props(), and we don't add software node to the device if jack
source is not set. We need to do the same test in
sof_sdw_rt711_sdca_exit(), and avoid removing software node if jack
source is not set.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230602202225.249209-8-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Intel: sof_sdw: add multi dailink support for a codec
Bard Liao [Fri, 2 Jun 2023 20:22:03 +0000 (15:22 -0500)]
ASoC: Intel: sof_sdw: add multi dailink support for a codec

A codec may support multiple dais for different purpose. For example,
the rt712 codec supports jack and amp on different dais and machine
driver needs to create different dailink for those dais.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230602202225.249209-7-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Intel: sdw_sof: append dai_type and remove codec_type
Bard Liao [Fri, 2 Jun 2023 20:22:02 +0000 (15:22 -0500)]
ASoC: Intel: sdw_sof: append dai_type and remove codec_type

We append codec type to dailink name to distinguish different dailink
on the same sdw link and direction. But we could create multi dailinks
for a codec and the dailink name will be duplicated if we append codec
type to the dailink name.
Appending dai type instead of codec type can solve the issue.
For example, if a codec supports JACK on dai 0 and AMP on dai 1, the
existing code will create dailinks
SDW0-Playback-SimpleJack or SDW0-Playback-SmartAmp for both dailinks,
and it will be SDW0-Playback-SimpleJack for dailink 0 and
SDW0-Playback-SmartAmp for dailink 1 after this change.
Then codec type is not used any more and can be removed.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230602202225.249209-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Intel: sof_sdw: add codec_info pointer
Bard Liao [Fri, 2 Jun 2023 20:22:01 +0000 (15:22 -0500)]
ASoC: Intel: sof_sdw: add codec_info pointer

codec_info_list[codec_index] is used multiple times in the
create_sdw_dailink() function. Adding a codec_info pointer to shorten
the code. This is a preparation for the following up patches.
No function changed.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230602202225.249209-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Intel: sof_sdw: use predefine dailink id
Bard Liao [Fri, 2 Jun 2023 20:22:00 +0000 (15:22 -0500)]
ASoC: Intel: sof_sdw: use predefine dailink id

Currently, we assign dailink ids in order, and shift with codec type.
The purpose is to have consistent dailink ids for topologies.
This can be simplified if we have a predefined dailink id in
sof_sdw_dai_info.
We reuse the existing ids as the predefine ids. So the dailink ids will
not be changed by this commit.
With this change, we no longer need to check the adr order described in a
snd_soc_acpi_link_adr array.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230602202225.249209-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Intel: sof_sdw: add dai info
Bard Liao [Fri, 2 Jun 2023 20:21:59 +0000 (15:21 -0500)]
ASoC: Intel: sof_sdw: add dai info

The existing code create a dailink for a codec. However, we may need
multi dailinks for a codec. This commit adds a new struct in
sof_sdw_codec_info{} to store the dai info of a codec.
The initial assumption if that we will create at most 3 dailink types
for a codec, since this is the max known with upcoming SDCA devices. We
may need to increase this number as new SDCA 'functions' become available.

One strong assumption is that all dailinks exposed are independent, as per
SDCA directions.

This commit just moves some items into the new sof_sdw_dai_info struct.
There is no function changed. Multi dais supported will be added in the
follow up commits.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230602202225.249209-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: Intel: sof_sdw: add missing exit callback
Bard Liao [Fri, 2 Jun 2023 20:21:58 +0000 (15:21 -0500)]
ASoC: Intel: sof_sdw: add missing exit callback

Somehow .exit = sof_sdw_rt_amp_exit was missing in rt1318 codec info.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230602202225.249209-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: amd: vangogh: select CONFIG_SND_AMD_ACP_CONFIG
Arnd Bergmann [Mon, 5 Jun 2023 08:58:29 +0000 (10:58 +0200)]
ASoC: amd: vangogh: select CONFIG_SND_AMD_ACP_CONFIG

The vangogh driver just gained a link time dependency that now causes
randconfig builds to fail:

x86_64-linux-ld: sound/soc/amd/vangogh/pci-acp5x.o: in function `snd_acp5x_probe':
pci-acp5x.c:(.text+0xbb): undefined reference to `snd_amd_acp_find_config'

Fixes: e89f45edb747e ("ASoC: amd: vangogh: Add check for acp config flags in vangogh platform")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20230605085839.2157268-1-arnd@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoAdd NAU8825C support
Mark Brown [Mon, 5 Jun 2023 12:11:17 +0000 (13:11 +0100)]
Add NAU8825C support

Merge series from David Lin <CTLIN0@nuvoton.com>:

This series adds nau8825c support. The driver can be used on
NAU8825B and NAU8825C.

13 months agoASoC: amd: vangogh: select CONFIG_SND_AMD_ACP_CONFIG
Arnd Bergmann [Fri, 2 Jun 2023 12:44:39 +0000 (14:44 +0200)]
ASoC: amd: vangogh: select CONFIG_SND_AMD_ACP_CONFIG

The vangogh driver just gained a link time dependency that now causes
randconfig builds to fail:

x86_64-linux-ld: sound/soc/amd/vangogh/pci-acp5x.o: in function `snd_acp5x_probe':
pci-acp5x.c:(.text+0xbb): undefined reference to `snd_amd_acp_find_config'

Fixes: e89f45edb747e ("ASoC: amd: vangogh: Add check for acp config flags in vangogh platform")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20230602124447.863476-1-arnd@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: dt-bindings: mediatek,mt8188-mt6359: add NAU8825 support
Trevor Wu [Fri, 26 May 2023 09:31:50 +0000 (17:31 +0800)]
ASoC: dt-bindings: mediatek,mt8188-mt6359: add NAU8825 support

Add compatible string "mediatek,mt8188-nau8825" to support new board
with nau8825 codec.

Introduce two properties "dai-format" and "mediatek,clk-provider" under
dai-link subnode to configure dai-link parameters via dts.

"codec" property is removed from required property of dai-link subnode.
For co-clock case, it's possible two dai-links should be configured to
the same dai format, but only one cpu dai is bound with codec.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Link: https://lore.kernel.org/r/20230526093150.22923-8-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: mediatek: mt8188-mt6359: support new board with nau88255
Trevor Wu [Fri, 26 May 2023 09:31:49 +0000 (17:31 +0800)]
ASoC: mediatek: mt8188-mt6359: support new board with nau88255

This patch adds multiple i2s codecs support including NAU88L25,
MAX98390, and the dumb amp like NAU8318 usage. In addition, dmic-codec
is also added to skip the beginning pop noise.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Link: https://lore.kernel.org/r/20230526093150.22923-7-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: soc-dapm.c: clean up debugfs for freed widget
Trevor Wu [Fri, 26 May 2023 09:31:48 +0000 (17:31 +0800)]
ASoC: soc-dapm.c: clean up debugfs for freed widget

When a widget is added to dapm via snd_soc_dapm_new_widgets,
dapm_debugfs_add_widget is also called to create a corresponding debugfs
file. However, when a widget is freed by snd_soc_dapm_free_widget, the
corresponding debugfs is not cleared. As a result, the freed widget is
still seen in the dapm directory.

This patch adds dapm_debugfs_free_widget to free the debugfs of a
specified widget, and it's called at snd_soc_dapm_free_widget to clean
up the debugfs for freed widget.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com>
Link: https://lore.kernel.org/r/20230526093150.22923-6-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: mediatek: common: soundcard driver add dai_fmt support
Trevor Wu [Fri, 26 May 2023 09:31:47 +0000 (17:31 +0800)]
ASoC: mediatek: common: soundcard driver add dai_fmt support

There are two changes included in the patch.

First, add set_dailink_daifmt() function, so dai_fmt can be updated by
the configuration in dai-link sub node.

Second, remove codec phandle from required property in dai-link sub node.
For example, user possibly needs to update dai-format for all etdm
co-clock dai-links, but codec doesn't need to be specified in capture
dai-link for a speaker amp.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com>
Link: https://lore.kernel.org/r/20230526093150.22923-5-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: mediatek: mt8188-mt6359: register hdmi/dp jack pins
Trevor Wu [Fri, 26 May 2023 09:31:46 +0000 (17:31 +0800)]
ASoC: mediatek: mt8188-mt6359: register hdmi/dp jack pins

Some userspace applications need jack control events, so register hdmi
and dp jack pins to activate jack control events.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com>
Link: https://lore.kernel.org/r/20230526093150.22923-4-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: dt-bindings: mediatek,mt8188-mt6359: remove ADDA_BE from link-name
Trevor Wu [Fri, 26 May 2023 09:31:45 +0000 (17:31 +0800)]
ASoC: dt-bindings: mediatek,mt8188-mt6359: remove ADDA_BE from link-name

ADDA_BE is used to connect to mt6359. For machine mt8188-mt6359, codec
for ADDA_BE must be mt6359 which are configured on the machine driver.
Besides, ADDA_BE is divided into two dais, UL_SRC_BE and DL_SRC_BE.
As a result, remove ADDA_BE from items of link-name.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com>
Link: https://lore.kernel.org/r/20230526093150.22923-3-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: mediatek: mt8188: separate ADDA playback dai from capture dai
Trevor Wu [Fri, 26 May 2023 09:31:44 +0000 (17:31 +0800)]
ASoC: mediatek: mt8188: separate ADDA playback dai from capture dai

MT8188 will support SOF. In SOF, be_hw_params_fixup callback are used to
configure BE hardware parameters. However, playback and capture stream
share the same callback function in which it can't know the stream type.

It's possible to require different parameters for playback and capture
stream, so separate them into two dais for SOF usage.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com>
Link: https://lore.kernel.org/r/20230526093150.22923-2-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: nau8825: Update output control for NAU8825C
David Lin [Fri, 2 Jun 2023 04:09:24 +0000 (12:09 +0800)]
ASoC: nau8825: Update output control for NAU8825C

Update the output control for NAU8825C.

Signed-off-by: David Lin <CTLIN0@nuvoton.com>
Link: https://lore.kernel.org/r/20230602040924.188913-4-CTLIN0@nuvoton.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: nau8825: Update the calculation of FLL for NAU8825C
David Lin [Fri, 2 Jun 2023 04:09:23 +0000 (12:09 +0800)]
ASoC: nau8825: Update the calculation of FLL for NAU8825C

The FLL is updated to 24 bit with lower power consumption.

Signed-off-by: David Lin <CTLIN0@nuvoton.com>
Link: https://lore.kernel.org/r/20230602040924.188913-3-CTLIN0@nuvoton.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: nau8825: Add registers patch for NAU8825C
David Lin [Fri, 2 Jun 2023 04:09:22 +0000 (12:09 +0800)]
ASoC: nau8825: Add registers patch for NAU8825C

The patch is to update default regmap and register a set of registers
for NAU8825C.

Signed-off-by: David Lin <CTLIN0@nuvoton.com>
Link: https://lore.kernel.org/r/20230602040924.188913-2-CTLIN0@nuvoton.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoAdd TDM audio on StarFive JH7110
Mark Brown [Thu, 1 Jun 2023 15:43:46 +0000 (16:43 +0100)]
Add TDM audio on StarFive JH7110

Merge series from Walker Chen <walker.chen@starfivetech.com>:

This patchset adds TDM audio driver for the StarFive JH7110 SoC. The
first patch adds device tree binding for TDM module. The second patch
adds tdm driver support for JH7110 SoC. The last patch adds device tree
node and pins configuration of tdm to JH7110 dts.

The series has been tested on the VisionFive 2 board by plugging an
audio expansion board.

For more information of audio expansion board, you can take a look
at the following webpage:
https://wiki.seeedstudio.com/ReSpeaker_2_Mics_Pi_HAT/

13 months agoASoC: SOF: mediatek: add adsp debug dump
Trevor Wu [Thu, 1 Jun 2023 03:49:39 +0000 (11:49 +0800)]
ASoC: SOF: mediatek: add adsp debug dump

Add mt8188 and mt8186 .dbg_dump callback to print some information when
DSP panic occurs.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Yaochun Hung <yc.hung@mediatek.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20230601034939.15802-2-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agofirmware: cs_dsp: Log that a bin file was loaded
Richard Fitzgerald [Wed, 31 May 2023 17:01:58 +0000 (18:01 +0100)]
firmware: cs_dsp: Log that a bin file was loaded

Change the message at the start of bin file loading from
cs_dsp_dbg() to cs_dsp_info() so that there is confirmation
in the kernel log that a bin file was loaded, and the name
of the file.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230531170158.2744700-1-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: starfive: Add JH7110 TDM driver
Walker Chen [Fri, 26 May 2023 14:54:01 +0000 (22:54 +0800)]
ASoC: starfive: Add JH7110 TDM driver

Add tdm driver support for the StarFive JH7110 SoC.

Signed-off-by: Walker Chen <walker.chen@starfivetech.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/20230526145402.450-3-walker.chen@starfivetech.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: dt-bindings: Add TDM controller bindings for StarFive JH7110
Walker Chen [Fri, 26 May 2023 14:54:00 +0000 (22:54 +0800)]
ASoC: dt-bindings: Add TDM controller bindings for StarFive JH7110

Add bindings for TDM driver which supports multi-channel audio playback
and capture on JH7110 platform.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Walker Chen <walker.chen@starfivetech.com>
Link: https://lore.kernel.org/r/20230526145402.450-2-walker.chen@starfivetech.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: minor cleanup for soc_get_playback_capture()
Mark Brown [Wed, 31 May 2023 15:37:39 +0000 (16:37 +0100)]
ASoC: minor cleanup for soc_get_playback_capture()

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

This is minor cleanup patches for soc_get_playback_capture().

13 months agoASoC: nau8825: Add the management of headset detection for power saving
David Lin [Wed, 31 May 2023 07:53:35 +0000 (15:53 +0800)]
ASoC: nau8825: Add the management of headset detection for power saving

The patch is to manage HSD feature for power saving. The detail is to
disable HSD feature after the headset detection is done. When the jack
is inserted, the HSD feature will be enabled again.

Signed-off-by: David Lin <CTLIN0@nuvoton.com>
Link: https://lore.kernel.org/r/20230531075334.168637-1-CTLIN0@nuvoton.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: soc-pcm.c: tidyup playback/capture_only at soc_get_playback_capture()
Kuninori Morimoto [Tue, 30 May 2023 00:50:08 +0000 (00:50 +0000)]
ASoC: soc-pcm.c: tidyup playback/capture_only at soc_get_playback_capture()

soc_get_playback_capture() (A) returns number of substreams for
playback/capture, and then, we can use playback/capture_only flag (X)(Y).

(A)     static int soc_get_playback_capture(...)
{
...
(X) if (dai_link->playback_only) {
(*) *playback = 1;
*capture = 0;
}

(Y) if (dai_link->capture_only) {
*playback = 0;
(*) *capture = 1;
}
...
}

But this flag should not have effect to opposite side stream (*).
This patch tidyup it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/87sfbezlq8.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: soc-pcm.c: use temporary variable at soc_get_playback_capture()
Kuninori Morimoto [Tue, 30 May 2023 00:50:01 +0000 (00:50 +0000)]
ASoC: soc-pcm.c: use temporary variable at soc_get_playback_capture()

soc_get_playback_capture() (A) returns number of substreams for
playback/capture (B).

(A) static int soc_get_playback_capture(...,
(B) int *playback, int *capture)
{
...
for_each_xxx(...) {
if (xxx)
return -EINVAL;
=> *playback = 1;
...
=> *capture = 1;
...
}
...
}

But, it is directly updating playback/capture which is the result of this
function even though it might be error. It should be updated in case of
succeed only. This patch updates it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/87ttvuzlqe.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: soc-pcm.c: cleanup soc_get_playback_capture() error
Kuninori Morimoto [Tue, 30 May 2023 00:49:56 +0000 (00:49 +0000)]
ASoC: soc-pcm.c: cleanup soc_get_playback_capture() error

soc_get_playback_capture() (A) checks dai_link status, and indicate error
if it was not matching (B).

(A) static int soc_get_playback_capture(...)
{
...
 ^ if (dai_link->dynamic && dai_link->num_cpus > 1) {
 | dev_err(rtd->dev,
(B) "DPCM doesn't support Multi CPU for Front-Ends yet\n");
 | return -EINVAL;
 v }
...
}

We can use 100 char for 1 line today. This patch cleanup error code line.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/87v8gazlqk.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: soc-pcm.c: use dai_link on soc_get_playback_capture()
Kuninori Morimoto [Tue, 30 May 2023 00:49:50 +0000 (00:49 +0000)]
ASoC: soc-pcm.c: use dai_link on soc_get_playback_capture()

soc_get_playback_capture() (A) is using rtd->dai_link->xxx everywhere.
Because of that, 1 line is unnecessarily long and not readable.

(A) static int soc_get_playback_capture(...)
{
if (rtd->dai_link->dynamic ...) {
    ^^^^^^^^^^^^^
...
} else {
int cpu_capture = rtd->dai_link->c2c_params ?
  ^^^^^^^^^^^^^
...
}

if (rtd->dai_link->playback_only) {
    ^^^^^^^^^^^^^
...
}
...
}

This patch uses variable "dai_link" to be clear code.
Nothing changes the meanings.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/87wn0qzlqp.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: soc-pcm.c: indicate error if stream has no playback no capture
Kuninori Morimoto [Tue, 30 May 2023 00:49:43 +0000 (00:49 +0000)]
ASoC: soc-pcm.c: indicate error if stream has no playback no capture

soc_get_playback_capture() (A) returns number of substreams for
playback/capture (B).
ASoC will probe the Sound Card and mapps CPU<->Codec pair.

(A) static int soc_get_playback_capture(...,
(B)     int *playback, int *capture)
{
...
if (rtd->dai_link->playback_only) {
*playback = 1;
*capture = 0;
}

if (rtd->dai_link->capture_only) {
*playback = 0;
*capture = 1;
}
(C)
return 0;
}

But it might be no playback no capture if it returns playback=0, capture=0.
It is very difficult to notice about it. This patch indicates error at (C)
then.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/87y1l6zlqx.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoES8316 audio codec fixes on Rock5B
Mark Brown [Tue, 30 May 2023 19:41:29 +0000 (20:41 +0100)]
ES8316 audio codec fixes on Rock5B

Merge series from Cristian Ciocaltea <cristian.ciocaltea@collabora.com>:

This patch series handles a few issues related to the ES8316 audio
codec, discovered while doing some testing on the Rock 5B board.

13 months agoASoC: es8316: Do not set rate constraints for unsupported MCLKs
Cristian Ciocaltea [Tue, 30 May 2023 18:11:39 +0000 (21:11 +0300)]
ASoC: es8316: Do not set rate constraints for unsupported MCLKs

When using the codec through the generic audio graph card, there are at
least two calls of es8316_set_dai_sysclk(), with the effect of limiting
the allowed sample rates according to the MCLK/LRCK ratios supported by
the codec:

1. During audio card setup, to set the initial MCLK - see
   asoc_simple_init_dai().

2. Before opening a stream, to update MCLK, according to the stream
   sample rate and the multiplication factor - see
   asoc_simple_hw_params().

In some cases the initial MCLK might be set to a frequency that doesn't
match any of the supported ratios, e.g. 12287999 instead of 12288000,
which is only 1 Hz below the supported clock, as that is what the
hardware reports. This creates an empty list of rate constraints, which
is further passed to snd_pcm_hw_constraint_list() via
es8316_pcm_startup(), and causes the following error on the very first
access of the sound card:

  $ speaker-test -D hw:Analog,0 -F S16_LE -c 2 -t wav
  Broken configuration for playback: no configurations available: Invalid argument
  Setting of hwparams failed: Invalid argument

Note that all subsequent retries succeed thanks to the updated MCLK set
at point 2 above, which uses a computed frequency value instead of a
reading from the hardware registers. Normally this would have mitigated
the issue, but es8316_pcm_startup() executes before the 2nd call to
es8316_set_dai_sysclk(), hence it cannot make use of the updated
constraints.

Since es8316_pcm_hw_params() performs anyway a final validation of MCLK
against the stream sample rate and the supported MCLK/LRCK ratios, fix
the issue by ensuring that sysclk_constraints list is only set when at
least one supported sample rate is autodetected by the codec.

Fixes: b8b88b70875a ("ASoC: add es8316 codec driver")
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Link: https://lore.kernel.org/r/20230530181140.483936-3-cristian.ciocaltea@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: es8316: Increment max value for ALC Capture Target Volume control
Cristian Ciocaltea [Tue, 30 May 2023 18:11:38 +0000 (21:11 +0300)]
ASoC: es8316: Increment max value for ALC Capture Target Volume control

The following error occurs when trying to restore a previously saved
ALSA mixer state (tested on a Rock 5B board):

  $ alsactl --no-ucm -f /tmp/asound.state store hw:Analog
  $ alsactl --no-ucm -I -f /tmp/asound.state restore hw:Analog
  alsactl: set_control:1475: Cannot write control '2:0:0:ALC Capture Target Volume:0' : Invalid argument

According to ES8316 datasheet, the register at address 0x2B, which is
related to the above mixer control, contains by default the value 0xB0.
Considering the corresponding ALC target bits (ALCLVL) are 7:4, the
control is initialized with 11, which is one step above the maximum
value allowed by the driver:

 ALCLVL | dB gain
 -------+--------
  0000  |  -16.5
  0001  |  -15.0
  0010  |  -13.5
  ....  |  .....
  0111  |   -6.0
  1000  |   -4.5
  1001  |   -3.0
  1010  |   -1.5
  ....  |  .....
  1111  |   -1.5

The tests performed using the VU meter feature (--vumeter=TYPE) of
arecord/aplay confirm the specs are correct and there is no measured
gain if the 1011-1111 range would have been mapped to 0 dB:

 dB gain | VU meter %
 --------+-----------
   -6.0  |  30-31
   -4.5  |  35-36
   -3.0  |  42-43
   -1.5  |  50-51
    0.0  |  50-51

Increment the max value allowed for ALC Capture Target Volume control,
so that it matches the hardware default.  Additionally, update the
related TLV to prevent an artificial extension of the dB gain range.

Fixes: b8b88b70875a ("ASoC: add es8316 codec driver")
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Link: https://lore.kernel.org/r/20230530181140.483936-2-cristian.ciocaltea@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: topology: allow for partial dailink stream_name
Mark Brown [Tue, 30 May 2023 16:43:11 +0000 (17:43 +0100)]
ASoC: topology: allow for partial dailink stream_name

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

The topology file and the machine driver rely on common definitions
for the dailink stream_name.  To avoid any backwards-compatibility
problems, the machine driver stream names are set in stone and cannot
be modified.

This is problematic when we try to name some of the topology widgets
after the stream_name, since the widget name is limited to 44
characters

tools/include/uapi/sound/asound.h:#define SNDRV_CTL_ELEM_ID_NAME_MAXLEN 44

Existing examples include "Analog Playback and Capture" for HDaudio
dailinks, which leaves less than 20 chars to identify widgets/controls
with a meaningful name.

Since the 44-char limit is part of the UAPI definitions, we assumed
there is no way to increase it.

This patchset suggests instead a partial match which allows topology
files to use a shorter stream_name, which in turn allows for
self-explanatory widget names that comply with the 44-char limit.

This should not break any existing setup but with the introduction of
a partial match new dailinks should be named carefully to avoid
confusions between e.g. 'link1' and 'link10'. The last patch fixes
such an issue in the 'nocodec' test topology used by Intel.

13 months agoASoC: SOF: add mt8188 audio support
Mark Brown [Tue, 30 May 2023 16:43:05 +0000 (17:43 +0100)]
ASoC: SOF: add mt8188 audio support

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

This adds mt8188 audio support.

13 months agoASoC: SOF: Intel: HDA: Limit the number of dai drivers for nocodec mode
Ranjani Sridharan [Fri, 26 May 2023 20:41:49 +0000 (15:41 -0500)]
ASoC: SOF: Intel: HDA: Limit the number of dai drivers for nocodec mode

With a common kernel config for nocodec and codec modes, the number of DAI
drivers will be set to 15 for nocodec as well. So adjust this when set
the machine params for the nocodec mode if the debug flag is set.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@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/20230526204149.456068-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: SOF: topology: Use partial match for connecting DAI link and DAI widget
Ranjani Sridharan [Fri, 26 May 2023 20:41:48 +0000 (15:41 -0500)]
ASoC: SOF: topology: Use partial match for connecting DAI link and DAI widget

This allows setting shorter names for the widget stream names in
topology. For example, in the case of HDA Analog DAI link, the stream
name is "Analog Playback and Capture". But it is enough to match "Analog"
in the DAI link stream name with a widget's stream name. This is needed
to set more meaningful names for the DAI widgets using the stream name
in topology.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@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/20230526204149.456068-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: topology: Allow partial matching when finding DAI link
Ranjani Sridharan [Fri, 26 May 2023 20:41:47 +0000 (15:41 -0500)]
ASoC: topology: Allow partial matching when finding DAI link

This allows for setting shorter link names in topology. For example,
for the HDA Analog DAI link, just "Analog" would suffice instead of
"Analog Playback and Capture"

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@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: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230526204149.456068-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: ti: davinci-mcasp: Use pcm_for_each_format() macro
Min-Hua Chen [Fri, 19 May 2023 21:16:36 +0000 (05:16 +0800)]
ASoC: ti: davinci-mcasp: Use pcm_for_each_format() macro

Use pcm_for_each_format for the PCM format iteration and fix the
following sparse warnings.

sound/soc/ti/davinci-mcasp.c:1336:26: sparse: warning: restricted snd_pcm_format_t degrades to integer
sound/soc/ti/davinci-mcasp.c:1358:26: sparse: warning: restricted snd_pcm_format_t degrades to integer
sound/soc/ti/davinci-mcasp.c:1438:26: sparse: warning: restricted snd_pcm_format_t degrades to integer

No functional changes.

Signed-off-by: Min-Hua Chen <minhuadotchen@gmail.com>
Link: https://lore.kernel.org/r/20230519211636.3699-1-minhuadotchen@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: amd: vangogh: Add check for acp config flags in vangogh platform
Venkata Prasad Potturu [Tue, 30 May 2023 11:07:58 +0000 (16:37 +0530)]
ASoC: amd: vangogh: Add check for acp config flags in vangogh platform

We have SOF and generic ACP support enabled for Vangogh platform
on some machines. Since we have same PCI id used for probing,
add check for machine configuration flag to avoid conflict with
newer pci drivers. Such machine flag has been initialized via
dmi match on few Vangogh based machines. If no flag is
specified probe and register older platform device.

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://lore.kernel.org/r/20230530110802.674939-1-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: SOF: mediatek: add mt8188 audio support
Trevor Wu [Tue, 23 May 2023 02:59:32 +0000 (10:59 +0800)]
ASoC: SOF: mediatek: add mt8188 audio support

Add mt8188 dai driver and specify of_machine to support mt8188 audio.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Yaochun Hung <yc.hung@mediatek.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230523025933.30494-2-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: cs42l42: Add PLL ratio table values
Vitaly Rodionov [Wed, 24 May 2023 12:52:36 +0000 (13:52 +0100)]
ASoC: cs42l42: Add PLL ratio table values

Add 4.8Mhz 9.6Mhz and 19.2MHz SCLK values
for MCLK 12MHz and 12.288MHz requested by Intel.

Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com>
Reviewed-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230524125236.57149-1-vitalyr@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: cs35l45: Relicense to GPL only
Charles Keepax [Wed, 10 May 2023 09:25:34 +0000 (10:25 +0100)]
ASoC: cs35l45: Relicense to GPL only

Cirrus never intended to upstream dual licensed code, convert to
GPL only.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Reviewed-by: Vlad Karpovich <vkarpovi@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230510092534.3919120-1-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: da7219: Add jack insertion detection polarity
Mark Brown [Tue, 23 May 2023 22:11:42 +0000 (23:11 +0100)]
ASoC: da7219: Add jack insertion detection polarity

Merge series from David Rau <David.Rau.opensource@dm.renesas.com>:

This patchset adds the support of DA7219 Jack insertion detection
polarity selection.

The first patch replaces the old txt binding with a new schema binding.

The second patch adds `dlg,jack-ins-det-pty` property for Jack
insertion detection polarity selection.

The last patch adds the driver support for this topic.

The series has been verified on the DA7219 development kit.

13 months agoImprove support for sof_ipc{3|4}_bytes_ext_put
Mark Brown [Tue, 23 May 2023 21:42:57 +0000 (22:42 +0100)]
Improve support for sof_ipc{3|4}_bytes_ext_put

Merge series from Daniel Baluta <daniel.baluta@oss.nxp.com>:

This patch series provides better handling of cases where sending
a data blob to FW results in a validation error.

In this case we restore to the last good known value instead of keeping
the data that firwmare rejected.

13 months agoASoC: mt6359: kselftest fix and driver extension
Mark Brown [Tue, 23 May 2023 21:42:50 +0000 (22:42 +0100)]
ASoC: mt6359: kselftest fix and driver extension

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

The patch series includes a kselftest fix and changes for extending
driver capability to support more use cases.

13 months agoASoC: dt-bindings: rt1016: Convert to dtschema
Anup Sharma [Fri, 5 May 2023 13:30:42 +0000 (19:00 +0530)]
ASoC: dt-bindings: rt1016: Convert to dtschema

Convert the RT1016 Stereo Audio Amplifier bindings to DT schema

Signed-off-by: Anup Sharma <anupnewsmail@gmail.com>
Link: https://lore.kernel.org/r/ZFUFAmBJXvkQAG7m@yoga
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: do not include runtime_pm.h if not needed
Mark Brown [Tue, 23 May 2023 19:49:28 +0000 (20:49 +0100)]
ASoC: do not include runtime_pm.h if not needed

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

Series removes the pm_runtime.h inclusion in files where
APIs exported though pm_runtime.h are not used. In case
of files that make use of pm.h which comes form pm_runtime.h
added patch 2/2.

13 months agoASoC: SOF: Intel: mtl: Enable multicore support
Mark Brown [Tue, 23 May 2023 19:49:22 +0000 (20:49 +0100)]
ASoC: SOF: Intel: mtl: Enable multicore support

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

The following series will enable multicore support on MTL platforms similarly
to other Intel platforms.

The TGL patch is included to simplify the core_put implementation.

Multicore support can be enabled by updated topologies, with current set of
tplg files this series is not introducing any runtime change.

13 months agoASoC: mediatek: mt6359: update route for lineout mux
Trevor Wu [Mon, 8 May 2023 07:15:32 +0000 (15:15 +0800)]
ASoC: mediatek: mt6359: update route for lineout mux

Originally, lineout playback source can only be DAC_3RD. Some SoC
masters only support stereo MTKAIF outputs, so lineout path can't be
used in such case.

MTKAIF connections are as follows.
MOSI0 -> DAC_L
MOSI1 -> DAC_R
MOSI2 -> DAC_3rd

In the patch, lineout playback source can be chosen between DAC_L and
DAC_3rd, so sound can be outputted via lineout even though SoC only
supports stereo MTKAIF outputs.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Link: https://lore.kernel.org/r/20230508071532.21665-5-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: mediatek: mt6359: add mtkaif gpio setting
Trevor Wu [Mon, 8 May 2023 07:15:31 +0000 (15:15 +0800)]
ASoC: mediatek: mt6359: add mtkaif gpio setting

Add mtkaif gpio driving to increase signal strength and smt setting to
prevent from overshooting.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Link: https://lore.kernel.org/r/20230508071532.21665-4-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: mediatek: mt6359: fix kselftest error of playback gain
Trevor Wu [Mon, 8 May 2023 07:15:30 +0000 (15:15 +0800)]
ASoC: mediatek: mt6359: fix kselftest error of playback gain

kselftest tries to read/write the default value. The default register
value of playback gain is 0x1F(mute), but max gain we specified is 0x12.
The range of the control is 0x0~0x12 and mute(0x1F) is only used in the
driver internally. To solve the problem, implement a new callback
mt6359_get_playback_volsw to report user configured volume instead of
the register value.

In addition, update max of "Headset Volume" to 0x12, so it can match the
maximum seen on latest data sheet.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Link: https://lore.kernel.org/r/20230508071532.21665-3-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: mediatek: mt6359: add supply for MTKAIF
Trevor Wu [Mon, 8 May 2023 07:15:29 +0000 (15:15 +0800)]
ASoC: mediatek: mt6359: add supply for MTKAIF

There are three output data pins MISO0, MISO1 and MISO2 for mt6359.
UL_SRC should be enabled when MISO0 or MISO1 is used, and UL_SRC_34
should be enabled when MISO2 is used.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Link: https://lore.kernel.org/r/20230508071532.21665-2-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: sof: Improve sof_ipc4_bytes_ext_put function
Paul Olaru [Wed, 3 May 2023 08:10:49 +0000 (11:10 +0300)]
ASoC: sof: Improve sof_ipc4_bytes_ext_put function

The function is improved in the way that if the firmware returns a
validation error on the newly sent bytes, then the kernel will
automatically restore to the old bytes value for a given kcontrol.

This way, if the firmware rejects a data blob then the kernel will also
reject it, instead of saving it for the next suspend/resume cycle. The
old behaviour is that the kernel would save it anyway and on next
firmware boot it would apply the previously-rejected configuration,
leading to errors during playback.

Additionally, the function also saves previously validated
configurations, so that if the firmware does end up rejecting a new
bytes value the kernel can send an old, previously-valid configuration.

Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20230503081049.73847-3-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: sof: Improve sof_ipc3_bytes_ext_put function
Paul Olaru [Wed, 3 May 2023 08:10:48 +0000 (11:10 +0300)]
ASoC: sof: Improve sof_ipc3_bytes_ext_put function

The function is improved in the way that if the firmware returns a
validation error on the newly sent bytes, then the kernel will
automatically restore to the old bytes value for a given kcontrol.

This way, if the firmware rejects a data blob then the kernel will also
reject it, instead of saving it for the next suspend/resume cycle. The
old behaviour is that the kernel would save it anyway and on next
firmware boot it would apply the previously-rejected configuration,
leading to errors during playback.

Additionally, the function also saves previously validated
configurations, so that if the firmware does end up rejecting a new
bytes value the kernel can send an old, previously-valid configuration.

Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20230503081049.73847-2-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: da7219: Add Jack insertion detection polarity
David Rau [Tue, 23 May 2023 16:18:21 +0000 (16:18 +0000)]
ASoC: da7219: Add Jack insertion detection polarity

Add support of selecting insertion detection polarity
- Default polarity (Low)
- Inverted polarity (High)

Correct the keywords of parsing `dlg,jack-det-rate`
bases on the new DT binding.

Signed-off-by: David Rau <David.Rau.opensource@dm.renesas.com>
Link: https://lore.kernel.org/r/20230523161821.4260-4-David.Rau.opensource@dm.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: dt-bindings: da7219: Add jack-ins-det-pty property
David Rau [Tue, 23 May 2023 16:18:20 +0000 (16:18 +0000)]
ASoC: dt-bindings: da7219: Add jack-ins-det-pty property

Add `dlg,jack-ins-det-pty` property for Jack insertion detection
polarity selection.

Signed-off-by: David Rau <David.Rau.opensource@dm.renesas.com>
Link: https://lore.kernel.org/r/20230523161821.4260-3-David.Rau.opensource@dm.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 months agoASoC: dt-bindings: dialog,da7219: convert to dtschema
David Rau [Tue, 23 May 2023 16:18:19 +0000 (16:18 +0000)]
ASoC: dt-bindings: dialog,da7219: convert to dtschema

- Convert Dialog DA7219 bindings to DT schema format.
- Remove unused `dlg,ldo-lvl` property.

Signed-off-by: David Rau <David.Rau.opensource@dm.renesas.com>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20230523161821.4260-2-David.Rau.opensource@dm.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>