linux-block.git
11 months agoASoC: fsl_sai: Add separate DAI for transmitter and receiver
Shengjiu Wang [Wed, 12 Jun 2024 06:40:50 +0000 (14:40 +0800)]
ASoC: fsl_sai: Add separate DAI for transmitter and receiver

The transmitter and receiver part of the SAI interface need to be
configured with different master/slave mode, especially to work
with the audiomix module.

+-------+               +-----------+
| SAI1  |   --TX-->     |           |
|       |   <--RX--     |           |
+-------+               |           |
                        | AUDIOMIX  |
+-------+               |           |
| SAI2  |   --TX-->     |           |
+-------+               +-----------+

The SAI1 TX is in master mode, but SAI1 RX is in slave mode.
So add another two DAIs for TX and RX separately. but only
defined fsl_sai_set_dai_fmt_tx() and fsl_sai_set_dai_fmt_rx()
ops function for current case, in the future, the other ops
function for TX and RX can be defined if required.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://patch.msgid.link/1718174452-17596-2-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: codecs: lpass-wsa-macro: Correct support for newer v2.5 version
Krzysztof Kozlowski [Tue, 25 Jun 2024 16:58:47 +0000 (18:58 +0200)]
ASoC: codecs: lpass-wsa-macro: Correct support for newer v2.5 version

Starting with v2.5 of Qualcomm LPASS Codec, few registers in the WSA
macro block change.  Bring proper support for this v2.5 and newer
versions, to fix second speaker playback (speaker was silent).

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://patch.msgid.link/20240625-qcom-audio-wsa-second-speaker-v1-3-f65ffdfc368c@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: codecs: lpass-wsa-macro: Prepare to accommodate new codec versions
Krzysztof Kozlowski [Tue, 25 Jun 2024 16:58:46 +0000 (18:58 +0200)]
ASoC: codecs: lpass-wsa-macro: Prepare to accommodate new codec versions

The driver for Qualcomm LPASS WSA macro codec was developed and tested
on codec v2.1, however v2.5 has significant changes in the registers.
The driver correctly works for v2.1 codec, but has issues when running
on SoC with v2.5 codec (so starting with SM8450, even though playback
works properly on that SoC).

Prepare the driver for handling differences in register layouts of newer
version.  This does not have functional impact on older codec versions,
but just:
1. Renames few soc_enums and widgets as v2.1,
2. For registers being different in v2.5, moves the defaults and regmap
   configuration to new structures,
3. Adds new 'struct wsa_reg_layout' with offsets and masks for few
   registers, so most of the code can stay unchaged on v2.5,
4. Chooses proper widgets, regmap config and register layout based on
   version of the codec.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://patch.msgid.link/20240625-qcom-audio-wsa-second-speaker-v1-2-f65ffdfc368c@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: codecs: lpass-wsa-macro: Drop unused define
Krzysztof Kozlowski [Tue, 25 Jun 2024 16:58:45 +0000 (18:58 +0200)]
ASoC: codecs: lpass-wsa-macro: Drop unused define

WSA_MACRO_MUX_INP_MASK2 define is not used.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://patch.msgid.link/20240625-qcom-audio-wsa-second-speaker-v1-1-f65ffdfc368c@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: rt711-sdca: add GE selected mode control
Shuming Fan [Tue, 25 Jun 2024 08:43:03 +0000 (16:43 +0800)]
ASoC: rt711-sdca: add GE selected mode control

The SDCA spec defines a 'selected_mode' control which can override
the 'detected_mode' reported by hardware.
This is useful for platform integration as well as in cases
where the hardware(e.g. 3.5mm jack cable) is not able to accurately detect the jack type.

Signed-off-by: Shuming Fan <shumingf@realtek.com>
Tested-by: yung-chuan.liao@linux.intel.com
Link: https://patch.msgid.link/20240625084303.2273911-1-shumingf@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: codecs: lpass-rx-macro: add missing handling of v2.1 codec
Krzysztof Kozlowski [Tue, 25 Jun 2024 16:06:14 +0000 (18:06 +0200)]
ASoC: codecs: lpass-rx-macro: add missing handling of v2.1 codec

We have also v2.1 version of the codec (see 'enum lpass_codec_version'),
so handle it as well in all switch cases.

Fixes: dbacef05898d ("ASoC: codec: lpass-rx-macro: prepare driver to accomdate new codec versions")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://patch.msgid.link/20240625160614.450506-1-krzysztof.kozlowski@linaro.org
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: codecs: Drop explicit initialization of struct i2c_device_id::driver_data to 0
Uwe Kleine-König [Mon, 24 Jun 2024 13:17:27 +0000 (15:17 +0200)]
ASoC: codecs: Drop explicit initialization of struct i2c_device_id::driver_data to 0

These drivers don't use the driver_data member of struct i2c_device_id,
so don't explicitly initialize this member.

This prepares putting driver_data in an anonymous union which requires
either no initialization or named designators. But it's also a nice
cleanup on its own.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Link: https://patch.msgid.link/20240624131728.1244053-2-u.kleine-koenig@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoMAINTAINERS: adjust file entries after adding vendor prefix in sound dtbs
Lukas Bulwahn [Tue, 25 Jun 2024 03:34:19 +0000 (05:34 +0200)]
MAINTAINERS: adjust file entries after adding vendor prefix in sound dtbs

