linux-2.6-microblaze.git
12 months agoASoC: Intel: common: add ACPI matching tables for Arrow Lake
Arun T [Fri, 15 Sep 2023 08:06:35 +0000 (16:06 +0800)]
ASoC: Intel: common: add ACPI matching tables for Arrow Lake

Initial support for ARL w/ RT711

Signed-off-by: Arun T <arun.t@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230915080635.1619942-1-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: SOF: ipc4: Fixup dailink format based on copier
Mark Brown [Fri, 15 Sep 2023 20:16:37 +0000 (21:16 +0100)]
ASoC: SOF: ipc4: Fixup dailink format based on copier

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

If the copier supports a single format on the DAI side we should fixup the BE
dailink to use this single format.

12 months agoASoC: intel: sof_sdw: Remove large global CPUs array
Mark Brown [Fri, 15 Sep 2023 18:03:43 +0000 (19:03 +0100)]
ASoC: intel: sof_sdw: Remove large global CPUs array

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

Rather than keeping a single array of CPU dai link components allocate a
smaller one for each DAI link, this reduces the amount of state that
needs to be passed back and forth in the driver.

12 months agoASoC: SOF: ipc4/Intel: Implement split fw library
Mark Brown [Fri, 15 Sep 2023 18:03:35 +0000 (19:03 +0100)]
ASoC: SOF: ipc4/Intel: Implement split fw library

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

This series implements support for split library loading to comply with the HDA
DMA programming sequence recommendation, which is:
1. DSP side DMA programming and GEN bit set to 1
2. host side DMA programming and RUN bit set to 1

The SOF support for library loading is based on this sequence, backwards
compatibility with older reference firmware is supported (where only the
LOAD_LIBRARY message is supported).

12 months agoASoC: cs35l56: Define and export I2C/SPI pm_ops only
Mark Brown [Fri, 15 Sep 2023 18:03:27 +0000 (19:03 +0100)]
ASoC: cs35l56: Define and export I2C/SPI pm_ops only

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

These 3 patches update the pm_ops for I2C/SPI so that they are only built
and exported if they are needed.

12 months agoASoC: Intel: machine driver update
Mark Brown [Fri, 15 Sep 2023 18:03:19 +0000 (19:03 +0100)]
ASoC: Intel: machine driver update

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

Some cleanups from Brent Lu for I2S platforms. And minor additions for
RVPs and Chromebooks.

12 months agoASoC: Intel: sof_da7219: use ssp-common module to detect codec
Brent Lu [Fri, 15 Sep 2023 12:48:52 +0000 (20:48 +0800)]
ASoC: Intel: sof_da7219: use ssp-common module to detect codec

Use ssp-common module to detect codec and amplifier type in driver
probe function and remove all quirks about amplifier type.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230915124852.1696857-20-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: Intel: sof_da7219: add adl_mx98360_da7219 board config
Brent Lu [Fri, 15 Sep 2023 12:48:51 +0000 (20:48 +0800)]
ASoC: Intel: sof_da7219: add adl_mx98360_da7219 board config

This configuration supports ADL boards which implement DA7219 on SSP0
and MAX98360A on SSP1. DA7219 uses PLL bypass mode to avoid WCLK
locking problem. To use this mode, MCLK frequency must be 12.288 or
24.576MHz.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230915124852.1696857-19-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: Intel: sof_da7219: use maxim-common module
Brent Lu [Fri, 15 Sep 2023 12:48:50 +0000 (20:48 +0800)]
ASoC: Intel: sof_da7219: use maxim-common module

Use maxim-common module to handle speaker amp DAI link registration.
No functional change in this commit.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230915124852.1696857-18-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: Intel: sof_da7219: rename driver file and kernel option
Brent Lu [Fri, 15 Sep 2023 12:48:49 +0000 (20:48 +0800)]
ASoC: Intel: sof_da7219: rename driver file and kernel option

Rename the driver file and kernel option to be consistent with other
SOF machine drivers.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230915124852.1696857-17-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: Intel: sof_nau8825: use realtek-common module
Brent Lu [Fri, 15 Sep 2023 12:48:48 +0000 (20:48 +0800)]
ASoC: Intel: sof_nau8825: use realtek-common module

Use realtek-common module to support rt1019p speaker amplifier.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230915124852.1696857-16-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: Intel: sof_nau8825: use nuvoton-common module
Brent Lu [Fri, 15 Sep 2023 12:48:47 +0000 (20:48 +0800)]
ASoC: Intel: sof_nau8825: use nuvoton-common module

Use nuvoton-common module to support nau8318 speaker amplifier.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230915124852.1696857-15-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: Intel: nuvoton-common: support nau8318 amplifier
Brent Lu [Fri, 15 Sep 2023 12:48:46 +0000 (20:48 +0800)]
ASoC: Intel: nuvoton-common: support nau8318 amplifier

Implement nau8318 support code in this common module so it could be
shared between multiple SOF machine drivers.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230915124852.1696857-14-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: Intel: sof_ssp_amp: do not create amp link for nocodec board
Brent Lu [Fri, 15 Sep 2023 12:48:45 +0000 (20:48 +0800)]
ASoC: Intel: sof_ssp_amp: do not create amp link for nocodec board

A BE DAI link for speaker amplifier is always created even a board
quirk specifies there is no amplifier. Modify the driver to check
amplifier type before creating corresponding DAI link.

The topology (sof-tgl-rt1308-hdmi-ssp.m4) which supports HDMI-IN is
using fixed BE ID for each DAI link. Therefore we also uses fixed ID
in machine driver side.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Balamurugan C <balamurugan.c@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230915124852.1696857-13-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: Intel: sof_rt5682: add HDMI_In capture feature support for RPL.
Balamurugan C [Fri, 15 Sep 2023 12:48:44 +0000 (20:48 +0800)]
ASoC: Intel: sof_rt5682: add HDMI_In capture feature support for RPL.

Added HDMI-in capture support for RPL boards. previously it used adl
machines and now its moved into separate match entry.

Signed-off-by: Balamurugan C <balamurugan.c@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230915124852.1696857-12-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: Intel: sof_rt5682: add adl_rt5650 board config
Brent Lu [Fri, 15 Sep 2023 12:48:43 +0000 (20:48 +0800)]
ASoC: Intel: sof_rt5682: add adl_rt5650 board config

This configuration supports ADL boards which implement ALC5650 dual
I2S interface codec. Two DAI links are added: AIF1 (on codec side) for
headphone and AIF2 for speakers.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230915124852.1696857-11-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: Intel: sof_rt5682: Modify number of HDMI to 3 for MTL/Rex devices
Uday M Bhat [Fri, 15 Sep 2023 12:48:42 +0000 (20:48 +0800)]
ASoC: Intel: sof_rt5682: Modify number of HDMI to 3 for MTL/Rex devices

For all MTL/Rex devices, number of HDMI supported is 3.

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
Signed-off-by: Uday M Bhat <uday.m.bhat@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230915124852.1696857-10-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: Intel: sof_rt5682: Add support for Rex with discrete BT offload.
Uday M Bhat [Fri, 15 Sep 2023 12:48:41 +0000 (20:48 +0800)]
ASoC: Intel: sof_rt5682: Add support for Rex with discrete BT offload.

