linux-2.6-block.git
5 months agoASoC: codecs: rk3308: fix building without CONFIG_OF
Arnd Bergmann [Thu, 4 Apr 2024 09:57:34 +0000 (11:57 +0200)]
ASoC: codecs: rk3308: fix building without CONFIG_OF

The newly added codec has an extraneous of_match_ptr() annotation for
the ID table:

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

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

Fixes: 4ed0915f5bc4 ("ASoC: codecs: Add RK3308 internal audio codec driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://msgid.link/r/20240404095755.650364-1-arnd@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoALSA: cirrus: Tidy up of firmware control read/write
Mark Brown [Wed, 3 Apr 2024 19:45:32 +0000 (20:45 +0100)]
ALSA: cirrus: Tidy up of firmware control read/write

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

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

base-commit: f193957b0fbbba397c8bddedf158b3bf7e4850fc

5 months agoASoC: codecs: rk3308: fix build warning without OF
Mark Brown [Wed, 3 Apr 2024 17:56:57 +0000 (18:56 +0100)]
ASoC: codecs: rk3308: fix build warning without OF

Merge series from Luca Ceresoli <luca.ceresoli@bootlin.com>:

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

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

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

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

Best regards,
--
Luca Ceresoli <luca.ceresoli@bootlin.com>

5 months agoASoC: SOF: Intel: mtl/lnl: Improve firmware boot state
Mark Brown [Wed, 3 Apr 2024 15:28:31 +0000 (16:28 +0100)]
ASoC: SOF: Intel: mtl/lnl: Improve firmware boot state

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

This series improves the firmware/boot state handling which will allow
failed IMR boot recovery and human readable boot failure decoding.

Additionally a new debugfs file is added to force a purge/clean boot
of the DSP for developers.

5 months agoALSA: hda: hda_cs_dsp_ctl: Remove notification of driver write
Simon Trimmer [Mon, 25 Mar 2024 11:31:27 +0000 (11:31 +0000)]
ALSA: hda: hda_cs_dsp_ctl: Remove notification of driver write

Any control that the driver is updating should be marked as SYSTEM and
therefore will not have an ALSA control to notify.

Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://msgid.link/r/20240325113127.112783-6-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: wm_adsp: Remove notification of driver write
Simon Trimmer [Mon, 25 Mar 2024 11:31:26 +0000 (11:31 +0000)]
ASoC: wm_adsp: Remove notification of driver write

Any control that the driver is updating should be marked as SYSTEM and
therefore will not have an ALSA control to notify.

Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://msgid.link/r/20240325113127.112783-5-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoALSA: hda: hda_cs_dsp_ctl: Use cs_dsp_coeff_lock_and_[read|write]_ctrl()
Simon Trimmer [Mon, 25 Mar 2024 11:31:25 +0000 (11:31 +0000)]
ALSA: hda: hda_cs_dsp_ctl: Use cs_dsp_coeff_lock_and_[read|write]_ctrl()

Using the cs_dsp_coeff_lock_and_[read|write]_ctrl() wrappers tidies
the calling functions as it does not need to manage the DSP pwr_lock.

Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://msgid.link/r/20240325113127.112783-4-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: wm_adsp: Use cs_dsp_coeff_lock_and_[read|write]_ctrl()
Simon Trimmer [Mon, 25 Mar 2024 11:31:24 +0000 (11:31 +0000)]
ASoC: wm_adsp: Use cs_dsp_coeff_lock_and_[read|write]_ctrl()

Using the cs_dsp_coeff_lock_and_[read|write]_ctrl() wrappers tidies
the calling functions as it does not need to manage the DSP pwr_lock.

Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://msgid.link/r/20240325113127.112783-3-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agofirmware: cs_dsp: Add locked wrappers for coeff read and write
Simon Trimmer [Mon, 25 Mar 2024 11:31:23 +0000 (11:31 +0000)]
firmware: cs_dsp: Add locked wrappers for coeff read and write

It is a common pattern for functions to take and release the DSP
pwr_lock over the cs_dsp calls to read and write firmware controls.
Add wrapper functions to do this sequence so that the calling code can
be simplified to a single function call..

Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://msgid.link/r/20240325113127.112783-2-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Merge up fixes
Mark Brown [Wed, 3 Apr 2024 15:07:41 +0000 (16:07 +0100)]
ASoC: Merge up fixes

Some of these, particularly the wm_adsp one in the immediate case, are
needed as a basis for new work.

5 months agoASoC: Merge up left over v6.8 fix
Mark Brown [Wed, 3 Apr 2024 15:03:56 +0000 (16:03 +0100)]
ASoC: Merge up left over v6.8 fix

This v6.8 change didn't make it into the release, send it as a fix for
v6.9.

5 months agoASoC: codecs: rk3308: depend on ARM64 || COMPILE_TEST
Luca Ceresoli [Wed, 3 Apr 2024 11:03:19 +0000 (13:03 +0200)]
ASoC: codecs: rk3308: depend on ARM64 || COMPILE_TEST

This codec is only known to exist in the RK3308 ARM64 SoC, so depend on it
except for compile test cases. Note that the driver won't probe without
CONFIG_OF, but ARM64 selects OF already so it is not needed.

Suggested-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Link: https://msgid.link/r/20240403-rk3308-audio-codec-fix-warning-v2-2-816bae4c1dc5@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: codecs: rk3308: fix "defined but not used" warning on !OF
Luca Ceresoli [Wed, 3 Apr 2024 11:03:18 +0000 (13:03 +0200)]
ASoC: codecs: rk3308: fix "defined but not used" warning on !OF

Building with CONFIG_OF=n triggers:

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

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

Fixes: 9fdd7b45da18 ("arm64: defconfig: enable Rockchip RK3308 internal audio codec driver")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202403271905.BYbGJiPi-lkp@intel.com/
Closes: https://lore.kernel.org/oe-kbuild-all/202403271907.0z0uuG5I-lkp@intel.com/
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Link: https://msgid.link/r/20240403-rk3308-audio-codec-fix-warning-v2-1-816bae4c1dc5@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: SOF: Intel: mtl: Correct the mtl_dsp_dump output
Peter Ujfalusi [Wed, 3 Apr 2024 10:52:10 +0000 (13:52 +0300)]
ASoC: SOF: Intel: mtl: Correct the mtl_dsp_dump output

The ROM/firmware state handling has changed between CAVS and ACE
architecture:
CAVS: ROM and firmware uses the SRAM window for the state and status/error
code reporting

ACE: ROM code is using two registers to report the state and error while
the firmware is using the SRAM window to report states and status/error
codes.

Use the generic hda_dsp_get_state() to decode ROM state and error codes and
print out the firmware state and status/error code only if the SRAM
window is accessible - the firmware is booted and the Status readout is
not 0xffffffff.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Link: https://msgid.link/r/20240403105210.17949-8-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: SOF: Intel: hda-dsp/mtl: Add support for ACE ROM state codes
Peter Ujfalusi [Wed, 3 Apr 2024 10:52:09 +0000 (13:52 +0300)]
ASoC: SOF: Intel: hda-dsp/mtl: Add support for ACE ROM state codes

The ROM state codes differ between CAVS and ACE architecture, there is a
slight overlap.
Add the ACE related state defines to mtl.h, introduce new table and
use it on case the function is called when running on ACE architecture.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Link: https://msgid.link/r/20240403105210.17949-7-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: SOF: Intel: mtl: Implement firmware boot state check
Peter Ujfalusi [Wed, 3 Apr 2024 10:52:08 +0000 (13:52 +0300)]
ASoC: SOF: Intel: mtl: Implement firmware boot state check

With the corrected rom_status_reg values we can now add a check for target
boot status for firmware booting.
With the check now we can identify failed firmware boots (IMR boots) and
we can use the fallback to purge boot the DSP.

Fixes: 064520e8aeaa ("ASoC: SOF: Intel: Add support for MeteorLake (MTL)")
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Link: https://msgid.link/r/20240403105210.17949-6-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: SOF: Intel: mtl: Disable interrupts when firmware boot failed
Peter Ujfalusi [Wed, 3 Apr 2024 10:52:07 +0000 (13:52 +0300)]
ASoC: SOF: Intel: mtl: Disable interrupts when firmware boot failed

In case of error during the firmware boot we need to disable the interrupts
which were enabled as part of the boot sequence.

Fixes: 064520e8aeaa ("ASoC: SOF: Intel: Add support for MeteorLake (MTL)")
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Link: https://msgid.link/r/20240403105210.17949-5-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: SOF: Intel: lnl: Correct rom_status_reg
Peter Ujfalusi [Wed, 3 Apr 2024 10:52:06 +0000 (13:52 +0300)]
ASoC: SOF: Intel: lnl: Correct rom_status_reg

ACE2 architecture changed the place where the ROM updates the status code
from the shared SRAM window (and HFFLGP1QW0 in ACE1) to HFDSC register for
the status and HFDEC (HFDSC + 4) for the error code.

The rom_status_reg is not used on LNL because it was wrongly assigned based
on older platform convention (SRAM window) and it was giving inconsistent
readings.

Add new header file for lnl specific register definitions.

Fixes: 64a63d9914a5 ("ASoC: SOF: Intel: LNL: Add support for Lunarlake platform")
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Link: https://msgid.link/r/20240403105210.17949-4-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: SOF: Intel: mtl: Correct rom_status_reg
Peter Ujfalusi [Wed, 3 Apr 2024 10:52:05 +0000 (13:52 +0300)]
ASoC: SOF: Intel: mtl: Correct rom_status_reg

ACE1 architecture changed the place where the ROM updates the status code
from the shared SRAM window to HFFLGP1QW0 register for the status and
HFFLGP1QW0 + 4 for the error code.

The rom_status_reg is not used on MTL because it was wrongly assigned based
on older platform convention (SRAM window) and it was giving inconsistent
readings.

Fixes: 064520e8aeaa ("ASoC: SOF: Intel: Add support for MeteorLake (MTL)")
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Link: https://msgid.link/r/20240403105210.17949-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: SOF: Intel: hda: Create debugfs file to force a clean DSP boot
Peter Ujfalusi [Wed, 3 Apr 2024 10:52:04 +0000 (13:52 +0300)]
ASoC: SOF: Intel: hda: Create debugfs file to force a clean DSP boot

When IMR boot is supported on a platform it is always going to be used to
boot the DSP unless some catastrophic event happens.
There is no way for a developer to force a clean DSP boot without removing
and re-inserting the modules.

Create a 'skip_imr_boot' debugfs file which can be used to force the
next DSP boot as clean (prune) boot.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240403105210.17949-2-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: avs: rt5682: Constify card_headset_pins
Amadeusz Sławiński [Wed, 3 Apr 2024 09:31:45 +0000 (11:31 +0200)]
ASoC: Intel: avs: rt5682: Constify card_headset_pins

card_headset_pins is never modified, mark it const.

Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://msgid.link/r/20240403093145.3375857-11-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: avs: rt5663: Constify card_headset_pins
Amadeusz Sławiński [Wed, 3 Apr 2024 09:31:44 +0000 (11:31 +0200)]
ASoC: Intel: avs: rt5663: Constify card_headset_pins

card_headset_pins is never modified, mark it const.

Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://msgid.link/r/20240403093145.3375857-10-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: avs: rt298: Constify card_headset_pins
Amadeusz Sławiński [Wed, 3 Apr 2024 09:31:43 +0000 (11:31 +0200)]
ASoC: Intel: avs: rt298: Constify card_headset_pins

card_headset_pins is never modified, mark it const.

Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://msgid.link/r/20240403093145.3375857-9-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: avs: rt286: Constify card_headset_pins
Amadeusz Sławiński [Wed, 3 Apr 2024 09:31:42 +0000 (11:31 +0200)]
ASoC: Intel: avs: rt286: Constify card_headset_pins

card_headset_pins is never modified, mark it const.

Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://msgid.link/r/20240403093145.3375857-8-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: avs: rt274: Constify card_headset_pins
Amadeusz Sławiński [Wed, 3 Apr 2024 09:31:41 +0000 (11:31 +0200)]
ASoC: Intel: avs: rt274: Constify card_headset_pins

card_headset_pins is never modified, mark it const.

Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://msgid.link/r/20240403093145.3375857-7-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: avs: nau8825: Constify card_headset_pins
Amadeusz Sławiński [Wed, 3 Apr 2024 09:31:40 +0000 (11:31 +0200)]
ASoC: Intel: avs: nau8825: Constify card_headset_pins

card_headset_pins is never modified, mark it const.

Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://msgid.link/r/20240403093145.3375857-6-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: avs: es8336: Constify card_headset_pins
Amadeusz Sławiński [Wed, 3 Apr 2024 09:31:39 +0000 (11:31 +0200)]
ASoC: Intel: avs: es8336: Constify card_headset_pins

card_headset_pins is never modified, mark it const.

Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://msgid.link/r/20240403093145.3375857-5-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: avs: hdaudio: Constify probing_link
Amadeusz Sławiński [Wed, 3 Apr 2024 09:31:38 +0000 (11:31 +0200)]
ASoC: Intel: avs: hdaudio: Constify probing_link

probing_link is passed to devm_kmemdup, and is never modified, may as
well mark it const.

Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://msgid.link/r/20240403093145.3375857-4-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: avs: Use devm_kstrdup_const
Amadeusz Sławiński [Wed, 3 Apr 2024 09:31:37 +0000 (11:31 +0200)]
ASoC: Intel: avs: Use devm_kstrdup_const

FW name is constant and we just duplicate it, use const variant of
devm_kstrdup to possibly save a bit of memory.

Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://msgid.link/r/20240403093145.3375857-3-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: avs: hdaudio: Use devm_kstrdup_const
Amadeusz Sławiński [Wed, 3 Apr 2024 09:31:36 +0000 (11:31 +0200)]
ASoC: Intel: avs: hdaudio: Use devm_kstrdup_const

HDA codec name is constant and we just duplicate it, use const variant
of devm_kstrdup to possibly save a bit of memory.

Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://msgid.link/r/20240403093145.3375857-2-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: rsnd: reg cleanup
Mark Brown [Wed, 3 Apr 2024 10:04:23 +0000 (11:04 +0100)]
ASoC: rsnd: reg cleanup

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

These are Renesas Sound driver cleanups for Gen3/Gen4.

5 months agoASoC: SOF: cppcheck fixes and debugfs addition
Mark Brown [Tue, 2 Apr 2024 21:30:44 +0000 (22:30 +0100)]
ASoC: SOF: cppcheck fixes and debugfs addition

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

Small changes with 3 cppcheck fixes and the firmware version now
visible with debugfs instead of only via dmesg logs.

5 months agoASoC: SOF: Intel: improve SoundWire support for
Mark Brown [Tue, 2 Apr 2024 21:19:33 +0000 (22:19 +0100)]
ASoC: SOF: Intel: improve SoundWire support for

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

This patchset contains important updates for SoundWire support.

We initially implemented support for multiple amplifiers on different
links using a single HDaudio DMA transfer. To align with the other OS,
the 'aggregation' is now supported by the firmware. This change in
directions has kernel impacts, since we now have multiple HDaudio DMAs
to program and start, but since there are no platforms released so far
there's no end-user impact.

In addition, the behavior in case of xruns is improved by clearing the
PCM states and better handling of the hw_free case.

Note that the hw_free support will compile but will only be functional
with the companion patch "soundwire: intel: add intel_free_stream() back"
already applied in the SoundWire tree.

5 months agoASoC: Use snd_ctl_find_id_mixer() instead of
Mark Brown [Tue, 2 Apr 2024 21:19:21 +0000 (22:19 +0100)]
ASoC: Use snd_ctl_find_id_mixer() instead of

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

The first two patches change snd_soc_card_get_kcontrol() to use the
core snd_ctl_find_id_mixer() functionality instead of open-coding its
own list walk.

The last patch adds a KUnit test for this, which was tested on the
original and modified code.

5 months agoASoC: codecs: ES8326: solve some hp issues and
Mark Brown [Tue, 2 Apr 2024 20:01:43 +0000 (21:01 +0100)]
ASoC: codecs: ES8326: solve some hp issues and

Merge series from Zhang Yi <zhangyi@everest-semi.com>:

We solved some issues related to headphone detection.And for using
the same configuration in different power conditions,we modified the
clock table

5 months agoASoC: dt-bindings: fsl-asoc-card: convert to YAML
Shengjiu Wang [Mon, 1 Apr 2024 12:54:16 +0000 (20:54 +0800)]
ASoC: dt-bindings: fsl-asoc-card: convert to YAML

Convert the fsl-asoc-card binding to YAML.

When testing dtbs_check, found below compatible strings
are not listed in document:

fsl,imx-sgtl5000
fsl,imx53-cpuvo-sgtl5000
fsl,imx51-babbage-sgtl5000
fsl,imx53-m53evk-sgtl5000
fsl,imx53-qsb-sgtl5000
fsl,imx53-voipac-sgtl5000
fsl,imx6-armadeus-sgtl5000
fsl,imx6-rex-sgtl5000
fsl,imx6-sabreauto-cs42888
fsl,imx6-wandboard-sgtl5000
fsl,imx6dl-nit6xlite-sgtl5000
fsl,imx6q-ba16-sgtl5000
fsl,imx6q-nitrogen6_max-sgtl5000
fsl,imx6q-nitrogen6_som2-sgtl5000
fsl,imx6q-nitrogen6x-sgtl5000
fsl,imx6q-sabrelite-sgtl5000
fsl,imx6q-sabresd-wm8962
fsl,imx6q-udoo-ac97
fsl,imx6q-ventana-sgtl5000
fsl,imx6sl-evk-wm8962
fsl,imx6sx-sdb-mqs
fsl,imx6sx-sdb-wm8962
fsl,imx7d-evk-wm8960
karo,tx53-audio-sgtl5000
tq,imx53-mba53-sgtl5000

So add them in yaml file to pass the test.

Also correct the 'dai-format' to 'format' in document.

For 'audio-routing', the items are not listed. Because
this fsl-asoc-card is generic driver, which supports several
codecs, if list all the items, there will be a long list.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://msgid.link/r/1711976056-19884-3-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: SOF: ipc4-topology: Save the ALH DAI index during hw_params
Ranjani Sridharan [Tue, 2 Apr 2024 15:18:28 +0000 (10:18 -0500)]
ASoC: SOF: ipc4-topology: Save the ALH DAI index during hw_params

The node_id for multi-gateway ALH DAI's get overwritten with the
group_id during the DAI copier's ipc_prepare op. So, save the ALH
dai_index during the BE DAI hw_params in the dai_index field of struct
ipc4_copier and use that to set the device ID in the configuration blob.
This will avoid errors during copier init after an xrun.

Note that the dai_index is typically set in topology for DMIC/SSP, but
it's not used for ALH. Reclaiming this dai_index field to store the
node_id does not generate a conflict with topology-defined values.

Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240402151828.175002-18-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: SOF: pcm: reset all PCM sources in case of xruns
Pierre-Louis Bossart [Tue, 2 Apr 2024 15:18:27 +0000 (10:18 -0500)]
ASoC: SOF: pcm: reset all PCM sources in case of xruns

With the delayed stops, the xrun handling is problematic: the
applications expects everything to be reset but the firmware and DMA
are still in a PAUSED state.

This patch makes sure the prepare while pending_stop is set is
special-cased.

Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Co-developed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240402151828.175002-17-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: SOF: pcm: add pending_stop state variable
Pierre-Louis Bossart [Tue, 2 Apr 2024 15:18:26 +0000 (10:18 -0500)]
ASoC: SOF: pcm: add pending_stop state variable

Add a state variable to keep track of delayed stops, in case
pcm_ops->platform_stop_during_hw_free is set.

This patch should be iso-functionality, possibly removing no-op
cases. The main purpose of this new state variable is to prepare a
follow-up patch to reset all PCM and DMAs in case of stop/prepare xrun
sequences.

Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240402151828.175002-16-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: SOF: pcm: simplify sof_pcm_hw_free() with helper
Pierre-Louis Bossart [Tue, 2 Apr 2024 15:18:25 +0000 (10:18 -0500)]
ASoC: SOF: pcm: simplify sof_pcm_hw_free() with helper

The same sequence is used twice, use common helper.

Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240402151828.175002-15-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: SOF: sof-audio: revisit sof_pcm_stream_free() error handling and logs
Pierre-Louis Bossart [Tue, 2 Apr 2024 15:18:24 +0000 (10:18 -0500)]
ASoC: SOF: sof-audio: revisit sof_pcm_stream_free() error handling and logs

For some reason the existing code stops on the first error, which
potentially leaves the DMA and widgets in a weird state.

Change to free-up all resources even in case of errors.

Also add a more consistent error handling and logs, with the first
error code returned to the caller.

Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240402151828.175002-14-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: SOF: Intel: hda: Clear Soundwire node ID during BE DAI hw_free
Ranjani Sridharan [Tue, 2 Apr 2024 15:18:23 +0000 (10:18 -0500)]
ASoC: SOF: Intel: hda: Clear Soundwire node ID during BE DAI hw_free

When an xrun happens, the BE DAI hw_params doesn't get invoked before
the stream restarts with a prepare. In this case, clearing the node ID
when the DAI widget is freed and unprepared will result in an error when
it is re-initialized. In order to avoid this, move the code to clear the
node ID to the BE DAI hw_free op to keep it balanced with the BE DAI
hw_params.

Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240402151828.175002-13-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: SOF: Intel: hda: move helper to static inline
Pierre-Louis Bossart [Tue, 2 Apr 2024 15:18:22 +0000 (10:18 -0500)]
ASoC: SOF: Intel: hda: move helper to static inline

To allow using widget_to_sdev() in other files, move it as static inline
in shared header file.

Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240402151828.175002-12-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: SOF: IPC4: extend dai_data with node_id
Pierre-Louis Bossart [Tue, 2 Apr 2024 15:18:21 +0000 (10:18 -0500)]
ASoC: SOF: IPC4: extend dai_data with node_id

The node_id value needs to be handled specifically for ALH.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240402151828.175002-11-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: SOF: Intel: hda: extend signature of sdw_hda_dai_hw_params()
Pierre-Louis Bossart [Tue, 2 Apr 2024 15:18:20 +0000 (10:18 -0500)]
ASoC: SOF: Intel: hda: extend signature of sdw_hda_dai_hw_params()

Add intel_alh_id to set the expected gateway node_id in a follow-up
patch.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240402151828.175002-10-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: SOF: Intel: set the DMA TLV device as dai_index
Pierre-Louis Bossart [Tue, 2 Apr 2024 15:18:19 +0000 (10:18 -0500)]
ASoC: SOF: Intel: set the DMA TLV device as dai_index

We've already defined the value for dai_index, let's use it instead of
open-coding the same thing. No functionality change.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240402151828.175002-9-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: SOF: Intel: hda-dai: add helpers to set dai config
Pierre-Louis Bossart [Tue, 2 Apr 2024 15:18:18 +0000 (10:18 -0500)]
ASoC: SOF: Intel: hda-dai: add helpers to set dai config

We need to be able to set the dai config differently for SoundWire.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240402151828.175002-8-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: SOF: Intel: hda-dai: set dma_stream_channel_map device
Bard Liao [Tue, 2 Apr 2024 15:18:17 +0000 (10:18 -0500)]
ASoC: SOF: Intel: hda-dai: set dma_stream_channel_map device

sof_ipc4_dma_config_tlv{} is required for ACE2.x. The patch follow the
convention to set the dma_stream_channel_map.mapping device as
"link_id << 8 | pdi_id".
And the mapping in sof_ipc4_alh_configuration_blob{} should be the same
as dma_stream_channel_map.mapping in sof_ipc4_dma_config{}.
The purposes of device id is to map DMA tlv.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240402151828.175002-7-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: SOF: Intel: hda-dai: set lowest N bits in ch_mask
Bard Liao [Tue, 2 Apr 2024 15:18:16 +0000 (10:18 -0500)]
ASoC: SOF: Intel: hda-dai: set lowest N bits in ch_mask

We always use the lowest N channels of stream. So, set ch_mask to
GENMASK(params_channels(params) - 1, 0).

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240402151828.175002-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: SOF: make dma_config_tlv be an array
Bard Liao [Tue, 2 Apr 2024 15:18:15 +0000 (10:18 -0500)]
ASoC: SOF: make dma_config_tlv be an array

Each stream needs a dma_config_tlv. We will handle multi dma_config_tlv
in the follow up commits.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240402151828.175002-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoRevert "ASoC: SOF: Intel: hda-dai-ops: only allocate/release streams for first CPU...
Bard Liao [Tue, 2 Apr 2024 15:18:14 +0000 (10:18 -0500)]
Revert "ASoC: SOF: Intel: hda-dai-ops: only allocate/release streams for first CPU DAI"

This reverts commit f8ba62ac863c33fc0d8ac3f1270985c2b77f4377.

The SoundWire aggregated solution was to use one DMA on multiple links.
But, the solution changed to use one DMA for each link. It means that
we should assign HDaudio stream_tag for each cpu_dai.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240402151828.175002-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoRevert "ASoC: SOF: Intel: hda-dai-ops: reset device count for SoundWire DAIs"
Bard Liao [Tue, 2 Apr 2024 15:18:13 +0000 (10:18 -0500)]
Revert "ASoC: SOF: Intel: hda-dai-ops: reset device count for SoundWire DAIs"

This reverts commit 699e146d9ebf42ee2a5d4e4e28f7a49c4aef0105.
Don't reset device_count as we will use the multi-gateway firmware
configuration.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240402151828.175002-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: SOF: Intel: hda-dai: fix channel map configuration for aggregated dailink
Pierre-Louis Bossart [Tue, 2 Apr 2024 15:18:12 +0000 (10:18 -0500)]
ASoC: SOF: Intel: hda-dai: fix channel map configuration for aggregated dailink

The existing code derives the channel map used to program the HDaudio
link DMA from the hw_params, but that is not quite right in the case
of aggregation. The code in soc-pcm.c splits the hw_params depending
on the codec_ch_map, and we need to reconstruct the channel-map to
insert the data in the right places.

This issue is seen only on amplifier feedback capture where the data
from the second amplifier was replaced by that of the first amplifier.

Note that the loop iterator of the macro for_each_rtd_cpu_dais() is
reused in a following loop. This is different to all existing usages
of that macro, hence the use of a boolean flag to avoid an access to
an uninitialized variable.

Fixes: 2960ee5c4814 ("ASoC: SOF: Intel: hda-dai: add helpers for SoundWire callbacks")
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240402151828.175002-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: SOF: ipc4-topology: remove shadowed variable
Pierre-Louis Bossart [Tue, 2 Apr 2024 14:59:59 +0000 (09:59 -0500)]
ASoC: SOF: ipc4-topology: remove shadowed variable

Cppcheck reports this:

sound/soc/sof/ipc4-topology.c:569:23: style: Local variable 'sdev'
shadows outer variable [shadowVariable]
  struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(scomp);
                      ^
sound/soc/sof/ipc4-topology.c:512:22: note: Shadowed declaration
 struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(scomp);
                     ^
sound/soc/sof/ipc4-topology.c:569:23: note: Shadow variable
  struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(scomp);
                      ^

Remove shadowed variable.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://msgid.link/r/20240402145959.172619-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: SOF: ipc4-priv: align prototype and function declaration
Pierre-Louis Bossart [Tue, 2 Apr 2024 14:59:58 +0000 (09:59 -0500)]
ASoC: SOF: ipc4-priv: align prototype and function declaration

Somehow instance_id and id were mixed. Align on instance_id for
consistency.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://msgid.link/r/20240402145959.172619-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: SOF: amd: acp-loader: abort firmware download on write error
Pierre-Louis Bossart [Tue, 2 Apr 2024 14:59:57 +0000 (09:59 -0500)]
ASoC: SOF: amd: acp-loader: abort firmware download on write error

cppcheck reports this issue:

sound/soc/sof/amd/acp-loader.c:299:6: style: Variable 'ret' is
reassigned a value before the old one has been
used. [redundantAssignment]
 ret = request_firmware(&adata->fw_dbin, fw_filename, sdev->dev);
     ^
sound/soc/sof/amd/acp-loader.c:289:6: note: ret is assigned
 ret = snd_sof_dsp_block_write(sdev, SOF_FW_BLK_TYPE_IRAM, 0,
     ^
sound/soc/sof/amd/acp-loader.c:299:6: note: ret is overwritten
 ret = request_firmware(&adata->fw_dbin, fw_filename, sdev->dev);
     ^

This behavior is probably unintentional, there's no reason to return
an error for the DRAM but not the IRAM.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://msgid.link/r/20240402145959.172619-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: SOF: ipc4-loader: save FW version info to debugfs
Yong Zhi [Tue, 2 Apr 2024 14:59:56 +0000 (09:59 -0500)]
ASoC: SOF: ipc4-loader: save FW version info to debugfs

To check loaded FW version:

$ hexdump -C /sys/kernel/debug/sof/fw_version
00000000  02 00 07 00 63 00 01 00  00 00 00 00 00 00 00 00  |....c...........|

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Yong Zhi <yong.zhi@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240402145959.172619-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: nau8325: Revise soc_enum structure definition.
Seven Lee [Mon, 1 Apr 2024 10:47:53 +0000 (18:47 +0800)]
ASoC: nau8325: Revise soc_enum structure definition.

This patch is modified nau8325_dac_oversampl_enum enumerated.
Use SOC_VALUE_ENUM instead to hide empty (presumably invalid) options.

Signed-off-by: Seven Lee <wtli@nuvoton.com>
Link: https://msgid.link/r/20240401104753.3432507-1-wtli@nuvoton.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: rsnd: no exception for SCU
Kuninori Morimoto [Tue, 2 Apr 2024 02:24:22 +0000 (02:24 +0000)]
ASoC: rsnd: no exception for SCU

R-Car Gen1 and Gen4 doesn't have SCU, and current driver checks Gen1
(only) on each devices (A). But these drivers are assuming it might be
not enabled after that (B).

/* This driver doesn't support Gen1 at this point */
(A) if (rsnd_is_gen1(priv))
return 0;

(B) node = rsnd_src_of_node(priv);
if (!node)
return 0; /* not used is not error */

Gen4 DT doesn't have these device settings. (A) check doesn't work for
it, but (B) check handling it.
Gen1 DT doesn't have these device settings either, and (A) is handling
it, but (B) only is very enough. (A) is no longer needed.

This patch removes (A)

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://msgid.link/r/87v850a4dl.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: rsnd: R-Car Gen1/Gen2 exception
Kuninori Morimoto [Tue, 2 Apr 2024 02:24:15 +0000 (02:24 +0000)]
ASoC: rsnd: R-Car Gen1/Gen2 exception

Renesas Sound driver is using rsnd_is_genX() macro to handling
difference. We can use "grep rsnd_is_gen" to find-out difference for
each SoC today.

In general, driver uses flag to handling SoC difference. But in Renesas
Sound case, the differences are very specific, if you try to make it
general, the code will become be very complicated.

Some of them can use flag to handling, but we can find-out all diffence
by using "grep rsnd_is_gen" today. It is not so good, but not so bad so
far. So we will keep current style for a while.

This patch cares Gen1/Gen2 exception by using negative handling to makes no
more update for this part when we support Gen5 or later.

- if (rsnd_is_gen3() || rsnd_is_gen4() || rsnd_is_gen5() || ...)
+ if (!rsnd_is_gen1() && !rsnd_is_gen2())

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://msgid.link/r/87wmpga4ds.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: rsnd: rename rsnd_is_e3() to rsnd_is_gen3_e3()
Kuninori Morimoto [Tue, 2 Apr 2024 02:24:09 +0000 (02:24 +0000)]
ASoC: rsnd: rename rsnd_is_e3() to rsnd_is_gen3_e3()

Renesas Sound driver is using rsnd_is_genX() macro to handling
difference. We can use "grep rsnd_is_gen" to find-out difference for
each SoC except rsnd_is_e3(). Let's put same rule for E3 as well.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://msgid.link/r/87y19wa4dy.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: rsnd: don't get resource from ID
Kuninori Morimoto [Tue, 2 Apr 2024 02:24:01 +0000 (02:24 +0000)]
ASoC: rsnd: don't get resource from ID

All SoC has reg-name, no need to support getting resource from ID
any more. Remove it. To get physical address for DMA settings,
it still need to know the index, but it is no longer fixed.
This patch tidyup it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://msgid.link/r/87zfuca4e6.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: rsnd: cleanup regmap table
Kuninori Morimoto [Tue, 2 Apr 2024 02:23:54 +0000 (02:23 +0000)]
ASoC: rsnd: cleanup regmap table

R-Car Sound is using almost same register mapping on each generation,
therefore we can share it. Here indicates some memo/comments.

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

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

Gen4 added new SSI_BUSIF, but it is not used

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

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

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

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

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

Gen2/3 : 0x808
Gen4   : 0xa0c

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Khanh Le <khanh.le.xr@renesas.com>
Link: https://msgid.link/r/871q7obiyt.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: soc-card: Add KUnit test case for snd_soc_card_get_kcontrol
Richard Fitzgerald [Mon, 1 Apr 2024 10:02:10 +0000 (10:02 +0000)]
ASoC: soc-card: Add KUnit test case for snd_soc_card_get_kcontrol

Add a new snd-soc-card KUnit test with a simple test case for
snd_soc_card_get_kcontrol() and snd_soc_card_get_kcontrol_locked().

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://msgid.link/r/20240401100210.61277-4-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: soc-card: Use snd_ctl_find_id_mixer() instead of open-coding
Richard Fitzgerald [Mon, 1 Apr 2024 10:02:09 +0000 (10:02 +0000)]
ASoC: soc-card: Use snd_ctl_find_id_mixer() instead of open-coding

Use the snd_ctl_find_id_mixer[_locked]() wrapper in
snd_soc_card_get_kcontrol[_locked]() instead of open-coding a custom
list walk of the card controls list.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://msgid.link/r/20240401100210.61277-3-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoALSA: control: Introduce snd_ctl_find_id_mixer_locked()
Richard Fitzgerald [Mon, 1 Apr 2024 10:02:08 +0000 (10:02 +0000)]
ALSA: control: Introduce snd_ctl_find_id_mixer_locked()

Adds wrapper function snd_ctl_find_id_mixer_locked(). This is
identical to snd_ctl_find_id_mixer() except that it can be called
from code that is already holding controls_rwsem.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://msgid.link/r/20240401100210.61277-2-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: avs: boards: Add modules description
Amadeusz Sławiński [Tue, 2 Apr 2024 13:06:40 +0000 (15:06 +0200)]
ASoC: Intel: avs: boards: Add modules description

Modpost warns about missing module description, add it.

Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://msgid.link/r/20240402130640.3310999-1-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: codecs: ES8326: Removing the control of ADC_SCALE
Zhang Yi [Tue, 2 Apr 2024 06:20:43 +0000 (14:20 +0800)]
ASoC: codecs: ES8326: Removing the control of ADC_SCALE

We removed the configuration of ES8326_ADC_SCALE
in es8326_jack_detect_handler because user changed
the configuration by snd_controls

Signed-off-by: Zhang Yi <zhangyi@everest-semi.com>
Link: https://msgid.link/r/20240402062043.20608-5-zhangyi@everest-semi.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: codecs: ES8326: Solve a headphone detection issue after suspend and resume
Zhang Yi [Tue, 2 Apr 2024 06:20:42 +0000 (14:20 +0800)]
ASoC: codecs: ES8326: Solve a headphone detection issue after suspend and resume

We got a headphone detection issue after suspend and resume.
And we fixed it by modifying the configuration at es8326_suspend
and invoke es8326_irq at es8326_resume.

Signed-off-by: Zhang Yi <zhangyi@everest-semi.com>
Link: https://msgid.link/r/20240402062043.20608-4-zhangyi@everest-semi.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: codecs: ES8326: modify clock table
Zhang Yi [Tue, 2 Apr 2024 06:20:41 +0000 (14:20 +0800)]
ASoC: codecs: ES8326: modify clock table

We got a digital microphone feature issue. And we fixed it by modifying
the clock table. Also, we changed the marco ES8326_CLK_ON declaration

Signed-off-by: Zhang Yi <zhangyi@everest-semi.com>
Link: https://msgid.link/r/20240402062043.20608-3-zhangyi@everest-semi.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: codecs: ES8326: Solve error interruption issue
Zhang Yi [Tue, 2 Apr 2024 06:20:40 +0000 (14:20 +0800)]
ASoC: codecs: ES8326: Solve error interruption issue

We got an error report about headphone type detection and button detection.
We fixed the headphone type detection error by adjusting the debounce timer
configuration. And we fixed the button detection error by disabling the
button detection feature when the headphone are unplugged and enabling it
when headphone are plugged in.

Signed-off-by: Zhang Yi <zhangyi@everest-semi.com>
Link: https://msgid.link/r/20240402062043.20608-2-zhangyi@everest-semi.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: amd: acp: fix for acp_init function error handling
Vijendar Mukunda [Fri, 29 Mar 2024 05:38:12 +0000 (11:08 +0530)]
ASoC: amd: acp: fix for acp_init function error handling

If acp_init() fails, acp pci driver probe should return error.
Add acp_init() function return value check logic.

Fixes: e61b415515d3 ("ASoC: amd: acp: refactor the acp init and de-init sequence")
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20240329053815.2373979-1-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: nau8325: Modify driver code and dtschema.
Mark Brown [Fri, 29 Mar 2024 01:32:12 +0000 (01:32 +0000)]
ASoC: nau8325: Modify driver code and dtschema.

Merge series from Seven Lee <wtli@nuvoton.com>:

Add a driver for the Nuvoton NAU88325.

5 months agoASoC: Intel: boards: updates for 6.10 - part3
Mark Brown [Fri, 29 Mar 2024 01:32:01 +0000 (01:32 +0000)]
ASoC: Intel: boards: updates for 6.10 - part3

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

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

This cleanup has been done in multiple steps/phases since Fall 2023,
thanks Brent for this contribution!

5 months agoarm64: dts: imx8qxp add asrc and sai
Mark Brown [Fri, 29 Mar 2024 01:31:51 +0000 (01:31 +0000)]
arm64: dts: imx8qxp add asrc and sai

Merge series from Frank Li <Frank.Li@nxp.com>:

Update binding doc to avoid warning.

5 months agoASoC: drop driver owner assignment
Mark Brown [Fri, 29 Mar 2024 01:31:40 +0000 (01:31 +0000)]
ASoC: drop driver owner assignment

Merge series from Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>:

Core for several drivers already sets the driver.owner, so driver does
not need to.  Simplify the drivers.

5 months agoASoC: rt-sdw: fix locking and improve error logs
Mark Brown [Fri, 29 Mar 2024 01:31:29 +0000 (01:31 +0000)]
ASoC: rt-sdw: fix locking and improve error logs

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

Fix a set of problematic locking sequences and update error messages,
tested on SOF/SoundWire platforms.

5 months agoASoC: ops: Fix wraparound for mask in snd_soc_get_volsw
Stephen Lee [Tue, 26 Mar 2024 01:01:31 +0000 (18:01 -0700)]
ASoC: ops: Fix wraparound for mask in snd_soc_get_volsw

In snd_soc_info_volsw(), mask is generated by figuring out the index of
the most significant bit set in max and converting the index to a
bitmask through bit shift 1. Unintended wraparound occurs when max is an
integer value with msb bit set. Since the bit shift value 1 is treated
as an integer type, the left shift operation will wraparound and set
mask to 0 instead of all 1's. In order to fix this, we type cast 1 as
`1ULL` to prevent the wraparound.

Fixes: 7077148fb50a ("ASoC: core: Split ops out of soc-core.c")
Signed-off-by: Stephen Lee <slee08177@gmail.com>
Link: https://msgid.link/r/20240326010131.6211-1-slee08177@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: rt-sdw*: add __func__ to all error logs
Pierre-Louis Bossart [Mon, 25 Mar 2024 22:18:17 +0000 (17:18 -0500)]
ASoC: rt-sdw*: add __func__ to all error logs

The drivers for Realtek SoundWire codecs use similar logs, which is
problematic to analyze problems reported by CI tools, e.g. "Failed to
get private value: 752001 => 0000 ret=-5". It's not uncommon to have
several Realtek devices on the same platform, having the same log
thrown makes support difficult.

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

No functionality change, only error logs are modified.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://msgid.link/r/20240325221817.206465-7-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: rt722-sdca-sdw: fix locking sequence
Pierre-Louis Bossart [Mon, 25 Mar 2024 22:18:16 +0000 (17:18 -0500)]
ASoC: rt722-sdca-sdw: fix locking sequence

The disable_irq_lock protects the 'disable_irq' value, we need to lock
before testing it.

Fixes: a0b7c59ac1a9 ("ASoC: rt722-sdca: fix for JD event handling in ClockStop Mode0")
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Chao Song <chao.song@linux.intel.com>
Link: https://msgid.link/r/20240325221817.206465-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: rt712-sdca-sdw: fix locking sequence
Pierre-Louis Bossart [Mon, 25 Mar 2024 22:18:15 +0000 (17:18 -0500)]
ASoC: rt712-sdca-sdw: fix locking sequence

The disable_irq_lock protects the 'disable_irq' value, we need to lock
before testing it.

Fixes: 7a8735c1551e ("ASoC: rt712-sdca: fix for JD event handling in ClockStop Mode0")
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Chao Song <chao.song@linux.intel.com>
Link: https://msgid.link/r/20240325221817.206465-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: rt711-sdw: fix locking sequence
Pierre-Louis Bossart [Mon, 25 Mar 2024 22:18:14 +0000 (17:18 -0500)]
ASoC: rt711-sdw: fix locking sequence

The disable_irq_lock protects the 'disable_irq' value, we need to lock
before testing it.

Fixes: b69de265bd0e ("ASoC: rt711: fix for JD event handling in ClockStop Mode0")
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Chao Song <chao.song@linux.intel.com>
Link: https://msgid.link/r/20240325221817.206465-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: rt711-sdca: fix locking sequence
Pierre-Louis Bossart [Mon, 25 Mar 2024 22:18:13 +0000 (17:18 -0500)]
ASoC: rt711-sdca: fix locking sequence

The disable_irq_lock protects the 'disable_irq' value, we need to lock
before testing it.

Fixes: 23adeb7056ac ("ASoC: rt711-sdca: fix for JD event handling in ClockStop Mode0")
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Chao Song <chao.song@linux.intel.com>
Link: https://msgid.link/r/20240325221817.206465-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: rt5682-sdw: fix locking sequence
Pierre-Louis Bossart [Mon, 25 Mar 2024 22:18:12 +0000 (17:18 -0500)]
ASoC: rt5682-sdw: fix locking sequence

The disable_irq_lock protects the 'disable_irq' value, we need to lock
before testing it.

Fixes: 02fb23d72720 ("ASoC: rt5682-sdw: fix for JD event handling in ClockStop Mode0")
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Chao Song <chao.song@linux.intel.com>
Link: https://msgid.link/r/20240325221817.206465-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: kirkwood: Fix potential NULL dereference
Aleksandr Mishin [Thu, 28 Mar 2024 17:33:37 +0000 (20:33 +0300)]
ASoC: kirkwood: Fix potential NULL dereference

In kirkwood_dma_hw_params() mv_mbus_dram_info() returns NULL if
CONFIG_PLAT_ORION macro is not defined.
Fix this bug by adding NULL check.

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

Fixes: bb6a40fc5a83 ("ASoC: kirkwood: Fix reference to PCM buffer address")
Signed-off-by: Aleksandr Mishin <amishin@t-argos.ru>
Link: https://msgid.link/r/20240328173337.21406-1-amishin@t-argos.ru
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: dt-bindings: fsl-sai: allow only one dma-names
Frank Li [Thu, 28 Mar 2024 14:51:35 +0000 (10:51 -0400)]
ASoC: dt-bindings: fsl-sai: allow only one dma-names

Some sai only connect one direction dma (rx/tx) in SOC. For example:
imx8qxp sai5 only connect tx dma channel. So allow only one "rx" or "tx"
for dma-names.

Remove description under dmas because no user use index to get dma channel.
All user use 'dma-names' to get correct dma channel. dma-names already in
'required' list.

Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Frank Li <Frank.Li@nxp.com>
Link: https://msgid.link/r/20240328-asrc_8qxp-v8-3-801cd6bb5be2@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: dt-bindings: fsl,imx-asrc: update max interrupt numbers
Frank Li [Thu, 28 Mar 2024 14:51:34 +0000 (10:51 -0400)]
ASoC: dt-bindings: fsl,imx-asrc: update max interrupt numbers

fsl,imx8qxp-spdif and fsl,imx8qm-spdif have 2 interrupts. Other platforms
have 1 interrupt.

Increase max interrupt number to 2 and add restriction for platforms except
i.MX8QXP and i.MX8QM.

Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Frank Li <Frank.Li@nxp.com>
Link: https://msgid.link/r/20240328-asrc_8qxp-v8-2-801cd6bb5be2@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: dt-bindings: fsl,imx-asrc/spdif: Add power-domains property
Frank Li [Thu, 28 Mar 2024 14:51:33 +0000 (10:51 -0400)]
ASoC: dt-bindings: fsl,imx-asrc/spdif: Add power-domains property

Add power-domains property for asrc and spdif since fsl,imx8qm-asrc/spdif
and fsl,imx8qxp-asrc/spdif require 'power-domains'.

Set 'power-domains' as required property for compatible string
fsl,imx8qm-asrc/spdif and fsl,imx8qxp-asrc/spdif.

Acked-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Frank Li <Frank.Li@nxp.com>
Link: https://msgid.link/r/20240328-asrc_8qxp-v8-1-801cd6bb5be2@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: nau8325: new driver
Seven Lee [Wed, 27 Mar 2024 07:57:55 +0000 (15:57 +0800)]
ASoC: nau8325: new driver

The driver is for amplifiers NAU8325 of Nuvoton Technology Corporation.
The NAU8325 is a stereo high efficiency filter-free Class-D audio
amplifier, which is capable of driving a 4ohm load with up to 3W output
power.

Signed-off-by: Seven Lee <wtli@nuvoton.com>
Link: https://msgid.link/r/20240327075755.3410381-3-wtli@nuvoton.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: dt-bindings: Added schema for "nuvoton,nau8325"
Seven Lee [Wed, 27 Mar 2024 07:57:54 +0000 (15:57 +0800)]
ASoC: dt-bindings: Added schema for "nuvoton,nau8325"

Add a DT schema for describing nau8325 audio amplifiers. The key features
are as follows:
  - Low SPK_VDD Quiescent Current
  - Gain Setting with 2-wire interface
  - Powerful Stereo Class-D Amplifier
  - Low Output Noise
  - Low Current Shutdown Mode
  - Click-and Pop Suppression

More resources :
https://www.nuvoton.com/products/smart-home-audio/audio-amplifiers/class-d-series/nau8325yg/

Signed-off-by: Seven Lee <wtli@nuvoton.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://msgid.link/r/20240327075755.3410381-2-wtli@nuvoton.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_cs42l42: add mtl_cs42l42_def for mtl boards
Brent Lu [Wed, 27 Mar 2024 16:24:08 +0000 (11:24 -0500)]
ASoC: Intel: sof_cs42l42: add mtl_cs42l42_def for mtl boards

Add the board config mtl_cs42l42_def to cs42l42 machine driver for all
mtl boards using default SSP port allocation (headphone codec on SSP2,
speaker amplifiers on SSP0, and BT offload on SSP1).

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327162408.63953-19-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_cs42l42: add rpl_cs42l42_def for rpl boards
Brent Lu [Wed, 27 Mar 2024 16:24:07 +0000 (11:24 -0500)]
ASoC: Intel: sof_cs42l42: add rpl_cs42l42_def for rpl boards

Add the board config rpl_cs42l42_def to cs42l42 machine driver for all
rpl boards using default SSP port allocation (headphone codec on SSP0,
speaker amplifiers on SSP1, and BT offload on SSP2).

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327162408.63953-18-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_cs42l42: mach cleanup for adl boards
Brent Lu [Wed, 27 Mar 2024 16:24:06 +0000 (11:24 -0500)]
ASoC: Intel: sof_cs42l42: mach cleanup for adl boards

Add a common entry in enumeration table for all cs42l42 boards
with/without speaker amplifier. All other adl_cs42l42_def entries
become redundant so get removed.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327162408.63953-17-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_cs42l42: board id cleanup for adl boards
Brent Lu [Wed, 27 Mar 2024 16:24:05 +0000 (11:24 -0500)]
ASoC: Intel: sof_cs42l42: board id cleanup for adl boards

Introduce "adl_cs42l42_def" for adl boards which implement headphone
codec on SSP0 and speaker amplifiers on SSP1.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327162408.63953-16-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_rt5682: mach cleanup for mtl boards
Brent Lu [Wed, 27 Mar 2024 16:24:04 +0000 (11:24 -0500)]
ASoC: Intel: sof_rt5682: mach cleanup for mtl boards

Add two common entries in enumeration table for all rt5682/rt5650
boards with/without speaker amplifier. All other mtl_rt5682_def
entries become redundant so get removed.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327162408.63953-15-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_rt5682: mach cleanup for rpl boards
Brent Lu [Wed, 27 Mar 2024 16:24:03 +0000 (11:24 -0500)]
ASoC: Intel: sof_rt5682: mach cleanup for rpl boards

Add two common entries in enumeration table for all rt5682/rt5650
boards with/without speaker amplifier. All other rpl_rt5682_def
entries become redundant so get removed.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327162408.63953-14-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_rt5682: mach cleanup for adl boards
Brent Lu [Wed, 27 Mar 2024 16:24:02 +0000 (11:24 -0500)]
ASoC: Intel: sof_rt5682: mach cleanup for adl boards

Add two common entries in enumeration table for all rt5682/rt5650
boards with/without speaker amplifier. All other adl_rt5682_def
entries become redundant so get removed.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327162408.63953-13-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_rt5682: mach cleanup for tgl boards
Brent Lu [Wed, 27 Mar 2024 16:24:01 +0000 (11:24 -0500)]
ASoC: Intel: sof_rt5682: mach cleanup for tgl boards

Add a common entry in enumeration table for all rt5682 boards
with/without speaker amplifier. All other tgl_rt5682_def entries
become redundant so get removed.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327162408.63953-12-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_nau8825: add mtl_nau8825_def for mtl boards
Brent Lu [Wed, 27 Mar 2024 16:24:00 +0000 (11:24 -0500)]
ASoC: Intel: sof_nau8825: add mtl_nau8825_def for mtl boards

Add the board config mtl_nau8825_def to nau8825 machine driver for all
mtl boards using default SSP port allocation (headphone codec on SSP2,
speaker amplifiers on SSP0, and BT offload on SSP1).

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327162408.63953-11-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_nau8825: mach cleanup for rpl boards
Brent Lu [Wed, 27 Mar 2024 16:23:59 +0000 (11:23 -0500)]
ASoC: Intel: sof_nau8825: mach cleanup for rpl boards

Add a common entry in enumeration table for all nau8825 boards
with/without speaker amplifier. All other rpl_nau8825_def entries
become redundant so get removed.

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