Commit ae8fc2948b48 ("ASoC: dt-bindings: add missing vender prefix on
filename") renames a few files in Documentation/devicetree/bindings/sound/,
but misses to adjust the file entries pointing to those files in
MAINTAINERS.

Hence, ./scripts/get_maintainer.pl --self-test=patterns complains about
broken references.

Adjust the file entries in NXP SGTL5000 DRIVER and TEXAS INSTRUMENTS AUDIO
(ASoC/HDA) DRIVERS.

Signed-off-by: Lukas Bulwahn <lukas.bulwahn@redhat.com>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/20240625033419.149775-1-lukas.bulwahn@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: Intel: boards: updates for 6.11 - part2
Mark Brown [Tue, 25 Jun 2024 11:34:52 +0000 (12:34 +0100)]
ASoC: Intel: boards: updates for 6.11 - part2

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

Minor additions and cleanups this time.

12 months agoASoC: codecs: ES8326: Solving headphone detection and
Mark Brown [Tue, 25 Jun 2024 11:34:44 +0000 (12:34 +0100)]
ASoC: codecs: ES8326: Solving headphone detection and

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

We propose four patches to solve headphone detection and suspend issues.
And there are several registers that should be read-only registers. So
we create es8326_writeable_register, and set these registers to false.

12 months agoASoC: Intel: sof_sdw: select PINCTRL_CS42L43 and SPI_CS42L43
Bard Liao [Mon, 24 Jun 2024 12:11:19 +0000 (14:11 +0200)]
ASoC: Intel: sof_sdw: select PINCTRL_CS42L43 and SPI_CS42L43

Cs42l43 bridge mode needs the two configurations.

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://patch.msgid.link/20240624121119.91552-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: Intel: sof_sdw: add quirk for Dell SKU 0B8C
Pierre-Louis Bossart [Mon, 24 Jun 2024 12:11:18 +0000 (14:11 +0200)]
ASoC: Intel: sof_sdw: add quirk for Dell SKU 0B8C

Jack detection needs to rely on JD2, as most other Dell
AlderLake-based devices.

Closes: https://github.com/thesofproject/linux/issues/5021
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://patch.msgid.link/20240624121119.91552-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: Intel: maxim-common: add max_98373_get_tx_mask function
Brent Lu [Mon, 24 Jun 2024 12:11:17 +0000 (14:11 +0200)]
ASoC: Intel: maxim-common: add max_98373_get_tx_mask function

Add a helper function max_98373_get_tx_mask() to get tx mask from
max98373 ACPI device properties at runtime.

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://patch.msgid.link/20240624121119.91552-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: Intel: sof_sdw: fix jack detection on ADL-N variant RVP
Pierre-Louis Bossart [Mon, 24 Jun 2024 12:11:16 +0000 (14:11 +0200)]
ASoC: Intel: sof_sdw: fix jack detection on ADL-N variant RVP

Experimental tests show that JD2_100K is required, otherwise the jack
is detected always even with nothing plugged-in.

To avoid matching with other known quirks the SKU information is used.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://patch.msgid.link/20240624121119.91552-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoc: tas2781: Add name_prefix as the prefix name of firmwares and kcontrol to suppor...
Shenghao Ding [Fri, 21 Jun 2024 13:23:07 +0000 (21:23 +0800)]
ASoc: tas2781: Add name_prefix as the prefix name of firmwares and kcontrol to support corresponding TAS2563/TAS2781s

Add name_prefix as the prefix name of firmwares and
kcontrol to support corresponding TAS2563/TAS2781s.
name_prefix is not mandatory.

Signed-off-by: Shenghao Ding <shenghao-ding@ti.com>
Link: https://patch.msgid.link/20240621132309.564-1-shenghao-ding@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: SOF: ipc4-topology: Use correct queue_id for requesting input pin format
Peter Ujfalusi [Mon, 24 Jun 2024 12:15:18 +0000 (14:15 +0200)]
ASoC: SOF: ipc4-topology: Use correct queue_id for requesting input pin format

It is incorrect to request the input pin format of the destination widget
using the output pin index of the source module as the indexes are not
necessarily matching.
moduleA.out_pin1 can be connected to moduleB.in_pin0 for example.

Use the dst_queue_id to request the input format of the destination module.

This bug remained unnoticed likely because in nocodec topologies we don't
have process modules after a module copier, thus the pin/queue index is
ignored.
For the process module case, the code was likely have been tested in a
controlled way where all the pin/queue/format properties were present to
work.

Update the debug prints to have better information.

Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: stable@vger.kernel.org # v6.8+
Link: https://patch.msgid.link/20240624121519.91703-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: mediatek: mt6358: Add "Dmic Mode Switch" kcontrol for switch DMIC mode.
Jiaxin Yu [Thu, 13 Jun 2024 02:07:25 +0000 (10:07 +0800)]
ASoC: mediatek: mt6358: Add "Dmic Mode Switch" kcontrol for switch DMIC mode.

There are two hardware connection methods for DMICs on the MT6358. In cases
where more than two DMICs are used, we need to time-multiplex these DMICs.
Therefore, we need to dynamically switch the modes of these DMICs based on
the actual usage scenarios.

            ---- DMIC1
AU_VIN0 ---
            ---- DMIC2

AU_VIN2 --- ----DMIC3

When we want to use DMIC1/2, configure it to one-wire mode. When we want to
use DMIC1/3, configure it to two-wire mode.

Signed-off-by: Jiaxin Yu <jiaxin.yu@mediatek.com>
Link: https://patch.msgid.link/20240613020725.27874-1-jiaxin.yu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: codecs: ES8326: regcache_sync error issue
Zhang Yi [Mon, 24 Jun 2024 03:06:07 +0000 (11:06 +0800)]
ASoC: codecs: ES8326: regcache_sync error issue

We modified the regmap_config members to fix cach sync error.
There are several registers that should be read-only registers.
If these registers are written while synchronizing the register values,
the codec will enter an error state.So we create es8326_writeable_register,
and set these registers to false

Signed-off-by: Zhang Yi <zhangyi@everest-semi.com>
Link: https://patch.msgid.link/20240624030607.4307-5-zhangyi@everest-semi.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: codecs: ES8326: Minimize the pop noise
Zhang Yi [Mon, 24 Jun 2024 03:06:06 +0000 (11:06 +0800)]
ASoC: codecs: ES8326: Minimize the pop noise

Executing regcache_sync at initialization, we can hear a gentle pop
noise. So we created es8326_init for initialization instead of
executing es8326_resume

Signed-off-by: Zhang Yi <zhangyi@everest-semi.com>
Link: https://patch.msgid.link/20240624030607.4307-4-zhangyi@everest-semi.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: codecs: ES8326: Slove headphone detection issue
Zhang Yi [Mon, 24 Jun 2024 03:06:04 +0000 (11:06 +0800)]
ASoC: codecs: ES8326: Slove headphone detection issue

We modified the headphone detection setting to avoid an error button state
after codec resume from suspend state

Signed-off-by: Zhang Yi <zhangyi@everest-semi.com>
Link: https://patch.msgid.link/20240624030607.4307-2-zhangyi@everest-semi.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: nau8822: add MCLK support
Mark Brown [Sun, 23 Jun 2024 12:13:14 +0000 (13:13 +0100)]
ASoC: nau8822: add MCLK support

Merge series from Andrejs Cainikovs <andrejs.cainikovs@gmail.com>:

This change adds local MCLK handling, which would cover a case when a
reference audio clock is present in a system, but is not allowed to be
changed, see [1].

[1]: https://lore.kernel.org/all/ZfBdxrzX3EnPuGOn@ediswmail9.ad.cirrus.com/

12 months agoASoC: qcom: display port changes
Mark Brown [Sun, 23 Jun 2024 12:13:07 +0000 (13:13 +0100)]
ASoC: qcom: display port changes

Merge series from srinivas.kandagatla@linaro.org:

This patchset adds support for.
1. parse Display Port module tokens from ASoC topology
2. add support to DP/HDMI Jack events.
3. fixes a typo in function name in sm8250

Verified these patches on X13s along with changes to tplg in
https://git.codelinaro.org/linaro/qcomlt/audioreach-topology/-/tree/topic/x13s-dp?ref_type=heads
and ucm changes from https://github.com/Srinivas-Kandagatla/alsa-ucm-conf/tree/topic/x13s-dp

x1e80100 is verified by Krzysztof with his changes in tplg

https://git.codelinaro.org/linaro/qcomlt/audioreach-topology/-/merge_requests/7/commits

12 months agoASoC: Few constifications (mostly arguments)
Mark Brown [Sun, 23 Jun 2024 12:13:00 +0000 (13:13 +0100)]
ASoC: Few constifications (mostly arguments)

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

Make few pointers in ASoC functions as pointers to const, so the code is
clearer to read, a bit safer and allows further constifications (e.g.
placing some data as rodata).

12 months agoASoC: Add ak4619 codec support
Mark Brown [Sun, 23 Jun 2024 12:12:52 +0000 (13:12 +0100)]
ASoC: Add ak4619 codec support

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

This is v3 patch-set for ak4619 driver.
It was created by Khanh, and I updated/adjusted to upstream.
It was tested on Renesas V4M GrayH

Link: https://lore.kernel.org/r/877ceotnrg.wl-kuninori.morimoto.gx@renesas.com
Link: https://lore.kernel.org/r/87frtb3x4k.wl-kuninori.morimoto.gx@renesas.com
12 months agoASoC: add compatible for ti,pcm5242
Mark Brown [Sun, 23 Jun 2024 12:12:45 +0000 (13:12 +0100)]
ASoC: add compatible for ti,pcm5242

Merge series from Christian Hewitt <christianshewitt@gmail.com>:

Update bindings and add a driver compatible for the pcm5242
chip used on the Odroid HiFi-Shield2 i2c mezzanine board.

12 months agoASoC: codecs: wcd family: cleanups
Mark Brown [Sun, 23 Jun 2024 12:12:38 +0000 (13:12 +0100)]
ASoC: codecs: wcd family: cleanups

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

Set of simple cleanups from similar issues in all Qualcomm WCD93xx
codecs.

The first patch "ASoC: codecs: wcd-mbhc: Constify passed MBHC reg
fields" is a requirement for few others, but except this they are
independent.

12 months agoASoC: dt-bindings: convert everest,es7134.txt &
Mark Brown [Sun, 23 Jun 2024 12:12:31 +0000 (13:12 +0100)]
ASoC: dt-bindings: convert everest,es7134.txt &

Merge series from Neil Armstrong <neil.armstrong@linaro.org>:

Convert the text bindings of the Everest ES7241/ES7134/7144/7154 2 channels
I2S analog to digital converter to dt-schema.

12 months agotlv320adc3xxx: Allow MICBIAS pins to be used as
Mark Brown [Sun, 23 Jun 2024 12:12:24 +0000 (13:12 +0100)]
tlv320adc3xxx: Allow MICBIAS pins to be used as

Merge series from Ricard Wanderlof <ricard.wanderlof@axis.com>:

In some cases, depending on system design, the MICBIAS pins on the
chip are not needed as such, but a couple of extra GPIO pins would be
useful. This patch allows the MICBIAS pins to be configured in the
device tree as general purpose output pins, controlled via the GPIO
framework.

Owing to their originally intended purpose there are some limitations:
when the MICBIAS pins are deactivated, they will float, so will likely
need a pulldown in many applications. When activated, they will
assume the voltage specified by the micbias1-vg and micbias2-vg
properties, respectively, meaning that the resulting output voltage
will be 2.0 V, 2.5 V or AVDD .

12 months agoCirrus Logic Family of ADCs
Mark Brown [Sun, 23 Jun 2024 12:12:16 +0000 (13:12 +0100)]
Cirrus Logic Family of ADCs

Merge series from Paul Handrigan <paulha@opensource.cirrus.com>:

This patchset provides ASoC support for the latest family
of Cirrus Logic multichannel, high performance audio ADCs.
The devices that are supported are CS5302 (2 channel ADC),
CS5304 (4 channel ADC), and CS5308 (8 channel ADC).

12 months agoASoC: dt-bindings: add ti,pcm5242 to pcm512x
Christian Hewitt [Sat, 22 Jun 2024 13:12:44 +0000 (13:12 +0000)]
ASoC: dt-bindings: add ti,pcm5242 to pcm512x

Add ti,pcm5242 to the pcm512x driver file

Signed-off-by: Christian Hewitt <christianshewitt@gmail.com>
Link: https://patch.msgid.link/20240622131245.2607533-2-christianshewitt@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: Add support for ti,pcm5242 to the pcm512x driver
Christian Hewitt [Sat, 22 Jun 2024 13:12:45 +0000 (13:12 +0000)]
ASoC: Add support for ti,pcm5242 to the pcm512x driver

Add a compatible string to enable support for the ti,pcm5242 DAC chip
in the pcm512x driver.

Signed-off-by: Christian Hewitt <christianshewitt@gmail.com>
Link: https://patch.msgid.link/20240622131245.2607533-3-christianshewitt@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: cs530x: Support for cs530x ADCs
Paul Handrigan [Fri, 21 Jun 2024 15:17:57 +0000 (10:17 -0500)]
ASoC: cs530x: Support for cs530x ADCs

Add support for the cs530x family of high performance
ADCs.

Signed-off-by: Paul Handrigan <paulha@opensource.cirrus.com>
Link: https://patch.msgid.link/20240621151757.1661265-3-paulha@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: dt-bindings: cirrus,cs530x: Add initial DT binding
Paul Handrigan [Fri, 21 Jun 2024 15:17:56 +0000 (10:17 -0500)]
ASoC: dt-bindings: cirrus,cs530x: Add initial DT binding

Add the YAML DT bindings for the cs530x high performance
audio ADCs.

Signed-off-by: Paul Handrigan <paulha@opensource.cirrus.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20240621151757.1661265-2-paulha@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoc: PCM6240: Return directly after a failed devm_kzalloc() in pcmdevice_i2c_probe()
Hao Ge [Mon, 17 Jun 2024 02:09:54 +0000 (10:09 +0800)]
ASoc: PCM6240: Return directly after a failed devm_kzalloc() in pcmdevice_i2c_probe()

The value “-ENOMEM” was assigned to the local variable “ret”
in one if branch after a devm_kzalloc() call failed at the beginning.
This error code will trigger then a pcmdevice_remove() call with a passed
null pointer so that an undesirable dereference will be performed.
Thus return the appropriate error code directly.

Fixes: 1324eafd37aa ("ASoc: PCM6240: Create PCM6240 Family driver code")
Signed-off-by: Hao Ge <gehao@kylinos.cn>
Link: https://patch.msgid.link/20240617020954.17252-1-hao.ge@linux.dev
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: amd: acp: add pcm constraints for buffer size and period size
Vijendar Mukunda [Mon, 17 Jun 2024 07:28:41 +0000 (12:58 +0530)]
ASoC: amd: acp: add pcm constraints for buffer size and period size

ACP common dma driver has a buffer size and period size restriction
which should be 64 byte aligned. Add pcm constraints for the same.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://patch.msgid.link/20240617072844.871468-8-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: amd: acp: move i2s clock generation sequence
Vijendar Mukunda [Mon, 17 Jun 2024 07:28:40 +0000 (12:58 +0530)]
ASoC: amd: acp: move i2s clock generation sequence

I2S clock generation registers should be programmed before starting the I2S
dma when I2S controller is programmed as clock master. Move i2s clock
generation register programming sequence prior to i2s dma start.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://patch.msgid.link/20240617072844.871468-7-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: amd: acp: modify conditional check for programming i2s mclk
Vijendar Mukunda [Mon, 17 Jun 2024 07:28:39 +0000 (12:58 +0530)]
ASoC: amd: acp: modify conditional check for programming i2s mclk

ACP provides different IO configurations(ACP PDM, I2S and SoundWire).
I2S mclk should be programmed only when I2S configuration is selected and
I2S controller is programmed as clock master.
Modify the conditional check for programming i2s mclk.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://patch.msgid.link/20240617072844.871468-6-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: amd: acp: remove unused variables from acp_resource structure
Vijendar Mukunda [Mon, 17 Jun 2024 07:28:38 +0000 (12:58 +0530)]
ASoC: amd: acp: remove unused variables from acp_resource structure

Remove unused variables i2s_pin_cfg_offset and i2s_mode from acp_resource
structure entries.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://patch.msgid.link/20240617072844.871468-5-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: amd: acp: remove acp_i2s_probe function
Vijendar Mukunda [Mon, 17 Jun 2024 07:28:37 +0000 (12:58 +0530)]
ASoC: amd: acp: remove acp_i2s_probe function

In acp_i2s_probe(), acp_base null check is verified.
As already acp_base null check will be verified in acp platform
driver probe sequence, additional NULL check in acp_i2s_probe() is not
needed. Remove acp_i2s_probe() function.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://patch.msgid.link/20240617072844.871468-4-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: Merge up fixes
Mark Brown [Fri, 21 Jun 2024 12:17:21 +0000 (13:17 +0100)]
ASoC: Merge up fixes

We need some of the AMD fixes as a base for new work.

12 months agoASoC: fsl-asoc-card: set priv->pdev before using it
Elinor Montmasson [Thu, 20 Jun 2024 13:25:03 +0000 (15:25 +0200)]
ASoC: fsl-asoc-card: set priv->pdev before using it

priv->pdev pointer was set after being used in
fsl_asoc_card_audmux_init().
Move this assignment at the start of the probe function, so
sub-functions can correctly use pdev through priv.

fsl_asoc_card_audmux_init() dereferences priv->pdev to get access to the
dev struct, used with dev_err macros.
As priv is zero-initialised, there would be a NULL pointer dereference.
Note that if priv->dev is dereferenced before assignment but never used,
for example if there is no error to be printed, the driver won't crash
probably due to compiler optimisations.

Fixes: 708b4351f08c ("ASoC: fsl: Add Freescale Generic ASoC Sound Card with ASRC support")
Signed-off-by: Elinor Montmasson <elinor.montmasson@savoirfairelinux.com>
Link: https://patch.msgid.link/20240620132511.4291-2-elinor.montmasson@savoirfairelinux.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: dt-bindings: convert everest,es7134.txt to dt-schema
Neil Armstrong [Thu, 20 Jun 2024 09:39:58 +0000 (11:39 +0200)]
ASoC: dt-bindings: convert everest,es7134.txt to dt-schema

Convert the text bindings of the Everest ES7134/7144/7154 2 channels
I2S analog to digital converter to dt-schema.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patch.msgid.link/20240620-topic-amlogic-upstream-bindings-convert-everest-v2-2-660985615522@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: dt-bindings: convert everest,es7241.txt to dt-schema
Neil Armstrong [Thu, 20 Jun 2024 09:39:57 +0000 (11:39 +0200)]
ASoC: dt-bindings: convert everest,es7241.txt to dt-schema

Convert the text biddings for the Everest ES7241 2 channels I2S analog
to digital converter to dt-schema.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patch.msgid.link/20240620-topic-amlogic-upstream-bindings-convert-everest-v2-1-660985615522@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: dt-bindings: add missing vender prefix on filename
Kuninori Morimoto [Thu, 20 Jun 2024 00:32:39 +0000 (00:32 +0000)]
ASoC: dt-bindings: add missing vender prefix on filename

Many Sound yaml files doesn't have vender prefix on filename.
Add missing vender prefix for these files.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/87wmmkpi6w.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: amd: acp: move chip->flag variable assignment
Vijendar Mukunda [Mon, 17 Jun 2024 07:28:36 +0000 (12:58 +0530)]
ASoC: amd: acp: move chip->flag variable assignment

chip->flag variable assignment will be skipped when acp platform device
creation is skipped. In this case chip>flag value will not be set.
chip->flag variable should be assigned along with other structure
variables for 'chip' structure. Move chip->flag variable assignment
prior to acp platform device creation.

Fixes: 3a94c8ad0aae ("ASoC: amd: acp: add code for scanning acp pdm controller")
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://msgid.link/r/20240617072844.871468-3-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: amd: acp: remove i2s configuration check in acp_i2s_probe()
Vijendar Mukunda [Mon, 17 Jun 2024 07:28:35 +0000 (12:58 +0530)]
ASoC: amd: acp: remove i2s configuration check in acp_i2s_probe()

ACP supports different pin configurations for I2S IO. Checking ACP pin
configuration value against specific value breaks the functionality for
other I2S pin configurations. This check is no longer required in i2s dai
driver probe call as i2s configuration check will be verified during acp
platform device creation sequence.
Remove i2s_mode check in acp_i2s_probe() function.

Fixes: b24484c18b10 ("ASoC: amd: acp: ACP code generic to support newer platforms")
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://msgid.link/r/20240617072844.871468-2-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: amd: acp: add a null check for chip_pdev structure
Vijendar Mukunda [Mon, 17 Jun 2024 07:28:34 +0000 (12:58 +0530)]
ASoC: amd: acp: add a null check for chip_pdev structure

When acp platform device creation is skipped, chip->chip_pdev value will
remain NULL. Add NULL check for chip->chip_pdev structure in
snd_acp_resume() function to avoid null pointer dereference.

Fixes: 088a40980efb ("ASoC: amd: acp: add pm ops support for acp pci driver")
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://msgid.link/r/20240617072844.871468-1-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: rt1318: Add RT1318 audio amplifier driver
Jack Yu [Wed, 19 Jun 2024 05:53:42 +0000 (05:53 +0000)]
ASoC: rt1318: Add RT1318 audio amplifier driver

This is the initial i2s-based amplifier driver for rt1318.

Signed-off-by: Jack Yu <jack.yu@realtek.com>
Link: https://msgid.link/r/b3055442ce6d4994aa01aa1fad6ba1fe@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: dt-bindings: ak4619: Add initial DT binding
Kuninori Morimoto [Wed, 19 Jun 2024 01:00:23 +0000 (01:00 +0000)]
ASoC: dt-bindings: ak4619: Add initial DT binding

Add Asahi Kasei ak4619 audio codec bindings.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/87h6dpwxug.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: Add ak4619 codec support
Khanh Le [Wed, 19 Jun 2024 00:59:36 +0000 (00:59 +0000)]
ASoC: Add ak4619 codec support

Add support for the Asahi Kasei AK4619 audio codec.

[Kuninori cleanuped and adjusted to upstream code]

Signed-off-by: Khanh Le <khanh.le.xr@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://msgid.link/r/87iky5wxvr.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: cs35l56: Accept values greater than 0 as IRQ numbers
Simon Trimmer [Mon, 17 Jun 2024 13:53:38 +0000 (14:53 +0100)]
ASoC: cs35l56: Accept values greater than 0 as IRQ numbers

IRQ lookup functions such as those in ACPI can return error values when
an IRQ is not defined. The i2c core driver converts the error codes to a
value of 0 and the SPI bus driver passes them unaltered to client device
drivers.

The cs35l56 driver should only accept positive non-zero values as IRQ
numbers.

Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Fixes: 8a731fd37f8b ("ASoC: cs35l56: Move utility functions to shared file")
Link: https://msgid.link/r/20240617135338.82006-1-simont@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: Intel: soc-acpi: mtl: fix speaker no sound on Dell SKU 0C64
Shuming Fan [Wed, 12 Jun 2024 07:57:40 +0000 (15:57 +0800)]
ASoC: Intel: soc-acpi: mtl: fix speaker no sound on Dell SKU 0C64

Dell SKU 0C64 has a single rt1318 amplifier.
The prefix name of control still needs to be set rt1318-1 corresponding to UCM config.

Signed-off-by: Shuming Fan <shumingf@realtek.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://msgid.link/r/20240612075740.1678082-1-shumingf@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: codecs: wcd939x: Drop unused num_ports field
Krzysztof Kozlowski [Wed, 12 Jun 2024 16:15:36 +0000 (18:15 +0200)]
ASoC: codecs: wcd939x: Drop unused num_ports field

The driver does not use few 'num_ports' in 'struct wcd939x_sdw_priv'.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://msgid.link/r/20240612-asoc-wcd9xxx-wide-cleanups-v1-23-0d15885b2a06@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: codecs: wcd939x: Drop unused RX/TX direction enum
Krzysztof Kozlowski [Wed, 12 Jun 2024 16:15:35 +0000 (18:15 +0200)]
ASoC: codecs: wcd939x: Drop unused RX/TX direction enum

The enum with RX/TX soundwire direction is not used.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://msgid.link/r/20240612-asoc-wcd9xxx-wide-cleanups-v1-22-0d15885b2a06@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: codecs: wcd939x: Constify wcd939x_sdw_ch_info
Krzysztof Kozlowski [Wed, 12 Jun 2024 16:15:34 +0000 (18:15 +0200)]
ASoC: codecs: wcd939x: Constify wcd939x_sdw_ch_info

Driver does not modify static wcd939x_sdw_ch_info array, so it can be
made const for code safety.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://msgid.link/r/20240612-asoc-wcd9xxx-wide-cleanups-v1-21-0d15885b2a06@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: codecs: wcd939x: Constify static data
Krzysztof Kozlowski [Wed, 12 Jun 2024 16:15:33 +0000 (18:15 +0200)]
ASoC: codecs: wcd939x: Constify static data

Driver does not modify few static data (MBHC reg fields, IRQ chip), so
make them const for code safety.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://msgid.link/r/20240612-asoc-wcd9xxx-wide-cleanups-v1-20-0d15885b2a06@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: codecs: wcd938x: Drop unused num_ports field
Krzysztof Kozlowski [Wed, 12 Jun 2024 16:15:32 +0000 (18:15 +0200)]
ASoC: codecs: wcd938x: Drop unused num_ports field

The driver does not use few 'num_ports' in 'struct wcd938x_sdw_priv'.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/20240612-asoc-wcd9xxx-wide-cleanups-v1-19-0d15885b2a06@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: codecs: wcd938x: Drop unused RX/TX direction enum
Krzysztof Kozlowski [Wed, 12 Jun 2024 16:15:31 +0000 (18:15 +0200)]
ASoC: codecs: wcd938x: Drop unused RX/TX direction enum

The enum with RX/TX soundwire direction is not used.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/20240612-asoc-wcd9xxx-wide-cleanups-v1-18-0d15885b2a06@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: codecs: wcd938x: Constify wcd938x_sdw_ch_info
Krzysztof Kozlowski [Wed, 12 Jun 2024 16:15:30 +0000 (18:15 +0200)]
ASoC: codecs: wcd938x: Constify wcd938x_sdw_ch_info

Driver does not modify static wcd938x_sdw_ch_info array, so it can be
made const for code safety.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/20240612-asoc-wcd9xxx-wide-cleanups-v1-17-0d15885b2a06@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: codecs: wcd938x: Constify static data
Krzysztof Kozlowski [Wed, 12 Jun 2024 16:15:29 +0000 (18:15 +0200)]
ASoC: codecs: wcd938x: Constify static data

Driver does not modify few static data (MBHC reg fields, IRQ chip), so
make them const for code safety.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/20240612-asoc-wcd9xxx-wide-cleanups-v1-16-0d15885b2a06@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: codecs: wcd937x: Drop unused chipid member
Krzysztof Kozlowski [Wed, 12 Jun 2024 16:15:28 +0000 (18:15 +0200)]
ASoC: codecs: wcd937x: Drop unused chipid member

The driver stores the read chipid in 'struct wcd937x_priv' but never
needs it after.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/20240612-asoc-wcd9xxx-wide-cleanups-v1-15-0d15885b2a06@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: codecs: wcd937x: Drop unused state container fields
Krzysztof Kozlowski [Wed, 12 Jun 2024 16:15:27 +0000 (18:15 +0200)]
ASoC: codecs: wcd937x: Drop unused state container fields

The driver does not use few 'struct wcd937x_priv' and 'struct
wcd937x_sdw_priv' members, so just drop them for smaller code.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/20240612-asoc-wcd9xxx-wide-cleanups-v1-14-0d15885b2a06@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: codecs: wcd937x: Drop unused enums, defines and types
Krzysztof Kozlowski [Wed, 12 Jun 2024 16:15:26 +0000 (18:15 +0200)]
ASoC: codecs: wcd937x: Drop unused enums, defines and types

Few declarations (defines, struct codec_port_info, enums) are not used
and can be safely dropped.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/20240612-asoc-wcd9xxx-wide-cleanups-v1-13-0d15885b2a06@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: codecs: wcd937x: Constify wcd937x_sdw_ch_info
Krzysztof Kozlowski [Wed, 12 Jun 2024 16:15:25 +0000 (18:15 +0200)]
ASoC: codecs: wcd937x: Constify wcd937x_sdw_ch_info

Driver does not modify static wcd937x_sdw_ch_info array, so it can be
made const for code safety.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/20240612-asoc-wcd9xxx-wide-cleanups-v1-12-0d15885b2a06@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: codecs: wcd937x: Constify static data
Krzysztof Kozlowski [Wed, 12 Jun 2024 16:15:24 +0000 (18:15 +0200)]
ASoC: codecs: wcd937x: Constify static data

Driver does not modify few static data (MBHC reg fields, IRQ chip), so
make them const for code safety.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/20240612-asoc-wcd9xxx-wide-cleanups-v1-11-0d15885b2a06@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: codecs: wcd934x: Handle nicer probe deferral and simplify with dev_err_probe()
Krzysztof Kozlowski [Wed, 12 Jun 2024 16:15:23 +0000 (18:15 +0200)]
ASoC: codecs: wcd934x: Handle nicer probe deferral and simplify with dev_err_probe()

wcd934x_codec_parse_data() function is called only from probe(), so
printing errors on resource acquisition is discouraged, because it can
pollute dmesg in case of probe deferral.  The actual deferral is here
unlikely, but still the code is a bit simpler with dev_err_probe().

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/20240612-asoc-wcd9xxx-wide-cleanups-v1-10-0d15885b2a06@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: codecs: wcd934x: Drop unused mic bias voltage fields
Krzysztof Kozlowski [Wed, 12 Jun 2024 16:15:22 +0000 (18:15 +0200)]
ASoC: codecs: wcd934x: Drop unused mic bias voltage fields

Driver stores the voltage of mic bias in fields in state container
structure, but actually never reads them - except for the mic2 bias
(micb2_mv field).  Drop the fields from the structure so the code will
be a bit simpler.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/20240612-asoc-wcd9xxx-wide-cleanups-v1-9-0d15885b2a06@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: codecs: wcd934x: Constify static data
Krzysztof Kozlowski [Wed, 12 Jun 2024 16:15:21 +0000 (18:15 +0200)]
ASoC: codecs: wcd934x: Constify static data

Driver does not modify few static data (arrays with sample rates, MBHC
reg fields, regmap config), so make them const for code safety.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/20240612-asoc-wcd9xxx-wide-cleanups-v1-8-0d15885b2a06@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: codecs: wcd934x: Drop unused interp path enum
Krzysztof Kozlowski [Wed, 12 Jun 2024 16:15:20 +0000 (18:15 +0200)]
ASoC: codecs: wcd934x: Drop unused interp path enum

The enum with inter path is not used.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/20240612-asoc-wcd9xxx-wide-cleanups-v1-7-0d15885b2a06@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: codecs: wcd9335: Drop unused dmic rate handling
Krzysztof Kozlowski [Wed, 12 Jun 2024 16:15:19 +0000 (18:15 +0200)]
ASoC: codecs: wcd9335: Drop unused dmic rate handling

Driver was prepared to adjust DMIC microphone parameters according to
DMIC clock rate which is read from platform data or Devicetree.  The
latter part never happened, so the code is always called with
dmic_clk_rate=0, prints error and uses default/fallback values.  All
this part can be simplified by dropping dead parts of code.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/20240612-asoc-wcd9xxx-wide-cleanups-v1-6-0d15885b2a06@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: codecs: wcd9335: Drop unneeded error message
Krzysztof Kozlowski [Wed, 12 Jun 2024 16:15:18 +0000 (18:15 +0200)]
ASoC: codecs: wcd9335: Drop unneeded error message

Error-level should not be used as debugging.  The code (function
wcd9335_get_dmic_clk_val()) will always be called with same parameters,
so this is not really useful debug anyway, so drop it.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/20240612-asoc-wcd9xxx-wide-cleanups-v1-5-0d15885b2a06@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: codecs: wcd9335: Handle nicer probe deferral and simplify with dev_err_probe()
Krzysztof Kozlowski [Wed, 12 Jun 2024 16:15:17 +0000 (18:15 +0200)]
ASoC: codecs: wcd9335: Handle nicer probe deferral and simplify with dev_err_probe()

wcd9335_parse_dt() function is called only from probe(), so printing
errors on resource acquisition is discouraged, because it can pollute
dmesg.  Use dev_err_probe() to fix this and also make the code a bit
simpler.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/20240612-asoc-wcd9xxx-wide-cleanups-v1-4-0d15885b2a06@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: codecs: wcd9335: Constify static data
Krzysztof Kozlowski [Wed, 12 Jun 2024 16:15:16 +0000 (18:15 +0200)]
ASoC: codecs: wcd9335: Constify static data

Driver does not modify few static data (arrays with sample rates,
interrupt description, regmap config), so make them const for code
safety.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/20240612-asoc-wcd9xxx-wide-cleanups-v1-3-0d15885b2a06@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: codecs: wcd9335: Drop unused state container fields
Krzysztof Kozlowski [Wed, 12 Jun 2024 16:15:15 +0000 (18:15 +0200)]
ASoC: codecs: wcd9335: Drop unused state container fields

The driver does not use few 'struct wcd9335_codec' members, so just drop
them for smaller code.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/20240612-asoc-wcd9xxx-wide-cleanups-v1-2-0d15885b2a06@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: codecs: wcd-mbhc: Constify passed MBHC reg fields
Krzysztof Kozlowski [Wed, 12 Jun 2024 16:15:14 +0000 (18:15 +0200)]
ASoC: codecs: wcd-mbhc: Constify passed MBHC reg fields

The wcd-mbhc-v2 helper code/module does not modify passed array of
registry fields, thus it can be made const for code safety.  It will
also allow individual drivers to allocate the array in rodata.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/20240612-asoc-wcd9xxx-wide-cleanups-v1-1-0d15885b2a06@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoc: tas2781: Enable RCA-based playback without DSP firmware download
Shenghao Ding [Fri, 14 Jun 2024 13:36:45 +0000 (21:36 +0800)]
ASoc: tas2781: Enable RCA-based playback without DSP firmware download

In only loading RCA (Reconfigurable Architecture) binary case, no DSP
program will be working inside tas2563/tas2781, that is dsp-bypass mode,
do not support speaker protection, or audio acoustic algorithms in this
mode.

Fixes: ef3bcde75d06 ("ASoC: tas2781: Add tas2781 driver")
Signed-off-by: Shenghao Ding <shenghao-ding@ti.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240614133646.910-1-shenghao-ding@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: dt-bindings: audio-graph-card2: add support for aux devices
Kuninori Morimoto [Tue, 18 Jun 2024 00:10:15 +0000 (00:10 +0000)]
ASoC: dt-bindings: audio-graph-card2: add support for aux devices

Add device tree property to define auxiliary devices to be added to
Audio Graph Card which is already supported on Simle Card.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://msgid.link/r/87jzin3yc8.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: nau8822: add MCLK support
Andrejs Cainikovs [Thu, 13 Jun 2024 08:46:52 +0000 (10:46 +0200)]
ASoC: nau8822: add MCLK support

This change adds MCLK clock handling directly within driver.
When used in combination with simple-audio-card, and mclk-fs is set,
simple-audio-card will change MCLK frequency before configuring PLL.
In some cases, however, MCLK reference clock should be static (see [1]),
which means it needs to be moved away from simple-audio-card.

[1]: https://lore.kernel.org/all/ZfBdxrzX3EnPuGOn@ediswmail9.ad.cirrus.com/

Signed-off-by: Andrejs Cainikovs <andrejs.cainikovs@toradex.com>
Link: https://msgid.link/r/20240613084652.13113-4-andrejs.cainikovs@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: nau8822: set NAU8822_REFIMP_80K only once
Andrejs Cainikovs [Thu, 13 Jun 2024 08:46:51 +0000 (10:46 +0200)]
ASoC: nau8822: set NAU8822_REFIMP_80K only once

Following bias state machine logic this bit is set twice before playback.
This change makes sure this bit set is set only once.

Signed-off-by: Andrejs Cainikovs <andrejs.cainikovs@toradex.com>
Suggested-by: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>
Link: https://msgid.link/r/20240613084652.13113-3-andrejs.cainikovs@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: nau8822: move nau8822_set_dai_sysclk()
Andrejs Cainikovs [Thu, 13 Jun 2024 08:46:50 +0000 (10:46 +0200)]
ASoC: nau8822: move nau8822_set_dai_sysclk()

Next commit in series makes a change which calls nau8822_set_pll() from
nau8822_set_dai_sysclk(). Moving latter after the former would avoid a
forward declaration, and this is exactly what this change does.

Signed-off-by: Andrejs Cainikovs <andrejs.cainikovs@toradex.com>
Link: https://msgid.link/r/20240613084652.13113-2-andrejs.cainikovs@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: tlv320adc3xxx: Add support for using MICBIAS pins as GPO
Ricard Wanderlof [Fri, 7 Jun 2024 15:22:05 +0000 (17:22 +0200)]
ASoC: tlv320adc3xxx: Add support for using MICBIAS pins as GPO

Add boolean ti,micbias1-gpo and ti,micbias2-gpo devicetree properties.

When set, the respective MICBIAS pins can be used as general purpose
outputs controlled via the GPIO framework, in addition to the two
configurable GPIO pins.

This is useful in applications where the MICBIAS functionality is
not required, but it is useful to have a couple of extra GPIO pins.

The voltage on the respective MICBIAS pin in the active state is
governed by the ti,micbias1-vg and ti,micbias2-vg properties,
respectively (same properties as when the pins are used as
MICBIAS pins).

Signed-off-by: Ricard Wanderlof <ricard.wanderlof@axis.com>
Link: https://msgid.link/r/20240607-tlv320adc3xxx-micbias-gpo-v3-2-59dbec8b98f4@axis.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: dt-bindings: tlv320adc3xxx: Add MICBIAS-as-GPO properties
Ricard Wanderlof [Fri, 7 Jun 2024 15:22:04 +0000 (17:22 +0200)]
ASoC: dt-bindings: tlv320adc3xxx: Add MICBIAS-as-GPO properties

Add properties for configuring the MICBIAS pins as general purpose
outputs, with some limitations: The voltage on the pin when activated
may be set using another property to 2.0 V, 2.5 V or AVDD.
When deactivated the pin will float.

Signed-off-by: Ricard Wanderlof <ricard.wanderlof@axis.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/20240607-tlv320adc3xxx-micbias-gpo-v3-1-59dbec8b98f4@axis.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: qcom: x1e80100: Add USB DisplayPort plug support
Krzysztof Kozlowski [Thu, 6 Jun 2024 10:49:22 +0000 (11:49 +0100)]
ASoC: qcom: x1e80100: Add USB DisplayPort plug support

Add support for handling jack events of USB (DisplayPort).

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Tested-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Tested-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> # X13s
Link: https://msgid.link/r/20240606104922.114229-5-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: qcom: sc8280xp: add Display port Jack
Srinivas Kandagatla [Thu, 6 Jun 2024 10:49:21 +0000 (11:49 +0100)]
ASoC: qcom: sc8280xp: add Display port Jack

Add support for Display Port Jack events.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Tested-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Tested-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> # X13s
Link: https://msgid.link/r/20240606104922.114229-4-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: qcom: common: add Display port Jack function
Srinivas Kandagatla [Thu, 6 Jun 2024 10:49:20 +0000 (11:49 +0100)]
ASoC: qcom: common: add Display port Jack function

Add a common function to add Display port jack.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Tested-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Tested-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> # X13s
Link: https://msgid.link/r/20240606104922.114229-3-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: qcom: q6dsp: parse Display port tokens
Srinivas Kandagatla [Thu, 6 Jun 2024 10:49:19 +0000 (11:49 +0100)]
ASoC: qcom: q6dsp: parse Display port tokens

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Tested-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Tested-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> # X13s
Link: https://msgid.link/r/20240606104922.114229-2-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: Constify return of snd_soc_dai_get_pcm_stream()
Krzysztof Kozlowski [Mon, 17 Jun 2024 13:03:23 +0000 (15:03 +0200)]
ASoC: Constify return of snd_soc_dai_get_pcm_stream()

Returned 'struct snd_soc_pcm_stream' by snd_soc_dai_get_pcm_stream() is
not modified by the users, so it can be changed as pointer to const.
This is a necessary step towards making the 'dai->driver' a pointer to
const.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/20240617-n-asoc-const-auto-selectable-formats-v1-5-8004f346ee38@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: Constify DAI passed to get_channel_map
Krzysztof Kozlowski [Mon, 17 Jun 2024 13:03:22 +0000 (15:03 +0200)]
ASoC: Constify DAI passed to get_channel_map

get_channel_map() is supposed to obtain map of channels without
modifying the state of the given DAI, so make the pointer to 'struct
snd_soc_dai' as pointing to const.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/20240617-n-asoc-const-auto-selectable-formats-v1-4-8004f346ee38@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: Constify passed data to core function
Krzysztof Kozlowski [Mon, 17 Jun 2024 13:03:21 +0000 (15:03 +0200)]
ASoC: Constify passed data to core function

Several ASoC functions receive pointers to data which is not modified,
e.g. pointers to 'snd_soc_dai', 'snd_soc_pcm_runtime',
'snd_pcm_hw_params' and 'snd_soc_dai_link'.

All these pointers can be made as a pointer to const.  This makes code
safer, serves as clear annotation of function's intentions (no ownership
passed to the function, no modifications) and allows putting pointed
structures in rodata (if ever applicable).

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/20240617-n-asoc-const-auto-selectable-formats-v1-3-8004f346ee38@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: Constify of_phandle_args in snd_soc_dai_link_component
Krzysztof Kozlowski [Mon, 17 Jun 2024 13:03:20 +0000 (15:03 +0200)]
ASoC: Constify of_phandle_args in snd_soc_dai_link_component