System firmware has included additional audio DMI string
MAX98360_ALC5682I_DISCRETE_I2S_BT for discrete BT offload
supporting devices. Same DMI string match is introduced
in sof_rt5682_quirk_table.

Signed-off-by: Uday M Bhat <uday.m.bhat@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230915124852.1696857-9-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: Intel: sof_nau8825: use ssp-common module to detect codec
Brent Lu [Fri, 15 Sep 2023 12:48:40 +0000 (20:48 +0800)]
ASoC: Intel: sof_nau8825: use ssp-common module to detect codec

Use ssp-common module to detect codec and amplifier type in driver
probe function and remove all quirks about codec and amplifier type.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230915124852.1696857-8-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: Intel: sof_ssp_amp: use ssp-common module to detect codec
Brent Lu [Fri, 15 Sep 2023 12:48:39 +0000 (20:48 +0800)]
ASoC: Intel: sof_ssp_amp: use ssp-common module to detect codec

Use ssp-common module to detect codec and amplifier type in driver
probe function and remove all quirks about codec and amplifier type.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230915124852.1696857-7-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: Intel: sof_cs42l42: use ssp-common module to detect codec
Brent Lu [Fri, 15 Sep 2023 12:48:38 +0000 (20:48 +0800)]
ASoC: Intel: sof_cs42l42: use ssp-common module to detect codec

Use ssp-common module to detect codec and amplifier type in driver
probe function and remove all quirks about codec and amplifier type.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230915124852.1696857-6-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: Intel: sof_rt5682: use ssp-common module to detect codec
Brent Lu [Fri, 15 Sep 2023 12:48:37 +0000 (20:48 +0800)]
ASoC: Intel: sof_rt5682: use ssp-common module to detect codec

Use ssp-common module to detect codec and amplifier type in driver
probe function and remove all quirks about codec and amplifier type.
Due to codec detection feature, we could remove HP Dooly's DMI quirk
safely.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230915124852.1696857-5-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: Intel: use ACPI HID definition in ssp-common
Brent Lu [Fri, 15 Sep 2023 12:48:36 +0000 (20:48 +0800)]
ASoC: Intel: use ACPI HID definition in ssp-common

Use ACPI HID definition in ssp-common header for device name macros.
No functional change here.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230915124852.1696857-4-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: Intel: ssp-common: support codec detection
Brent Lu [Fri, 15 Sep 2023 12:48:35 +0000 (20:48 +0800)]
ASoC: Intel: ssp-common: support codec detection

Create a new common module to host functions which could be shared
among SSP machine drivers. Add functions to detect headphone codec and
speaker amplifier via ACPI system at runtime in order to remove codec
type quirks in machine drivers.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230915124852.1696857-3-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: Intel: sof_rt5682: cleanup unnecessary quirk flag
Brent Lu [Fri, 15 Sep 2023 12:48:34 +0000 (20:48 +0800)]
ASoC: Intel: sof_rt5682: cleanup unnecessary quirk flag

Remove SOF_RT5682_MCLK_24MHZ flag from JSL and CML/WHL board configs
since the information could be retrieved from SOF API. The macro
itself is removed as well.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230915124852.1696857-2-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: intel: sof_sdw: Increment be_id in init_dai_link
Charles Keepax [Fri, 15 Sep 2023 07:56:11 +0000 (15:56 +0800)]
ASoC: intel: sof_sdw: Increment be_id in init_dai_link

Rather than incrementing the ID for the dai_links in many places
throughout the code, just increment it each time we initialise a new DAI
link.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230915075611.1619548-5-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: intel: sof_sdw: Make create_sdw_dailink allocate link components
Charles Keepax [Fri, 15 Sep 2023 07:56:10 +0000 (15:56 +0800)]
ASoC: intel: sof_sdw: Make create_sdw_dailink allocate link components

Now only the SoundWire part of the code uses the global cpus array,
remove it and have create_sdw_dailink allocate its own link components.
This removes a lot of state being passed around in the driver, which
simplifies things a fair bit.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230915075611.1619548-4-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: intel: sof_sdw: Add simple DAI link creation helper
Charles Keepax [Fri, 15 Sep 2023 07:56:09 +0000 (15:56 +0800)]
ASoC: intel: sof_sdw: Add simple DAI link creation helper

The code contains a fair amount of state tracking and one part of that
is keeping track of which entry in the large global cpus
snd_soc_dai_link_component array is currently in use. Add a helper
function to allocate a simple DAI link, this simplifies the
code slightly and moves us in the direction of eliminating the need for
the large global cpus array. This does slightly increase the number of
allocations done, but this is probe time and the code already does a
large number of allocations so this increase is small over all.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230915075611.1619548-3-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: intel: sof_sdw: Move sdw_pin_index into private struct
Charles Keepax [Fri, 15 Sep 2023 07:56:08 +0000 (15:56 +0800)]
ASoC: intel: sof_sdw: Move sdw_pin_index into private struct

Whilst it should not cause any issues as only a single instance of the
machine will be instantiated, it is still slightly better practice to
keep working data in the private data structure, rather than a global
variable. Move sdw_pin_index into the mc_private structure.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230915075611.1619548-2-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: amd: ps: Fix -Wformat-truncation warning
Takashi Iwai [Fri, 15 Sep 2023 08:22:07 +0000 (10:22 +0200)]
ASoC: amd: ps: Fix -Wformat-truncation warning

The compile warning with -Wformat-truncation at
sdw_amd_scan_controller() is false-positive; the max loop size is
AMD_SDW_MAX_MANAGERS (= 2), hence it fits with the given size.

For suppressing the warning, replace snprintf() with scnprintf().
As stated in the above, truncation doesn't matter.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20230915082207.26200-1-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: rt1015: fix the first word being cut off
Shuming Fan [Fri, 15 Sep 2023 02:05:30 +0000 (10:05 +0800)]
ASoC: rt1015: fix the first word being cut off

This patch adds a control that there are four options to control the digital volume output.
The user could select "immediate" to make volume updates immediately.
In default, the driver selects the volume update with "zero detection + soft inc/dec change".

Signed-off-by: Shuming Fan <shumingf@realtek.com>
Link: https://lore.kernel.org/r/20230915020530.83452-1-shumingf@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: SOF: Intel: hda-loader: Add support for split library loading
Peter Ujfalusi [Fri, 15 Sep 2023 11:40:18 +0000 (14:40 +0300)]
ASoC: SOF: Intel: hda-loader: Add support for split library loading

There is a certain sequence needs to be followed when configuring the HDA
DMA in host and DSP.
The firmware provides a way to handle this two stage sequencing by
splitting the library loading into two stage:
1st stage: LOAD_LIBRARY_PREPARE message
           the lib_id is 0, used to configure the DMA on DSP side
2nd stage: LOAD_LIBRARY message
           both dma_id and lib_id is valid, used for the actual transfer of
           the library