ASoC core code does not modify contents of 'of_phandle_args' in 'struct
snd_soc_dai_link_component', so the pointer can be made as a pointer to
const.  This makes code safer, serves as clear annotation of core's
intentions and allows putting pointed structures in rodata (if ever
applicable).

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/20240617-n-asoc-const-auto-selectable-formats-v1-2-8004f346ee38@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: Constify of_phandle_args in snd_soc_dai_driver
Krzysztof Kozlowski [Mon, 17 Jun 2024 13:03:19 +0000 (15:03 +0200)]
ASoC: Constify of_phandle_args in snd_soc_dai_driver

ASoC core code does not modify contents of 'of_phandle_args' in 'struct
snd_soc_dai_driver', so the pointer can be made as a pointer to const.
This makes code safer, serves as clear annotation of core's intentions
and allows putting pointed structures in rodata (if ever applicable).

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/20240617-n-asoc-const-auto-selectable-formats-v1-1-8004f346ee38@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: Constify DAI ops auto_selectable_formats
Krzysztof Kozlowski [Mon, 17 Jun 2024 12:57:35 +0000 (14:57 +0200)]
ASoC: Constify DAI ops auto_selectable_formats

The static arrays passed as 'auto_selectable_formats' are not modified
by the drivers nor by the core code, so make it const for code safety.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Herve Codina <herve.codina@bootlin.com>
Link: https://msgid.link/r/20240617125735.582963-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: soc-dai.h: Constify DAI ops auto_selectable_formats
Krzysztof Kozlowski [Mon, 17 Jun 2024 12:57:34 +0000 (14:57 +0200)]
ASoC: soc-dai.h: Constify DAI ops auto_selectable_formats

The core ASoC code does not modify contents of the
'auto_selectable_formats' array passed in 'struct snd_soc_dai_ops', so
make it const for code safety.

Reviewed-by: Herve Codina <herve.codina@bootlin.com>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/20240617125735.582963-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: audio-graph-card2: add support for aux devices
Kuninori Morimoto [Mon, 17 Jun 2024 04:26:38 +0000 (04:26 +0000)]
ASoC: audio-graph-card2: add support for aux devices

Add device tree property to define auxiliary devices to be added to
Audio Graph Card which is already supported on Simle Card.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://msgid.link/r/878qz4ry81.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: SOF: mediatek: Constify struct mtk_adsp_ipc_ops
Christophe JAILLET [Thu, 13 Jun 2024 20:59:09 +0000 (22:59 +0200)]
ASoC: SOF: mediatek: Constify struct mtk_adsp_ipc_ops

'struct mtk_adsp_ipc_ops' is not modified in these drivers.

Constifying this structure moves some data to a read-only section, so
increase overall security.

In order to do it, "struct mtk_adsp_ipc" also needs to be adjusted to this
new const qualifier.

On a x86_64, with allmodconfig:
Before:
======
   text    data     bss     dec     hex filename
  15533    2383       0   17916    45fc sound/soc/sof/mediatek/mt8195/mt8195.o