In case a firmware without support for this two stage loading is used then
the second stage message will trigger the loading and the first stage will
return with error, which is ignored by the kernel.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Chao Song <chao.song@linux.intel.com>
Link: https://lore.kernel.org/r/20230915114018.1701-5-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: SOF: ipc4: Add new message type: SOF_IPC4_GLB_LOAD_LIBRARY_PREPARE
Peter Ujfalusi [Fri, 15 Sep 2023 11:40:17 +0000 (14:40 +0300)]
ASoC: SOF: ipc4: Add new message type: SOF_IPC4_GLB_LOAD_LIBRARY_PREPARE

On Intel platforms there is a strict order requirement for the DMA
programming:
DSP side configures the buffer and sets the GEN bit
Host side sets the RUN bit.

In order to follow this flow, a new global message type has been added to
prepare the DSP side of the DMA:

host sends LOAD_LIBRARY_PREPARE with the dma_id
DSP side sets its buffer and sets the GEN bit
Host sets the RUN bit
Host sends LOAD_LIBRARY with dma_id and lib_id
DSP receives the library data.

It is up to the platform code to use the new prepare stage message and how
to handle the reply to it from the firmware, which can indicate that the
message type is not supported/handled.
In this case the kernel should proceed to the LOAD_LIBRARY stage assuming
a single stage library loading:

host sends LOAD_LIBRARY_PREPARE with the dma_id
DSP replies that the message type is not supported/handled
Host acknowledges the return code and sets the RUN bit
Host sends LOAD_LIBRARY with dma_id and lib_id
DSP receives the library data.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Chao Song <chao.song@linux.intel.com>
Link: https://lore.kernel.org/r/20230915114018.1701-4-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: SOF: Intel: hda: Add definition for SDxFIFOS.FIFOS mask
Peter Ujfalusi [Fri, 15 Sep 2023 11:40:16 +0000 (14:40 +0300)]
ASoC: SOF: Intel: hda: Add definition for SDxFIFOS.FIFOS mask

The FIFOS (FIFO Size) field is in bit 0-15 of the register.
Use the defined mask instead of a magic number for the FIFOS value
masking in hda_dsp_stream_hw_params().

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Chao Song <chao.song@linux.intel.com>
Link: https://lore.kernel.org/r/20230915114018.1701-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: SOF: ipc4: Convert status code 2 and 15 to -EOPNOTSUPP
Peter Ujfalusi [Fri, 15 Sep 2023 11:40:15 +0000 (14:40 +0300)]
ASoC: SOF: ipc4: Convert status code 2 and 15 to -EOPNOTSUPP

The status code 2 and 15 can be translated to -EOPNOTSUPP, so convert them
to a meaningful error number.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Chao Song <chao.song@linux.intel.com>
Link: https://lore.kernel.org/r/20230915114018.1701-2-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: SOF: ipc4-pcm: fixup dailink based on copier format
Bard Liao [Fri, 15 Sep 2023 09:35:07 +0000 (12:35 +0300)]
ASoC: SOF: ipc4-pcm: fixup dailink based on copier format

When a copier exposes a single format, we can fixup the BE dailink with
that format. This is helpful when some codec have format restrictions and
e.g. don't support a 32-bit format. In that case, the copier output
formats mirror that restriction in the topology file.

An alternate solution was suggested earlier using a dedicated topology
token. When specified, the token would be used to fix-up the dailink. The
main reason why this solution was chosen is that there is a risk of a
disconnect between token definition and copier format. With a single piece
of information as suggested in this patch, there are fewer risks of a bad
configuration.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230915093507.7242-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: SOF: ipc4-topology: export sof_ipc4_copier_is_single_format
Bard Liao [Fri, 15 Sep 2023 09:35:06 +0000 (12:35 +0300)]
ASoC: SOF: ipc4-topology: export sof_ipc4_copier_is_single_format

We will use the sof_ipc4_copier_is_single_format() function to check if a
ipc4 copier has single format available in ipc4-pcm.c in the next patch.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230915093507.7242-2-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: cs35l56: Omit cs35l56_pm_ops_i2c_spi if I2C/SPI not enabled
Richard Fitzgerald [Thu, 14 Sep 2023 15:09:18 +0000 (16:09 +0100)]
ASoC: cs35l56: Omit cs35l56_pm_ops_i2c_spi if I2C/SPI not enabled

The cs35l56_pm_ops_i2c_spi struct is only needed if either the
I2C or SPI modules are selected for building. Otherwise it would
be unused bytes, so in that case omit it.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230914150918.14505-4-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: cs35l56: Use new export macro for dev_pm_ops
Richard Fitzgerald [Thu, 14 Sep 2023 15:09:17 +0000 (16:09 +0100)]
ASoC: cs35l56: Use new export macro for dev_pm_ops

pm.h now has macros to create and export the dev_pm_ops struct
only if CONFIG_PM is enabled.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230914150918.14505-3-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: cs35l56: Use pm_ptr()
Richard Fitzgerald [Thu, 14 Sep 2023 15:09:16 +0000 (16:09 +0100)]
ASoC: cs35l56: Use pm_ptr()

Use pm_ptr() when setting the pointer to the dev_pm_ops so that it
will be NULL if CONFIG_PM is disabled. This allows the dev_pm_ops to be
compiled out in that case.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230914150918.14505-2-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: SOF: ipc4-topology: Add deep buffer size to debug prints
Yong Zhi [Thu, 14 Sep 2023 13:03:03 +0000 (16:03 +0300)]
ASoC: SOF: ipc4-topology: Add deep buffer size to debug prints

Print deep_buffer_dma_ms and dma_buffer_size for debug purpose.

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230914130303.13636-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: SOF: ipc4: Dump the payload also when set_get_data fails
Peter Ujfalusi [Thu, 14 Sep 2023 12:51:15 +0000 (15:51 +0300)]
ASoC: SOF: ipc4: Dump the payload also when set_get_data fails

Move the out label to dump the message payload when the IPC message fails.
The payload contains important information on what might have caused the
error in firmware.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230914125115.30904-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: SOF: ops.h: Change the error code for not supported to EOPNOTSUPP
Peter Ujfalusi [Thu, 14 Sep 2023 12:49:43 +0000 (15:49 +0300)]
ASoC: SOF: ops.h: Change the error code for not supported to EOPNOTSUPP

New code uses ENOTSUPP as per checkpatch recommendation:
ENOTSUPP is not a SUSV4 error code, prefer EOPNOTSUPP

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Link: https://lore.kernel.org/r/20230914124943.24399-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: amd: acp: Fix -Wmissing-prototypes warning
Marian Postevca [Wed, 13 Sep 2023 21:09:16 +0000 (00:09 +0300)]
ASoC: amd: acp: Fix -Wmissing-prototypes warning

Fix prototype missing warning for acp3x_es83xx_init_ops() by
including the header acp3x-es83xx.h

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202309111220.g63yHDfH-lkp@intel.com/
Signed-off-by: Marian Postevca <posteuca@mutex.one>
Link: https://lore.kernel.org/r/20230913210916.2523-1-posteuca@mutex.one
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: cs35l56: Use PCI SSID to select specific
Mark Brown [Wed, 13 Sep 2023 20:48:57 +0000 (21:48 +0100)]
ASoC: cs35l56: Use PCI SSID to select specific

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