After:
=====
   text    data     bss     dec     hex filename
  15557    2367       0   17924    4604 sound/soc/sof/mediatek/mt8195/mt8195.o

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://msgid.link/r/a45d6b2b5ec040ea0fc78fca662c2dca3f13a49f.1718312321.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: dt-bindings: realtek,rt5514: Convert to dtschema
Animesh Agarwal [Sun, 16 Jun 2024 09:52:19 +0000 (15:22 +0530)]
ASoC: dt-bindings: realtek,rt5514: Convert to dtschema

Convert the RT5514 audio CODEC bindings to DT Schema. Make bindings
complete by adding 'spi-max-frequency', 'wakeup-source' properties.

Signed-off-by: Animesh Agarwal <animeshagarwal28@gmail.com>
Cc: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://msgid.link/r/20240616095223.260786-1-animeshagarwal28@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: dt-bindings: realtek,rt5631: Convert to dtschema
Animesh Agarwal [Sun, 16 Jun 2024 07:49:30 +0000 (13:19 +0530)]
ASoC: dt-bindings: realtek,rt5631: Convert to dtschema

Convert the ALC5631/RT5631 audio CODEC bindings to DT Schema.

Signed-off-by: Animesh Agarwal <animeshagarwal28@gmail.com>
Cc: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://msgid.link/r/20240616074936.151267-1-animeshagarwal28@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: fsl: imx-pcm-fiq: add missing MODULE_DESCRIPTION() macro
Jeff Johnson [Mon, 17 Jun 2024 03:52:26 +0000 (20:52 -0700)]
ASoC: fsl: imx-pcm-fiq: add missing MODULE_DESCRIPTION() macro