The PCI device registers contain a subsystem ID (SSID), that is
separate from the silicon ID. The PCI specification defines it thus:

"They provide a mechanism for board vendors to distiguish their
 boards from one another even thought the boards may have the same
 PCI controller on them."

This allows the driver for the silicon part to apply board-speficic
settings based on this SSID.

The CS35L56 driver uses this to select the correct firmware file for
the board. The actual ID is part of the PCI register set of the
host audio interface so this set of patches includes extracting the
SSID from the Intel audio controller and passing it to the machine
driver and then to ASoC components. Other PCI audio controllers
will have the same SSID registers, so can use the same mechanism to
pass the SSID.

12 months agoASoC: nau8821: Revise MICBIAS control for power saving.
Seven Lee [Wed, 13 Sep 2023 06:40:03 +0000 (14:40 +0800)]
ASoC: nau8821: Revise MICBIAS control for power saving.

The patch helps save power by control MICBIAS. The headset's
MICBIAS should be disabled without button requirement.

Signed-off-by: Seven Lee <wtli@nuvoton.com>
Link: https://lore.kernel.org/r/20230913064003.2925997-1-wtli@nuvoton.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: hdac_hdmi: Remove temporary string use in create_fill_jack_kcontrols
Peter Ujfalusi [Wed, 13 Sep 2023 09:13:25 +0000 (12:13 +0300)]
ASoC: hdac_hdmi: Remove temporary string use in create_fill_jack_kcontrols

There is no need to use temporary strings to construct the kcontrol names,
devm_kasprintf can be used to replace the snprintf + devm_kstrdup pairs.

This change will also fixes the following compiler warning/error (W=1):

sound/soc/codecs/hdac_hdmi.c: In function â€˜hdac_hdmi_jack_port_init’:
sound/soc/codecs/hdac_hdmi.c:1793:63: error: â€˜ Switch’ directive output may be truncated writing 7 bytes into a region of size between 1 and 32 [-Werror=format-truncation=]
 1793 |                         snprintf(kc_name, sizeof(kc_name), "%s Switch", xname);
      |                                                               ^~~~~~~
In function â€˜create_fill_jack_kcontrols’,
    inlined from â€˜hdac_hdmi_jack_port_init’ at sound/soc/codecs/hdac_hdmi.c:1871:8:
sound/soc/codecs/hdac_hdmi.c:1793:25: note: â€˜snprintf’ output between 8 and 39 bytes into a destination of size 32
 1793 |                         snprintf(kc_name, sizeof(kc_name), "%s Switch", xname);
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

The warnings got brought to light by a recent patch upstream:
commit 6d4ab2e97dcf ("extrawarn: enable format and stringop overflow warnings in W=1")

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230913091325.16877-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: cs35l56: Use PCI SSID as the firmware UID
Richard Fitzgerald [Tue, 12 Sep 2023 16:32:07 +0000 (17:32 +0100)]
ASoC: cs35l56: Use PCI SSID as the firmware UID

If the driver properties do not define a cirrus,firmware-uid try to get the
PCI SSID as the UID.

On PCI-based systems the PCI SSID is used to uniquely identify the specific
sound hardware. This is the standard mechanism for x86 systems and is the
way to get a unique system identifier for systems that use the CS35L56 on
SoundWire.

For non-SoundWire systems there is no Windows equivalent of the ASoC driver
in I2C/SPI mode. These would be:

1. HDA systems, which are handled by the HDA subsystem.
2. Linux-specific systems.
3. Composite devices where the cs35l56 is not present in ACPI and is
   configured using software nodes.

Case 2 can use the firmware-uid property, though the PCI SSID is supported
as an alternative, as it is the standard PCI mechanism.

Case 3 is a SoundWire system where some other codec is the SoundWire bridge
device and CS35L56 is not listed in ACPI. As these are SoundWire systems
they will normally use the PCI SSID.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230912163207.3498161-5-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: Intel: sof_sdw: Copy PCI SSID to struct snd_soc_card
Richard Fitzgerald [Tue, 12 Sep 2023 16:32:06 +0000 (17:32 +0100)]
ASoC: Intel: sof_sdw: Copy PCI SSID to struct snd_soc_card

If the PCI SSID has been set in the struct snd_soc_acpi_mach_params,
copy this to struct snd_soc_card so that it can be used by other
ASoC components.

This is important for components that must apply system-specific
configuration.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230912163207.3498161-4-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: SOF: Pass PCI SSID to machine driver
Richard Fitzgerald [Tue, 12 Sep 2023 16:32:05 +0000 (17:32 +0100)]
ASoC: SOF: Pass PCI SSID to machine driver

Pass the PCI SSID of the audio interface through to the machine driver.
This allows the machine driver to use the SSID to uniquely identify the
specific hardware configuration and apply any platform-specific
configuration.

struct snd_sof_pdata is passed around inside the SOF code, but it then
passes configuration information to the machine driver through
struct snd_soc_acpi_mach and struct snd_soc_acpi_mach_params. So SSID
information has been added to both snd_sof_pdata and
snd_soc_acpi_mach_params.

PCI does not define 0x0000 as an invalid value so we can't use zero to
indicate that the struct member was not written. Instead a flag is
included to indicate that a value has been written to the
subsystem_vendor and subsystem_device members.

sof_pci_probe() creates the struct snd_sof_pdata. It is passed a struct
pci_dev so it can fill in the SSID value.

sof_machine_check() finds the appropriate struct snd_soc_acpi_mach. It
copies the SSID information across to the struct snd_soc_acpi_mach_params.
This done before calling any custom set_mach_params() so that it could be
used by the set_mach_params() callback to apply variant params.

The machine driver receives the struct snd_soc_acpi_mach as its
platform_data.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230912163207.3498161-3-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: soc-card: Add storage for PCI SSID
Richard Fitzgerald [Tue, 12 Sep 2023 16:32:04 +0000 (17:32 +0100)]
ASoC: soc-card: Add storage for PCI SSID

Add members to struct snd_soc_card to store the PCI subsystem ID (SSID)
of the soundcard.

The PCI specification provides two registers to store a vendor-specific
SSID that can be read by drivers to uniquely identify a particular
"soundcard". This is defined in the PCI specification to distinguish
products that use the same silicon (and therefore have the same silicon
ID) so that product-specific differences can be applied.

PCI only defines 0xFFFF as an invalid value. 0x0000 is not defined as
invalid. So the usual pattern of zero-filling the struct and then
assuming a zero value unset will not work. A flag is included to
indicate when the SSID information has been filled in.

Unlike DMI information, which has a free-format entirely up to the vendor,
the PCI SSID has a strictly defined format and a registry of vendor IDs.

It is usual in Windows drivers that the SSID is used as the sole identifier
of the specific end-product and the Windows driver contains tables mapping
that to information about the hardware setup, rather than using ACPI
properties.