With ARCH=arm, make allmodconfig && make W=1 C=1 reports:
WARNING: modpost: missing MODULE_DESCRIPTION() in sound/soc/fsl/imx-pcm-fiq.o

Add the missing invocation of the MODULE_DESCRIPTION() macro.

Signed-off-by: Jeff Johnson <quic_jjohnson@quicinc.com>
Link: https://msgid.link/r/20240616-md-arm-sound-soc-fsl-v2-1-228772e81a54@quicinc.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: codecs: lpass: add support for v2.5 rx macro
Mark Brown [Sat, 15 Jun 2024 15:24:35 +0000 (16:24 +0100)]
ASoC: codecs: lpass: add support for v2.5 rx macro

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

This patchset adds support to reading codec version and also adds
support for v2.5 codec version in rx macro.

LPASS 2.5 and up versions have changes in some of the rx blocks which
are required to get headset functional correctly.

Tested this on SM8450, X13s and x1e80100 crd.

This changes also fixes issue with sm8450, sm8550, sm8660 and x1e80100.

12 months agoASoC: codec: lpass-rx-macro: add support for 2.5 codec version
Srinivas Kandagatla [Thu, 13 Jun 2024 10:49:33 +0000 (11:49 +0100)]
ASoC: codec: lpass-rx-macro: add support for 2.5 codec version

LPASS Codec v2.5 has significant changes in the rx register strides.
Due to this headset playback on SM8550, SM8650, x1e80100 and all SoCs
after SM8450 have only Left working.

This patch adjusts the registers to accomdate 2.5 changes. With this
fixed now L and R are functional on Headset playback.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Tested-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on SM8650-HDK
Link: https://lore.kernel.org/r/20240612-lpass-codec-v25-v4-3-f63d3676dbc4@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>