This SSID is important information for ASoC components that need to apply
hardware-specific configuration on PCI-based systems.

As the SSID is a generic part of the PCI specification and is treated as
identifying the "soundcard", it is reasonable to include this information
in struct snd_soc_card, instead of components inventing their own custom
ways to pass this information around.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230912163207.3498161-2-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: Merge up fixes
Mark Brown [Tue, 12 Sep 2023 17:41:21 +0000 (18:41 +0100)]
ASoC: Merge up fixes

For the benefit of CI.

12 months agoASoC: rsnd: remove unneeded of_node_put()
Kuninori Morimoto [Mon, 11 Sep 2023 00:45:03 +0000 (00:45 +0000)]
ASoC: rsnd: remove unneeded of_node_put()

The loop is not using "node", of_node_put(node) is not needed.

Cc: Julia Lawall <julia.lawall@inria.fr>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/8734zlilmd.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoSM6115 TX Macro
Mark Brown [Tue, 12 Sep 2023 13:29:55 +0000 (14:29 +0100)]
SM6115 TX Macro

Merge series from Konrad Dybcio <konrad.dybcio@linaro.org>:

Like most Qualcomm SoCs, SM6115 has a TX Macro.

Only some minor changes were required.

12 months agoASoC: amd: yc: Fix non-functional mic on Lenovo 82QF and 82UG
August Wikerfors [Mon, 11 Sep 2023 21:34:09 +0000 (23:34 +0200)]
ASoC: amd: yc: Fix non-functional mic on Lenovo 82QF and 82UG

Like the Lenovo 82TL and 82V2, the Lenovo 82QF (Yoga 7 14ARB7) and 82UG
(Legion S7 16ARHA7) both need a quirk entry for the internal microphone to
function. Commit c008323fe361 ("ASoC: amd: yc: Fix a non-functional mic on
Lenovo 82SJ") restricted the quirk that previously matched "82" to "82V2",
breaking microphone functionality on these devices. Fix this by adding
specific quirks for these models, as was done for the Lenovo 82TL.

Fixes: c008323fe361 ("ASoC: amd: yc: Fix a non-functional mic on Lenovo 82SJ")
Closes: https://github.com/tomsom/yoga-linux/issues/51
Link: https://bugzilla.kernel.org/show_bug.cgi?id=208555#c780
Cc: stable@vger.kernel.org
Signed-off-by: August Wikerfors <git@augustwikerfors.se>
Link: https://lore.kernel.org/r/20230911213409.6106-1-git@augustwikerfors.se
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: Update jh7110 PWM DAC for ops move
Mark Brown [Mon, 11 Sep 2023 22:48:39 +0000 (23:48 +0100)]
ASoC: Update jh7110 PWM DAC for ops move

For some reason the JH7110 PWM DAC driver made it through build testing
in spite of not being updated for the move of probe() to the ops struct.
Make the required update.

Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoMatch data improvements for wm8580 driver
Mark Brown [Mon, 11 Sep 2023 21:39:09 +0000 (22:39 +0100)]
Match data improvements for wm8580 driver

Merge series from Biju Das <biju.das.jz@bp.renesas.com>:

This patch series aims to add match data improvements for wm8580 driver.

This patch series is only compile tested.

12 months agoASoC: Convert some Maxim codecs to use GPIO
Mark Brown [Mon, 11 Sep 2023 21:39:00 +0000 (22:39 +0100)]
ASoC: Convert some Maxim codecs to use GPIO

Merge series from Linus Walleij <linus.walleij@linaro.org>:

The Maxim devices are pretty straight-forward to convert
over to use GPIO descriptors, so let's do it.

12 months agoMatch data improvements for tlv320aic32x4 driver
Mark Brown [Mon, 11 Sep 2023 21:38:52 +0000 (22:38 +0100)]
Match data improvements for tlv320aic32x4 driver

Merge series from Biju Das <biju.das.jz@bp.renesas.com>:

This patch series aims to add match data improvements for tlv320aic32x4
driver.

This patch series is only compile tested.

12 months agoASoC: Convert some Maxim codecs to use GPIO
Mark Brown [Mon, 11 Sep 2023 21:38:44 +0000 (22:38 +0100)]
ASoC: Convert some Maxim codecs to use GPIO

Merge series from Linus Walleij <linus.walleij@linaro.org>:

The Maxim devices are pretty straight-forward to convert
over to use GPIO descriptors, so let's do it.

12 months agoASoC: mt8188-mt6359: add SOF support
Mark Brown [Mon, 11 Sep 2023 21:38:36 +0000 (22:38 +0100)]
ASoC: mt8188-mt6359: add SOF support

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

This series introduces dynamic pinctrl and adds support for the SOF on
the mt8188-mt6359 machine driver.

12 months agoMatch data improvements for ak4642 driver
Mark Brown [Mon, 11 Sep 2023 21:38:28 +0000 (22:38 +0100)]
Match data improvements for ak4642 driver

Merge series from Biju Das <biju.das.jz@bp.renesas.com>:

This patch series aims to add match data improvements for ak4642 driver.

This patch series is only compile tested.

12 months agoASoC: amd: acp: Add sound support for a line of
Mark Brown [Mon, 11 Sep 2023 21:38:20 +0000 (22:38 +0100)]
ASoC: amd: acp: Add sound support for a line of

Merge series from Marian Postevca <posteuca@mutex.one>:

This series adds support for a line of HUAWEI laptops with
AMD CPUs that connect using the ACP3x module to a ES8336 CODEC.

The CODEC driver must be extended to support the S32 LE format
and the MCLK div by 2 option. MCLK div by 2 is needed for one specific
SKU, which uses a 48Mhz MCLK, which seems to be too high of a frequency
for the CODEC and must be divided by 2.

The acp legacy driver must also be extended by using callbacks so that
the more complicated handling of this specific CODEC can be moved
outside the more generic ACP code.

12 months agoImprove CS35l41-based audio codec drivers
Mark Brown [Mon, 11 Sep 2023 21:38:11 +0000 (22:38 +0100)]
Improve CS35l41-based audio codec drivers

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

This patch series contains several fixes and improvements to drivers
based on the CS35l41 audio codec.

It has been verified on Valve's Steam Deck, except the HDA related patches.

12 months agoAdd PWM-DAC audio support for StarFive JH7110
Mark Brown [Mon, 11 Sep 2023 21:37:52 +0000 (22:37 +0100)]
Add PWM-DAC audio support for StarFive JH7110

Merge series from Hal Feng <hal.feng@starfivetech.com>:

This patchset adds PWM-DAC audio support for the StarFive JH7110 SoC.
The PWM-DAC module does not require a hardware codec, but a dummy codec is
needed for the driver. The dummy spdif codec driver, which is already
upstream, is compatible with the one which JH7110 PWM-DAC needed. So we
use it as the dummy codec driver for the JH7110 PWM-DAC module.

12 months agoFix redundant PLLA update
Mark Brown [Mon, 11 Sep 2023 21:21:23 +0000 (22:21 +0100)]
Fix redundant PLLA update

Merge series from Sameer Pujar <spujar@nvidia.com>:

This small series fixes redundant PLLA updates that happen for
each DAI link in the audio path. This helps to resolve DMIC clock
issue seen on Jetson TX2 platform.

12 months agoASoC: fsl: imx-pcm-rpmsg: Add SNDRV_PCM_INFO_BATCH flag
Shengjiu Wang [Mon, 11 Sep 2023 06:38:07 +0000 (14:38 +0800)]
ASoC: fsl: imx-pcm-rpmsg: Add SNDRV_PCM_INFO_BATCH flag

The rpmsg pcm device is a device which should support
double buffering.

Found this issue with pipewire. When there is no
SNDRV_PCM_INFO_BATCH flag in driver, the pipewire will
set headroom to be zero, and because rpmsg pcm device
don't support residue report, when the latency setting
is small, the "delay" always larger than "target" in
alsa-pcm.c, that reading next period data is not
scheduled on time.

With SNDRV_PCM_INFO_BATCH flag in driver, the pipewire
will select a smaller period size for device, then
the task of reading next period data will be scheduled
on time.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1694414287-13291-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoALSA: hda: cs35l41: Consistently use dev_err_probe()
Cristian Ciocaltea [Thu, 7 Sep 2023 17:10:10 +0000 (20:10 +0300)]
ALSA: hda: cs35l41: Consistently use dev_err_probe()

Replace the remaining dev_err() calls in probe() with dev_err_probe(),
to improve consistency.

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20230907171010.1447274-12-cristian.ciocaltea@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoALSA: hda: cs35l41: Undo runtime PM changes at driver exit time
Cristian Ciocaltea [Thu, 7 Sep 2023 17:10:09 +0000 (20:10 +0300)]
ALSA: hda: cs35l41: Undo runtime PM changes at driver exit time

According to the documentation, drivers are responsible for undoing at
removal time all runtime PM changes done during probing.

Hence, add the missing calls to pm_runtime_dont_use_autosuspend(), which
are necessary for undoing pm_runtime_use_autosuspend().

Fixes: 1873ebd30cc8 ("ALSA: hda: cs35l41: Support Hibernation during Suspend")
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20230907171010.1447274-11-cristian.ciocaltea@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoALSA: hda: cs35l41: Fix unbalanced pm_runtime_get()
Cristian Ciocaltea [Thu, 7 Sep 2023 17:10:08 +0000 (20:10 +0300)]
ALSA: hda: cs35l41: Fix unbalanced pm_runtime_get()

If component_add() fails, probe() returns without calling
pm_runtime_put(), which leaves the runtime PM usage counter incremented.

Fix the issue by jumping to err_pm label and drop the now unnecessary
pm_runtime_disable() call.

Fixes: 7b2f3eb492da ("ALSA: hda: cs35l41: Add support for CS35L41 in HDA systems")
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20230907171010.1447274-10-cristian.ciocaltea@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: cs35l41: Use modern pm_ops
Cristian Ciocaltea [Thu, 7 Sep 2023 17:10:07 +0000 (20:10 +0300)]
ASoC: cs35l41: Use modern pm_ops

Make use of the recently introduced EXPORT_GPL_DEV_PM_OPS() macro, to
conditionally export the runtime/system PM functions.

Replace the old SET_{RUNTIME,SYSTEM_SLEEP,NOIRQ_SYSTEM_SLEEP}_PM_OPS()
helpers with their modern alternatives and get rid of the now
unnecessary '__maybe_unused' annotations on all PM functions.

Additionally, use the pm_ptr() macro to fix the following errors when
building with CONFIG_PM disabled:

ERROR: modpost: "cs35l41_pm_ops" [sound/soc/codecs/snd-soc-cs35l41-spi.ko] undefined!
ERROR: modpost: "cs35l41_pm_ops" [sound/soc/codecs/snd-soc-cs35l41-i2c.ko] undefined!

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20230907171010.1447274-9-cristian.ciocaltea@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: cs35l41: Make use of dev_err_probe()
Cristian Ciocaltea [Thu, 7 Sep 2023 17:10:06 +0000 (20:10 +0300)]
ASoC: cs35l41: Make use of dev_err_probe()

Use dev_err_probe() helper where possible, to simplify error handling
during probe.

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20230907171010.1447274-8-cristian.ciocaltea@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: cs35l41: Undo runtime PM changes at driver exit time
Cristian Ciocaltea [Thu, 7 Sep 2023 17:10:05 +0000 (20:10 +0300)]
ASoC: cs35l41: Undo runtime PM changes at driver exit time

According to the documentation, drivers are responsible for undoing at
removal time all runtime PM changes done during probing.

Hence, add the missing calls to pm_runtime_dont_use_autosuspend(), which
are necessary for undoing pm_runtime_use_autosuspend().

Note this would have been handled implicitly by
devm_pm_runtime_enable(), but there is a need to continue using
pm_runtime_enable()/pm_runtime_disable() in order to ensure the runtime
PM is disabled as soon as the remove() callback is entered.

Fixes: f517ba4924ad ("ASoC: cs35l41: Add support for hibernate memory retention mode")
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20230907171010.1447274-7-cristian.ciocaltea@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: cs35l41: Verify PM runtime resume errors in IRQ handler
Cristian Ciocaltea [Thu, 7 Sep 2023 17:10:04 +0000 (20:10 +0300)]
ASoC: cs35l41: Verify PM runtime resume errors in IRQ handler

The interrupt handler invokes pm_runtime_get_sync() without checking the
returned error code.

Add a proper verification and switch to pm_runtime_resume_and_get(), to
avoid the need to call pm_runtime_put_noidle() for decrementing the PM
usage counter before returning from the error condition.

Fixes: f517ba4924ad ("ASoC: cs35l41: Add support for hibernate memory retention mode")
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20230907171010.1447274-6-cristian.ciocaltea@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: cs35l41: Fix broken shared boost activation
Cristian Ciocaltea [Thu, 7 Sep 2023 17:10:03 +0000 (20:10 +0300)]
ASoC: cs35l41: Fix broken shared boost activation

Enabling the active/passive shared boosts requires setting SYNC_EN, but
*not* before receiving the PLL Lock signal.

Due to improper error handling, it was not obvious that waiting for the
completion operation times out and, consequently, the shared boost is
never activated.

Further investigations revealed the signal is triggered while
snd_pcm_start() is executed, right after receiving the
SNDRV_PCM_TRIGGER_START command, which happens long after the
SND_SOC_DAPM_PRE_PMU event handler is invoked as part of
snd_pcm_prepare().  That is where cs35l41_global_enable() is called
from.

Increasing the wait duration doesn't help, as it only causes an
unnecessary delay in the invocation of snd_pcm_start().  Moving the wait
and the subsequent regmap operations to the SNDRV_PCM_TRIGGER_START
callback is not a solution either, since they would be executed in an
IRQ-off atomic context.

Solve the issue by setting the SYNC_EN bit in PWR_CTRL3 register right
after receiving the PLL Lock interrupt.

Additionally, drop the unnecessary writes to PWR_CTRL1 register, part of
the original mdsync_up_seq, which would have toggled GLOBAL_EN with
unwanted consequences on PLL locking behavior.

Fixes: f5030564938b ("ALSA: cs35l41: Add shared boost feature")
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Reviewed-by: David Rhodes <david.rhodes@cirrus.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20230907171010.1447274-5-cristian.ciocaltea@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: cs35l41: Initialize completion object before requesting IRQ
Cristian Ciocaltea [Thu, 7 Sep 2023 17:10:02 +0000 (20:10 +0300)]
ASoC: cs35l41: Initialize completion object before requesting IRQ

Technically, an interrupt handler can be called before probe() finishes
its execution, hence ensure the pll_lock completion object is always
initialized before being accessed in cs35l41_irq().

Fixes: f5030564938b ("ALSA: cs35l41: Add shared boost feature")
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20230907171010.1447274-4-cristian.ciocaltea@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: cs35l41: Handle mdsync_up reg write errors
Cristian Ciocaltea [Thu, 7 Sep 2023 17:10:01 +0000 (20:10 +0300)]
ASoC: cs35l41: Handle mdsync_up reg write errors

The return code of regmap_multi_reg_write() call related to "MDSYNC up"
sequence is shadowed by the subsequent regmap_read_poll_timeout()
invocation, which will hit a timeout in case the write operation above
fails.

Make sure cs35l41_global_enable() returns the correct error code instead
of -ETIMEDOUT.

Additionally, to be able to distinguish between the timeouts of
wait_for_completion_timeout() and regmap_read_poll_timeout(), print an
error message for the former and return immediately.  This also avoids
having to wait unnecessarily for the second time.

Fixes: f8264c759208 ("ALSA: cs35l41: Poll for Power Up/Down rather than waiting a fixed delay")
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20230907171010.1447274-3-cristian.ciocaltea@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: cs35l41: Handle mdsync_down reg write errors
Cristian Ciocaltea [Thu, 7 Sep 2023 17:10:00 +0000 (20:10 +0300)]
ASoC: cs35l41: Handle mdsync_down reg write errors

The return code of regmap_multi_reg_write() call related to "MDSYNC
down" sequence is shadowed by the subsequent
wait_for_completion_timeout() invocation, which is expected to time
timeout in case the write operation failed.

Let cs35l41_global_enable() return the correct error code instead of
-ETIMEDOUT.

Fixes: f5030564938b ("ALSA: cs35l41: Add shared boost feature")
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20230907171010.1447274-2-cristian.ciocaltea@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: max98927: Drop pointless includes
Linus Walleij [Mon, 11 Sep 2023 08:23:54 +0000 (10:23 +0200)]
ASoC: max98927: Drop pointless includes

This driver is already using solely GPIO descriptors and
do not need to include the legacy headers <linux/gpio.h>
or <linux/of_gpio.h>. Drop them.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20230911-descriptors-asoc-max-v2-7-b9d793fb768e@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: max98520: Drop pointless includes
Linus Walleij [Mon, 11 Sep 2023 08:23:53 +0000 (10:23 +0200)]
ASoC: max98520: Drop pointless includes

This driver is already using solely GPIO descriptors and
do not need to include the legacy headers <linux/gpio.h>
or <linux/of_gpio.h>. Drop them.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20230911-descriptors-asoc-max-v2-6-b9d793fb768e@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: max98396: Drop pointless include
Linus Walleij [Mon, 11 Sep 2023 08:23:52 +0000 (10:23 +0200)]
ASoC: max98396: Drop pointless include

This driver is already using solely GPIO descriptors and
do not need to include the legacy header <linux/gpio.h>.
Drop it.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20230911-descriptors-asoc-max-v2-5-b9d793fb768e@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: max98388: Correct the includes
Linus Walleij [Mon, 11 Sep 2023 08:23:51 +0000 (10:23 +0200)]
ASoC: max98388: Correct the includes

The MAX98388 driver is using the modern GPIO descriptor API
but uses legacy includes. Include the proper <linux/consumer.h>
header instead.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20230911-descriptors-asoc-max-v2-4-b9d793fb768e@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: max98373: Convert to use GPIO descriptors
Linus Walleij [Mon, 11 Sep 2023 08:23:50 +0000 (10:23 +0200)]
ASoC: max98373: Convert to use GPIO descriptors

Instead of relying on legacy interfaces, convert the driver to
use GPIO descriptors. This is a straight-forward conversion,
we support also sdw devices providing GPIO descriptor tables
if they so desire.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20230911-descriptors-asoc-max-v2-3-b9d793fb768e@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: max98357a: Drop pointless include
Linus Walleij [Mon, 11 Sep 2023 08:23:49 +0000 (10:23 +0200)]
ASoC: max98357a: Drop pointless include

This driver is already using solely GPIO descriptors and
do not need to include the legacy header <linux/gpio.h>.
Drop it.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20230911-descriptors-asoc-max-v2-2-b9d793fb768e@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: max9768: Convert to use GPIO descriptors
Linus Walleij [Mon, 11 Sep 2023 08:23:48 +0000 (10:23 +0200)]
ASoC: max9768: Convert to use GPIO descriptors

The MAX9768 is pretty straight forward to convert to GPIO
descriptors.

To name the GPIO properties, I looke at the bindings in
maxim,max9759.yaml which names these GPIO "mute" and
"shutdown" respectively.

No board files using platform data exist in the kernel, new
users can use GPIO descriptor tables if desired.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20230911-descriptors-asoc-max-v2-1-b9d793fb768e@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: starfive: Add JH7110 PWM-DAC driver
Hal Feng [Mon, 14 Aug 2023 08:06:17 +0000 (16:06 +0800)]
ASoC: starfive: Add JH7110 PWM-DAC driver

Add PWM-DAC driver support for the StarFive JH7110 SoC.

Reviewed-by: Walker Chen <walker.chen@starfivetech.com>
Signed-off-by: Hal Feng <hal.feng@starfivetech.com>
Link: https://lore.kernel.org/r/20230814080618.10036-3-hal.feng@starfivetech.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: dt-bindings: Add StarFive JH7110 PWM-DAC controller
Hal Feng [Mon, 14 Aug 2023 08:06:16 +0000 (16:06 +0800)]
ASoC: dt-bindings: Add StarFive JH7110 PWM-DAC controller

Add bindings for the PWM-DAC controller on the JH7110
RISC-V SoC by StarFive Ltd.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Hal Feng <hal.feng@starfivetech.com>
Link: https://lore.kernel.org/r/20230814080618.10036-2-hal.feng@starfivetech.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: tas571x: Simplify probe()
Biju Das [Sun, 27 Aug 2023 09:15:25 +0000 (10:15 +0100)]
ASoC: tas571x: Simplify probe()

Simplify probe() by replacing of_match_device->i2c_get_match_data().

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Link: https://lore.kernel.org/r/20230827091525.39263-1-biju.das.jz@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: cs35l45: Add AMP Enable Switch control
Vlad Karpovich [Thu, 31 Aug 2023 16:20:42 +0000 (11:20 -0500)]
ASoC: cs35l45: Add AMP Enable Switch control

The "AMP Enable Switch" is useful in systems with multiple
amplifiers connected to the same audio bus
but not all of them are needed for all use cases.

Signed-off-by: Vlad Karpovich <vkarpovi@opensource.cirrus.com>
Acked-by: Ricardo Rivera-Matos <rriveram@opensource.cirrus.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230831162042.471801-4-vkarpovi@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: cs35l45: Connect DSP to the monitoring signals
Vlad Karpovich [Thu, 31 Aug 2023 16:20:41 +0000 (11:20 -0500)]
ASoC: cs35l45: Connect DSP to the monitoring signals

Link VMON, IMON, TEMPMON, VDD_BSTMON and VDD_BATTMON
to DSP1. The CSPL firmware uses them for the speaker calibration
and monitoring.

Signed-off-by: Vlad Karpovich <vkarpovi@opensource.cirrus.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Acked-by: Ricardo Rivera-Matos <rriveram@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230831162042.471801-3-vkarpovi@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: cs35l45: Analog PCM Volume and Amplifier Mode controls
Vlad Karpovich [Thu, 31 Aug 2023 16:20:40 +0000 (11:20 -0500)]
ASoC: cs35l45: Analog PCM Volume and Amplifier Mode controls

Adds "Analog PCM Volume" control with supported values
0 = 10dB,1 = 13dB,2 = 16dB and 3 = 19dB.
The amplifier can operate either in Speaker Mode or Receiver Mode
as configured by the user. Speaker Mode has four gain options
to support maximum amplifier output amplitude for loud
speaker application. Receiver Mode has further optimized
noise performance while maintaining sufficient output to support
phone receiver application. While configured in Receiver Mode,
the analog PCM Volume control is disabled and
the analog gain is fixed to 1dB.

Signed-off-by: Vlad Karpovich <vkarpovi@opensource.cirrus.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230831162042.471801-2-vkarpovi@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: cs35l45: Checks index of cs35l45_irqs[]
Ricardo Rivera-Matos [Thu, 31 Aug 2023 16:20:39 +0000 (11:20 -0500)]
ASoC: cs35l45: Checks index of cs35l45_irqs[]

Checks the index computed by the virq offset before printing the
error condition in cs35l45_spk_safe_err() handler.

Signed-off-by: Ricardo Rivera-Matos <rriveram@opensource.cirrus.com>
Signed-off-by: Vlad Karpovich <vkarpovi@opensource.cirrus.com>
Acked-by: Ricardo Rivera-Matos <rriveram@opensource.cirrus.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230831162042.471801-1-vkarpovi@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: cs42xx8-i2c: Simplify probe()
Biju Das [Mon, 28 Aug 2023 17:48:56 +0000 (18:48 +0100)]
ASoC: cs42xx8-i2c: Simplify probe()

Simplify probe() by replacing of_match_device->i2c_get_match_data() and
extend matching support for ID table. Also replace
dev_err()->dev_err_probe() to simplify the code.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230828174856.122559-1-biju.das.jz@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: wm8580: Simplify probe()
Biju Das [Mon, 28 Aug 2023 17:40:19 +0000 (18:40 +0100)]
ASoC: wm8580: Simplify probe()

Simplify probe() by replacing of_match_device->i2c_get_match_data() and
extend matching support for ID table.

While at it, remove comma in the terminator entry and simplify probe()
by replacing dev_err->dev_err_probe().

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230828174019.119250-1-biju.das.jz@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: meson: axg: extend TDM maximum sample rate to 384kHz
Jerome Brunet [Thu, 7 Sep 2023 09:09:10 +0000 (11:09 +0200)]
ASoC: meson: axg: extend TDM maximum sample rate to 384kHz

The TDM HW on the axg SoC families and derivatives actually supports
384kHz sampling rate.

Update the fifo and tdm interface constraints accordingly.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://lore.kernel.org/r/20230907090910.13546-1-jbrunet@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: soc.h: replace custom COUNT_ARGS() & CONCATENATE() implementations
Andy Shevchenko [Mon, 4 Sep 2023 11:15:24 +0000 (14:15 +0300)]
ASoC: soc.h: replace custom COUNT_ARGS() & CONCATENATE() implementations

Replace custom implementation of the macros from args.h.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/20230904111524.1740930-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: amd: acp: Add machine driver that enables sound for systems with a ES8336 codec
Marian Postevca [Tue, 29 Aug 2023 22:01:16 +0000 (01:01 +0300)]
ASoC: amd: acp: Add machine driver that enables sound for systems with a ES8336 codec

This commit enables sound for a line of Huawei laptops that use
the ES8336 codec which is connected to the ACP3X module.

Signed-off-by: Marian Postevca <posteuca@mutex.one>
Link: https://lore.kernel.org/r/20230829220116.1159-6-posteuca@mutex.one
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: amd: acp: Add support for splitting the codec specific code from the ACP driver
Marian Postevca [Tue, 29 Aug 2023 22:01:15 +0000 (01:01 +0300)]
ASoC: amd: acp: Add support for splitting the codec specific code from the ACP driver

This commit adds support for splitting more complicated machine
drivers, that need special handling, from the generic ACP code.

By adding support for callbacks to configure and handle codec
specific implementation details, we can split them in separate
files that don't clutter the ACP code.

Signed-off-by: Marian Postevca <posteuca@mutex.one>
Link: https://lore.kernel.org/r/20230829220116.1159-5-posteuca@mutex.one
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: es8316: Enable support for MCLK div by 2
Marian Postevca [Tue, 29 Aug 2023 22:01:14 +0000 (01:01 +0300)]
ASoC: es8316: Enable support for MCLK div by 2

To properly support a line of Huawei laptops with an AMD CPU
and an ES8336 codec connected to the ACP3X module, we need
to enable the codec option to divide the MCLK by 2.
This is needed because for at least one SKU that has a 48Mhz
MCLK the sound is distorted unless the MCLK div by 2 option
is enabled.

The option to divide the MCLK will first be tried. If no suitable
clocking can be generated from this frequency, then the normal
non-halved MCLK frequency will be tried.

Signed-off-by: Marian Postevca <posteuca@mutex.one>
Link: https://lore.kernel.org/r/20230829220116.1159-4-posteuca@mutex.one
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: es8316: Replace NR_SUPPORTED_MCLK_LRCK_RATIOS with ARRAY_SIZE()
Marian Postevca [Tue, 29 Aug 2023 22:01:13 +0000 (01:01 +0300)]
ASoC: es8316: Replace NR_SUPPORTED_MCLK_LRCK_RATIOS with ARRAY_SIZE()

No need for a special define since we can use ARRAY_SIZE() directly,
and won't need to worry to keep it in sync.

Signed-off-by: Marian Postevca <posteuca@mutex.one>
Link: https://lore.kernel.org/r/20230829220116.1159-3-posteuca@mutex.one
Signed-off-by: Mark Brown <broonie@kernel.org>