Commit Graph

50415 Commits

Author SHA1 Message Date
Mark Brown
16faf8cb4c
ASoC: mt8365: Fix -Werror builds
Merge series from Mark Brown <broonie@kernel.org>:

Nathan reported that the newly added mt8365 drivers were causing a
number of warnings which break -Werror builds, these were only visible
on arm64 since the drivers did not have COMPILE_TEST enabled.  Fix this
and some other minor stuff I noticed while doing so.
2024-09-09 22:02:08 +01:00
Mark Brown
43fbb2c702
ASoC: loongson: Simplify code formatting
Merge series from Binbin Zhou <zhoubinbin@loongson.cn>:

This patchset attempts to improve code readability by simplifying code
formatting.
No functional changes.
2024-09-09 22:02:01 +01:00
Uwe Kleine-König
130af75b5c
ASoC: Switch back to struct platform_driver::remove()
After commit 0edb555a65 ("platform: Make platform_driver::remove()
return void") .remove() is (again) the right callback to implement for
platform drivers.

Convert all drivers below sound/soc to use .remove(), with the eventual
goal to drop struct platform_driver::remove_new(). As .remove() and
.remove_new() have the same prototypes, conversion is done by just
changing the structure member name in the driver initializer.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Link: https://patch.msgid.link/20240909151230.909818-2-u.kleine-koenig@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-09-09 18:26:49 +01:00
Codrin Ciubotariu
b09c71f3e8
ASoC: atmel: mchp-i2s-mcc: Remove interface name from stream_name
Remove the interface name from the stream_name. The interface name (and the
index of the interface) can be set in DT using the sound-name-prefix string
property.

[andrei.simion@microchip: Adjust the commit title]

Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
Signed-off-by: Andrei Simion <andrei.simion@microchip.com>
Link: https://patch.msgid.link/20240909083530.14695-2-andrei.simion@microchip.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-09-09 18:26:47 +01:00
Tang Bin
130eb72d3c
ASoC: codecs: fix the right check and simplify code
In the file drivers/base/platform.c, the return description of
platform_get_irq is 'non-zero IRQ number on success, negative
error number on failure.', so the check is wrong, fix it. And
when get irq failed, the function platform_get_irq logs an error
message.

Fixes: 5e2404493f ("ASoC: codecs: add MT6357 support")
Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
Link: https://patch.msgid.link/20240908134604.3652-1-tangbin@cmss.chinamobile.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-09-09 18:26:47 +01:00
Mark Brown
36fa259b21
ASoC: mt8365: Allow build coverage
There is no build time dependency on anything specific to ARCH_MEDIATEK so
enable COMPILE_TEST builds.

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com>
Tested-by: Nathan Chancellor <nathan@kernel.org> # build
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://patch.msgid.link/20240907-asoc-fix-mt8365-build-v1-7-7ad0bac20161@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-09-09 16:58:18 +01:00
Mark Brown
d70ce6d310
ASoC: mt8365: Remove unused DMIC IIR coefficient configuration
Nothing ever calls mt8365_dai_load_dmic_iirc_coeff_table() so the compiler
warns about an unused static function. While it seems likely that something
should be calling the function I don't know what and this is breaking
-Werror builds like allmodconfig so let's just remove it. It can be added
again along with the user.

Reported-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Tested-by: Nathan Chancellor <nathan@kernel.org> # build
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://patch.msgid.link/20240907-asoc-fix-mt8365-build-v1-6-7ad0bac20161@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-09-09 16:58:17 +01:00
Mark Brown
067d832806
ASoC: mt8365: Remove unused variables
Silence compiler warnings by removing unused variables.

Reported-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Tested-by: Nathan Chancellor <nathan@kernel.org> # build
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://patch.msgid.link/20240907-asoc-fix-mt8365-build-v1-5-7ad0bac20161@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-09-09 16:58:16 +01:00
Mark Brown
63157d9940
ASoC: mt8365: Make non-exported functions static
The compilers warn if functions without a prototype are not static so add
appropriate static declarations.

Reported-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Tested-by: Nathan Chancellor <nathan@kernel.org> # build
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://patch.msgid.link/20240907-asoc-fix-mt8365-build-v1-4-7ad0bac20161@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-09-09 16:58:15 +01:00
Mark Brown
3e61df7d2f
ASoC: mt8365: Remove unused prototype for mt8365_afe_clk_group_48k()
The function is not used outside of the file it is defined and the
equivalent function for 44.1kHz is not prototyped so remove the prototype
for this function.

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com>
Tested-by: Nathan Chancellor <nathan@kernel.org> # build
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://patch.msgid.link/20240907-asoc-fix-mt8365-build-v1-3-7ad0bac20161@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-09-09 16:58:14 +01:00
Mark Brown
1b084d8e3b
ASoC: mt8365: Remove spurious unsigned long casts
The regmap APIs take unsigned ints not unsigned longs so casting their
arguments to unsigned longs is not a good choice, the constants being
cast here are all unsigned ints anyway.

Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Tested-by: Nathan Chancellor <nathan@kernel.org> # build
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://patch.msgid.link/20240907-asoc-fix-mt8365-build-v1-2-7ad0bac20161@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-09-09 16:58:13 +01:00
Mark Brown
d01c6a3987
ASoC: mt8365: Open code BIT() to avoid spurious warnings
The mt8365 driver uses bits.h to define bitfields but BIT() uses unsigned
long constants so does not play well with being bitwise negated and
converted to an unsigned int, the compiler complains about width reduction
on a number of architectures. Just open code the shifting to avoid the
issue.

Generated with s/BIT(/(1U << /

Reported-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com>
Tested-by: Nathan Chancellor <nathan@kernel.org> # build
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://patch.msgid.link/20240907-asoc-fix-mt8365-build-v1-1-7ad0bac20161@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-09-09 16:58:12 +01:00
Binbin Zhou
4c22b04e11
ASoC: loongson: Factor out loongson i2s enable clock functions
There are a few i2s clock enable operations in loongson_i2s_set_fmt(),
convert them to simple helper functions called
loongson_i2s_enable_mclk() and loongson_i2s_enable_bclk().

Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
Link: https://patch.msgid.link/d6f6c818b0ecee87277f704b6a801cbbf5e712ce.1725844530.git.zhoubinbin@loongson.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-09-09 16:27:04 +01:00
Binbin Zhou
ddb538a300
ASoC: loongson: Factor out loongson_card_acpi_find_device() function
The operations for reading the cpu and codec nodes in
loongson_card_parse_acpi() are similar, so we convert them into a simple
helper function called loongson_card_acpi_find_device().

Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
Link: https://patch.msgid.link/3b7da05e5fd4326e7944aa749bf06dd44e964f6c.1725844530.git.zhoubinbin@loongson.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-09-09 16:27:03 +01:00
Binbin Zhou
c7b626a893
ASoC: loongson: Replace if with ternary operator
Replace an if statement with a ternary operator, making the code a tiny
bit shorter.

Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
Link: https://patch.msgid.link/94ec2ac178610f50af4815ef5b719695915bba31.1725844530.git.zhoubinbin@loongson.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-09-09 16:27:02 +01:00
Binbin Zhou
e28ee1b8a9
ASoC: loongson: Simplify if statment in loongson_card_hw_params()
Deal with illegal conditions first and put the normal process code
outside the if condition to improve code readability.

Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
Link: https://patch.msgid.link/98b71f9643970f11bc500c01599c7aeb77ff2a58.1725844530.git.zhoubinbin@loongson.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-09-09 16:27:01 +01:00
Binbin Zhou
3d2528d6c0
ASoC: loongson: Simplify with dev_err_probe()
Error handling in probe() can be a bit simpler with dev_err_probe().

Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
Link: https://patch.msgid.link/07855aa6c290ec826d63e68b898e7f4afac5e30d.1725844530.git.zhoubinbin@loongson.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-09-09 16:27:00 +01:00
Binbin Zhou
ce3997ab8b
ASoC: loongson: Simplify probe() with local dev variable
Simplify the probe() function by using local 'dev' instead of
&pdev->dev.

Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
Link: https://patch.msgid.link/1984a20930da515e2a478b02159f83c02498f6be.1725844530.git.zhoubinbin@loongson.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-09-09 16:26:59 +01:00
Binbin Zhou
f2bd6f5b37
ASoC: loongson: Use BIT() macro
Where applicable, use BIT() macro instead of shift operation to improve
readability.

Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
Link: https://patch.msgid.link/ccca555c96f18c0ecf5f1544c82945ba651d105f.1725844530.git.zhoubinbin@loongson.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-09-09 16:26:48 +01:00
Takashi Iwai
28fbfaf6bd ALSA: hda: Use non-SG allocation for the communication buffers
The azx_bus->dma_type is referred only for allocating the
communication buffers like CORB/RIRB, and the allocation size is
small.  Hence it doesn't have to be S/G buffer allocation, which is an
obvious overkill.  Use the standard SNDRV_DMA_TYPE_DEV_WC instead.

This was changed to SNDRV_DMA_TYPE_DEV_WC_SG in the commit
37137ec26c ("ALSA: hda: Once again fix regression of page
allocations with IOMMU") as a workaround for IOMMU-backed
allocations.  But this is no longer needed since the allocation with
SNDRV_DMA_TYPE_DEV_WC itself was fixed in the commit 9c27301342
("ALSA: memalloc: Use DMA API for x86 WC page allocations, too").

So this patch reverts the previous workaround in this piece of code.

Link: https://patch.msgid.link/20240909134744.25426-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-09-09 15:48:27 +02:00
Arnd Bergmann
876dec03fd
ASoC: mediatek: mt8365: remove unused mt8365_i2s_hd_str
The mt8365_i2s_enum and mt8365_i2s_hd_str variables are not
used anywhere, but cause a warning when building with C=1
or when enabling -Wunused-const-variable:

sound/soc/mediatek/mt8365/mt8365-dai-i2s.c:781:27: error: 'mt8365_i2s_hd_str' defined but not used [-Werror=unused-const-variable=]
  781 | static const char * const mt8365_i2s_hd_str[] = {
      |                           ^~~~~~~~~~~~~~~~~

Remove these for the moment, they can be added back if a
user comes up.

Fixes: 402bbb13a1 ("ASoC: mediatek: mt8365: Add I2S DAI support")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>
Link: https://patch.msgid.link/20240907200053.3027553-1-arnd@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-09-09 12:29:44 +01:00
Arnd Bergmann
6b31d6a4ca
ASoC: mediatek: mt8365: include linux/bitfield.h
On x86, the header is not already included implicitly,
breaking compile-testing:

In file included from sound/soc/mediatek/mt8365/mt8365-afe-common.h:19,
                 from sound/soc/mediatek/mt8365/mt8365-afe-pcm.c:18:
sound/soc/mediatek/mt8365/mt8365-afe-pcm.c: In function 'mt8365_afe_cm2_mux_conn':
sound/soc/mediatek/mt8365/mt8365-reg.h:952:41: error: implicit declaration of function 'FIELD_PREP' [-Wimplicit-function-declaration]
  952 | #define CM2_AFE_CM2_CONN_CFG1(x)        FIELD_PREP(CM2_AFE_CM2_CONN_CFG1_MASK, (x))
      |                                         ^~~~~~~~~~

Included it ahead of the field definitions.

Fixes: 38c7c9ddc7 ("ASoC: mediatek: mt8365: Add common header")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>
Link: https://patch.msgid.link/20240908221754.2210857-1-arnd@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-09-09 12:29:43 +01:00
Romain Gantois
77b696f489
ASoC: tlv320aic31xx: Add support for loading filter coefficients
The TLV320DAC3100 Audio DAC has 25 built-in digital audio processing blocks
(PRBs). Each of these PRBs has a static filter structure with programmable
coefficients. Once a PRB is selected for use by the DAC, its filter
coefficients can be configured via a dedicated set of registers.

Define a new optional firmware which can be loaded by the TLV320DAC driver.
This firmware describes a full set of filter coefficients for all blocks
used by the various PRBs.

The firmware's binary format is heavily inspired by the one used in the
peb2466 driver. It includes a version marker to allow for potential
evolutions of the format.

Note that adaptive filtering is not supported i.e. filter coefficients are
loaded once before power-on and then cannot be changed while the DAC is
powered. This is why only page A coefficients are modified. Page B
coefficients are only used for adaptive filtering.

Signed-off-by: Romain Gantois <romain.gantois@bootlin.com>
Link: https://patch.msgid.link/20240906-tlv320-filter-v1-1-6955f53ff435@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-09-09 12:29:42 +01:00
Shenghao Ding
af5e317175
ASoC: tas2781: fix to save the dsp bin file name into the correct array in case name_prefix is not NULL
fix to save the dsp bin file name into the correct array, coef_binaryname,
instead of rca_binaryname, in case name_prefix is not NULL.

Signed-off-by: Shenghao Ding <shenghao-ding@ti.com>
Link: https://patch.msgid.link/20240907001540.944-1-shenghao-ding@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-09-09 12:29:29 +01:00
He Lugang
0a131eb855 ALSA: rme9652: remove unused parameter in macro
Parameter xindex is not used in macro HDSPM_TCO_LTC_FRAMES and
HDSPM_TCO_VIDEO_INPUT_FORMAT,so just remove it to simplify the code.

Signed-off-by: He Lugang <helugang@uniontech.com>
Link: https://patch.msgid.link/F53E9F10DA24705D+20240907142854.17627-1-helugang@uniontech.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-09-08 09:40:54 +02:00
Takashi Iwai
63e38d0787 ALSA: hda: Allow the default preallocation for x86 again
Since there are a few corner cases where the S/G buffer allocation
isn't performed (e.g. depending on IOMMU implementations), it'd be
better to allow the default buffer preallocation size for x86, too.

The default for x86 is still kept to 0, as it should work in most
cases.

Link: https://patch.msgid.link/20240907084129.28802-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-09-07 10:42:03 +02:00
Linus Torvalds
703896be30 sound fixes for 6.11-rc7
Hopefully the last PR for 6.11, at least for this level of amount.
 
 In addition to the usual HD-audio quirks, there are more changes in
 ASoC, but all look small and device-specific fixes, and nothing stands
 out.  The only slightly big change is sunxi I2S fix, which looks quite
 safe to apply, too.
 -----BEGIN PGP SIGNATURE-----
 
 iQJCBAABCAAsFiEEIXTw5fNLNI7mMiVaLtJE4w1nLE8FAmbaxkIOHHRpd2FpQHN1
 c2UuZGUACgkQLtJE4w1nLE/xDQ/9ESOhr5vmViDZ/LOXrmA36Mc7byvDE0ku9TsN
 bEBRSo2J5GJX3ty9ST6Pwm4jRlPAXRrqqWNhP2b+nQTTdzRWFQC58m79BSGmGWRA
 qyuFPakn1tiCdl5rvHS7hpYfzMkc8amVILhhJyhbv7Zg0UPriczPL3JI/W2GAJRs
 vMuHAD2ulSTVcJdYGgvny5JGWVQ649mQw7rfp+h3G9kXRLyOXKamGLU2e68TEZLq
 owUifBS1rC7+jXUn6dZ5MU86BLMQFCCDCOUjEEklH08Y+1DzqlS+JE80NcJlUBo8
 xNHoY1xFqDb0DAPb3w7P5IfCMBkb1I2uyHyMQg+SJeN05qXiSAKIsZhr5/NeivFq
 clB6R9l3tmN66lQEqr1ZxBEx6Sgr40Deh2qFOjyq7xsm+PRU4oPdels4+awRTWPy
 8fr/L2wWtYGGILM7iDkasgVeYQZGFJ7AG0gC0AyUoKtEcZZsQUiwfAWT85K4GLP9
 mmUMwqZH3nKtOxXgphSGbxOnep9cWNT7IJ/NXZ1iNGlByLXVDk5fIlOUK8983gCx
 duuFA1CpR3RwayGOo2UIwT62+qOTtfwGGKkHAPWjbBWa/daNxI8UEaHH/XEH3qyy
 iK8xFIkKimi95hjAA8FmVN6aGkeu3OCnQvdzbP3f3k0Tj1xe3t42xhPmQVl9yrpu
 lwIdl20=
 =npz1
 -----END PGP SIGNATURE-----

Merge tag 'sound-6.11-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
 "Hopefully the last PR for 6.11, at least for this level of amount.

  In addition to the usual HD-audio quirks, there are more changes in
  ASoC, but all look small and device-specific fixes, and nothing stands
  out. The only slightly big change is sunxi I2S fix, which looks quite
  safe to apply, too"

* tag 'sound-6.11-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (21 commits)
  ALSA: hda/realtek - Fix inactive headset mic jack for ASUS Vivobook 15 X1504VAP
  ALSA: hda/realtek: Support mute LED on HP Laptop 14-dq2xxx
  ALSA: hda/realtek: Enable Mute Led for HP Victus 15-fb1xxx
  ALSA: hda/realtek: extend quirks for Clevo V5[46]0
  ASoC: codecs: lpass-va-macro: set the default codec version for sm8250
  ALSA: hda: add HDMI codec ID for Intel PTL
  ALSA: hda/realtek: add patch for internal mic in Lenovo V145
  ASoC: sunxi: sun4i-i2s: fix LRCLK polarity in i2s mode
  ASoC: amd: yc: Add a quirk for MSI Bravo 17 (D7VEK)
  ASoC: mediatek: mt8188-mt6359: Modify key
  ASoc: SOF: topology: Clear SOF link platform name upon unload
  ALSA: hda/conexant: Add pincfg quirk to enable top speakers on Sirius devices
  ASoC: SOF: ipc: replace "enum sof_comp_type" field with "uint32_t"
  ASoC: fix module autoloading
  ASoC: tda7419: fix module autoloading
  ASoC: google: fix module autoloading
  ASoC: intel: fix module autoloading
  ASoC: tegra: Fix CBB error during probe()
  ASoC: dapm: Fix UAF for snd_soc_pcm_runtime object
  ASoC: Intel: soc-acpi-cht: Make Lenovo Yoga Tab 3 X90F DMI match less strict
  ...
2024-09-06 11:56:03 -07:00
ying zuxin
241c044e74
ASoC: codecs: Use devm_clk_get_enabled() helpers
The devm_clk_get_enabled() helpers:
    - call devm_clk_get()
    - call clk_prepare_enable() and register what is needed in order to
     call clk_disable_unprepare() when needed, as a managed resource.

This simplifies the code and avoids the calls to clk_disable_unprepare().

Signed-off-by: ying zuxin <11154159@vivo.com>
Link: https://patch.msgid.link/20240906084841.19248-1-yingzuxin@vivo.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-09-06 15:55:41 +01:00
Muhammad Usama Anjum
3c5a18a10a
ASoC: amd: acp: Return in-case of error
Return when error occurs instead of proceeding to for loop which will
use val uninitialized.

Fixes: f6f7d25b11 ("ASoC: amd: acp: Add pte configuration for ACP7.0 platform")
Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
Link: https://patch.msgid.link/20240906103727.222749-1-usama.anjum@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-09-06 12:27:54 +01:00
Tang Bin
1798acef8f
ASoC: loongson: remove redundant variable assignments
In the function loongson_asoc_card_probe, it is simpler
to return the value of function devm_snd_soc_register_card
directly.

Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
Link: https://patch.msgid.link/20240906100523.2142-1-tangbin@cmss.chinamobile.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-09-06 12:27:53 +01:00
Bard Liao
bf6d7a44a1
ASoC: Intel: soc-acpi-intel-mtl-match: add missing empty item
There is no links_num in struct snd_soc_acpi_mach {}, and we test
!link->num_adr as a condition to end the loop in hda_sdw_machine_select().
So an empty item in struct snd_soc_acpi_link_adr array is required.

Fixes: f77ae7fcdc ("ASoC: Intel: soc-acpi-intel-mtl-match: add cs42l43 only support")
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://patch.msgid.link/20240906060224.2241212-3-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-09-06 12:27:18 +01:00
Bard Liao
c4246f1fe9
ASoC: Intel: soc-acpi-intel-lnl-match: add missing empty item
There is no links_num in struct snd_soc_acpi_mach {}, and we test
!link->num_adr as a condition to end the loop in hda_sdw_machine_select().
So an empty item in struct snd_soc_acpi_link_adr array is required.

Fixes: dd3bd9dc47 ("ASoC: Intel: soc-acpi-intel-lnl-match: add cs42l43 only support")
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://patch.msgid.link/20240906060224.2241212-2-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-09-06 12:27:17 +01:00
Jerome Brunet
8055c0cd6b ASoC: spdif: extend supported rates to 768kHz
IEC958-3 defines sampling rate up to 768 kHz.
Such rates maybe used with high bandwidth IEC958 links, such as eARC.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Acked-by: Mark Brown <broonie@kernel.org>
Reviewed-by: David Rhodes <drhodes@opensource.cirrus.com>
Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240905-alsa-12-24-128-v1-13-8371948d3921@baylibre.com
2024-09-06 09:23:55 +02:00
Jerome Brunet
7bc09f7eb5 ASoC: cs35l34: drop useless rate contraint
The cs35l34 adds a useless rate constraint on startup.
It does not set SNDRV_PCM_RATE_KNOT and the rates set are already a subset
of the ones provided in the constraint list, so it is a no-op.

>From the rest of the code, it is likely HW supports more than the 32, 44.1
and 48kHz listed in CS35L34_RATES but there is no way to know for sure
without proper documentation.

Keep the driver as it is for now and just drop the useless constraint.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Reviewed-by: David Rhodes <drhodes@opensource.cirrus.com>
Acked-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240905-alsa-12-24-128-v1-12-8371948d3921@baylibre.com
2024-09-06 09:23:55 +02:00
Jerome Brunet
9dc03a1250 ASoC: sunxi: sun4i-codec: drop SNDRV_PCM_RATE_KNOT
The custom rate constraint lists was necessary to support 12kHz and 24kHz.
These rates are now available through SNDRV_PCM_RATE_12000 and
SNDRV_PCM_RATE_24000.

Use them and drop the custom rate constraint rule.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Reviewed-by: David Rhodes <drhodes@opensource.cirrus.com>
Acked-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240905-alsa-12-24-128-v1-11-8371948d3921@baylibre.com
2024-09-06 09:23:55 +02:00
Jerome Brunet
c061d1e4b2 ASoC: qcom: q6asm-dai: drop SNDRV_PCM_RATE_KNOT
The custom rate constraint list was necessary to support 12kHz and 24kHz.
These rates are now available through SNDRV_PCM_RATE_12000 and
SNDRV_PCM_RATE_24000.

Use them and drop the custom rate constraint rule.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Reviewed-by: David Rhodes <drhodes@opensource.cirrus.com>
Acked-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240905-alsa-12-24-128-v1-10-8371948d3921@baylibre.com
2024-09-06 09:23:55 +02:00
Jerome Brunet
9469cf57cd ASoC: Intel: avs: drop SNDRV_PCM_RATE_KNOT
The custom rate constraint list was necessary to support 12kHz, 24kHz and
128kHz. These rates are now available through SNDRV_PCM_RATE_12000,
SNDRV_PCM_RATE_24000 and SNDRV_PCM_RATE_128000.

Use them and drop the custom rate constraint rule.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Reviewed-by: David Rhodes <drhodes@opensource.cirrus.com>
Acked-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240905-alsa-12-24-128-v1-9-8371948d3921@baylibre.com
2024-09-06 09:23:55 +02:00
Jerome Brunet
eab3464be7 ASoC: cs53l30: drop SNDRV_PCM_RATE_KNOT
The custom rate constraint list was necessary to support 12kHz and 24kHz.
These rates are now available through SNDRV_PCM_RATE_12000 and
SNDRV_PCM_RATE_24000.

Use them and drop the custom rate constraint rule.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Reviewed-by: David Rhodes <drhodes@opensource.cirrus.com>
Acked-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240905-alsa-12-24-128-v1-8-8371948d3921@baylibre.com
2024-09-06 09:23:55 +02:00
Jerome Brunet
79acb4c046 ASoC: cs35l41: drop SNDRV_PCM_RATE_KNOT
The custom rate constraint list was necessary to support 12kHz and 24kHz.
These rates are now available through SNDRV_PCM_RATE_12000 and
SNDRV_PCM_RATE_24000.

Use them and drop the custom rate constraint rule.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Reviewed-by: David Rhodes <drhodes@opensource.cirrus.com>
Acked-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240905-alsa-12-24-128-v1-7-8371948d3921@baylibre.com
2024-09-06 09:23:55 +02:00
Jerome Brunet
7067e8142c ASoC: cs35l36: drop SNDRV_PCM_RATE_KNOT
The custom rate constraint list was necessary to support 12kHz and 24kHz.
These rates are now available through SNDRV_PCM_RATE_12000 and
SNDRV_PCM_RATE_24000.

Use them and drop the custom rate constraint rule.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Reviewed-by: David Rhodes <drhodes@opensource.cirrus.com>
Acked-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240905-alsa-12-24-128-v1-6-8371948d3921@baylibre.com
2024-09-06 09:23:55 +02:00
Jerome Brunet
151d82f914 ALSA: hdspm: drop SNDRV_PCM_RATE_KNOT
The custom rate constraint list was necessary to support 128kHz.
This rate is now available through SNDRV_PCM_RATE_128000.

Use it and drop the custom rate constraint rule.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Reviewed-by: David Rhodes <drhodes@opensource.cirrus.com>
Acked-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240905-alsa-12-24-128-v1-5-8371948d3921@baylibre.com
2024-09-06 09:23:55 +02:00
Jerome Brunet
3cc1e94dbc ALSA: hdsp: drop SNDRV_PCM_RATE_KNOT
The custom rate constraint list was necessary to support 128kHz.
This rate is now available through SNDRV_PCM_RATE_128000.

Use it and drop the custom rate constraint rule.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Reviewed-by: David Rhodes <drhodes@opensource.cirrus.com>
Acked-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240905-alsa-12-24-128-v1-4-8371948d3921@baylibre.com
2024-09-06 09:23:55 +02:00
Jerome Brunet
1f40410623 ALSA: emu10k1: drop SNDRV_PCM_RATE_KNOT
The custom rate constraint lists were necessary to support 12kHz and 24kHz.
These rates are now available through SNDRV_PCM_RATE_12000 and
SNDRV_PCM_RATE_24000.

Use them and drop the custom rate constraint rules.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Reviewed-by: David Rhodes <drhodes@opensource.cirrus.com>
Acked-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240905-alsa-12-24-128-v1-3-8371948d3921@baylibre.com
2024-09-06 09:23:54 +02:00
Jerome Brunet
91dd20d855 ALSA: cmipci: drop SNDRV_PCM_RATE_KNOT
The custom rate constraint list was necessary to support 128kHz.
This rate is now available through SNDRV_PCM_RATE_128000.

Use it and drop the custom rate constraint rule.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Reviewed-by: David Rhodes <drhodes@opensource.cirrus.com>
Acked-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240905-alsa-12-24-128-v1-2-8371948d3921@baylibre.com
2024-09-06 09:23:54 +02:00
Jerome Brunet
090624b7dc ALSA: pcm: add more sample rate definitions
This adds a sample rate definition for 12kHz, 24kHz and 128kHz.

Admittedly, just a few drivers are currently using these sample
rates but there is enough of a recurrence to justify adding a definition
for them and remove some custom rate constraint code while at it.

The new definitions are not added to the interval definitions, such as
SNDRV_PCM_RATE_8000_44100, because it would silently add new supported
rates to drivers that may or may not support them. For sure the drivers
have not been tested for these new rates so it is better to leave them out
of interval definitions.

That being said, the added rates are multiples of well know rates families,
it is very likely that a lot of devices out there actually supports them.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Reviewed-by: David Rhodes <drhodes@opensource.cirrus.com>
Acked-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240905-alsa-12-24-128-v1-1-8371948d3921@baylibre.com
2024-09-06 09:23:54 +02:00
Takashi Iwai
c491b044cf ASoC: Fixes for v6.11
A larger set of fixes than I'd like at this point, but mainly due to
 people working on fixing module autoloading by adding missing exports of
 ID tables rather than anything particularly concerning.  There are some
 other runtime fixes and quirks, and a tweak to the ABI definition for
 SOF which ensures that a struct layout doesn't vary depending on the
 architecture of the host.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmbaKqkACgkQJNaLcl1U
 h9B6FAf/QlcNrFWx2m0SLhRqeeNRX3pwp7cjNLSo1TlIaBJy5NZJ1QjE7epl1/vx
 4nzWi+3p1oql3h64RLIGUZ3dIUlFBoRBjmfF/aunxQ9VT7F8cqvLol+4sl+TcpTc
 JWL5vuoCYcCsJDRwydUxcCyEClsC51PNn+WomqDP829yvgErob6VBXHhdRyZYd35
 ffPBhAUOW0C+SOu7zGCAVqbtki2WMKc8gYweUhsuqEFQebOMkrO/sqJJsLbWje4D
 LPGFfVDQaLQ+0h7pKR0m9Fwh17VTbsHGKEqt0qWK4GUfs61odsEs+C6BWfpM+S5k
 comuzgnjtxgCV3K9URmYZx0435i+PQ==
 =kMAy
 -----END PGP SIGNATURE-----

Merge tag 'asoc-fix-v6.11-rc6' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus

ASoC: Fixes for v6.11

A larger set of fixes than I'd like at this point, but mainly due to
people working on fixing module autoloading by adding missing exports of
ID tables rather than anything particularly concerning.  There are some
other runtime fixes and quirks, and a tweak to the ABI definition for
SOF which ensures that a struct layout doesn't vary depending on the
architecture of the host.
2024-09-06 08:24:56 +02:00
Chen Ni
813751eaec
ASoC: Intel: skl_hda_dsp_generic: convert comma to semicolon
Replace comma between expressions with semicolons.

Using a ',' in place of a ';' can have unintended side effects.
Although that is not the case here, it is seems best to use ';'
unless ',' is intended.

Found by inspection.
No functional change intended.
Compile tested only.

Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
Link: https://patch.msgid.link/20240905022017.1642550-1-nichen@iscas.ac.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-09-05 16:07:07 +01:00
Chen Ni
54694840ef
ASoC: topology-test: Convert comma to semicolon
Replace comma between expressions with semicolons.

Using a ',' in place of a ';' can have unintended side effects.
Although that is not the case here, it is seems best to use ';'
unless ',' is intended.

Found by inspection.
No functional change intended.
Compile tested only.

Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
Link: https://patch.msgid.link/20240905032148.1929393-1-nichen@iscas.ac.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-09-05 16:07:06 +01:00
Mark Brown
d39b510a14
Add audio support for the MediaTek Genio 350-evk
Merge series from amergnat@baylibre.com:

This serie aim to add the following audio support for the Genio 350-evk:
- Playback
  - 2ch Headset Jack (Earphone)
  - 1ch Line-out Jack (Speaker)
  - 8ch HDMI Tx
- Capture
  - 1ch DMIC (On-board Digital Microphone)
  - 1ch AMIC (On-board Analogic Microphone)
  - 1ch Headset Jack (External Analogic Microphone)

Of course, HDMI playback need the MT8365 display patches [1] and a DTS
change documented in "mediatek,mt8365-mt6357.yaml".
2024-09-05 15:44:29 +01:00
Vasiliy Kovalev
a83e4c97dd ALSA: hda/realtek - Fix inactive headset mic jack for ASUS Vivobook 15 X1504VAP
When the headset is connected, there is no automatic switching of the
capture source - you can only manually select the headset microphone
in pavucontrol.

This patch fixes/activates the inactive microphone of the headset.

Signed-off-by: Vasiliy Kovalev <kovalev@altlinux.org>
Cc: <stable@vger.kernel.org>
Link: https://patch.msgid.link/20240905140211.937385-1-kovalev@altlinux.org
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-09-05 16:28:34 +02:00
Codrin Ciubotariu
03667e3d4f
ASoC: atmel: mchp-i2s-mcc: Improve maxburst calculation for better performance
The period size represents the size of the DMA descriptor. To ensure all
DMA descriptors start from a well-aligned address, the period size must
be divided by (sample size * maxburst), not just by maxburst.
This adjustment allows for computing a higher maxburst value, thereby
increasing the performance of the DMA transfer.
Previously, snd_pcm_lib_period_bytes() returned 0 because the runtime HW
parameters are computed after the hw_params() callbacks are used.
To address this, we now use params_*() functions to compute the period
size accurately. This change optimizes the DMA transfer performance by
ensuring proper alignment and efficient use of maxburst values.

[andrei.simion@microchip.com: Reword commit message and commit title.
Add macros with values for maximum DMA chunk size allowed.
Add DMA_BURST_ALIGNED preprocessor function to check the alignment of the
DMA burst]

Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
Signed-off-by: Andrei Simion <andrei.simion@microchip.com>
Link: https://patch.msgid.link/20240905095633.113784-1-andrei.simion@microchip.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-09-05 12:31:16 +01:00
Alexandre Mergnat
5bbfdad8cf
ASoC: mediatek: Add MT8365 support
- Add specific config to enable:
  - MT8365 sound support
  - MT6357 audio codec support
- Add the mt8365 directory and all drivers under it.

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Alexandre Mergnat <amergnat@baylibre.com>
Link: https://patch.msgid.link/20240226-audio-i350-v8-2-e80a57d026ce@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-09-05 12:31:04 +01:00
Nicolas Belin
5e2404493f
ASoC: codecs: add MT6357 support
Add the support of MT6357 PMIC audio codec.

Signed-off-by: Nicolas Belin <nbelin@baylibre.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Alexandre Mergnat <amergnat@baylibre.com>
Link: https://patch.msgid.link/20240226-audio-i350-v8-1-e80a57d026ce@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-09-05 12:31:03 +01:00
Mark Brown
e328ab3de4
Some clean up with helper fucntion
Merge series from Zhang Zekun <zhangzekun11@huawei.com>:

There are some helper functions which can be used to simplify the code.
So, let's use these functions to make code more simple.
2024-09-04 20:09:26 +01:00
Zhang Zekun
815f1fcf24
ASoC: audio-graph-card2: Use helper function of_get_child_count()
of_get_child_count() can help to get the num of child directly and we
don't need to manually count the child num. No functional change with
this conversion.

Signed-off-by: Zhang Zekun <zhangzekun11@huawei.com>
Reviewed-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/20240827070650.11424-3-zhangzekun11@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-09-04 18:31:15 +01:00
Zhang Zekun
de84924340
ASoC: audio-graph-card: Use for_each_child_of_node_scoped() to simplify code
for_each_child_of_node_scoped() can put the device_node automatically.
So, using it to make the code logic more simple and remove the device_node
clean up code.

Signed-off-by: Zhang Zekun <zhangzekun11@huawei.com>
Reviewed-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/20240827070650.11424-2-zhangzekun11@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-09-04 18:31:14 +01:00
Liu Jing
77e6a5e40a
ASoC: mediatek: mt2701-cs42448: Optimize redundant code in mt2701_cs42448_machine_probe
Utilize the defined parameter 'dev' to make the code cleaner.

Signed-off-by: Liu Jing <liujing@cmss.chinamobile.com>
Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>
Link: https://patch.msgid.link/20240903093623.7120-1-liujing@cmss.chinamobile.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-09-04 12:19:49 +01:00
Maximilien Perreault
47a9e8dbb8 ALSA: hda/realtek: Support mute LED on HP Laptop 14-dq2xxx
The mute LED on this HP laptop uses ALC236 and requires a quirk to function. This patch enables the existing quirk for the device.

Signed-off-by: Maximilien Perreault <maximilienperreault@gmail.com>
Cc: <stable@vger.kernel.org>
Link: https://patch.msgid.link/20240904031013.21220-1-maximilienperreault@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-09-04 13:01:27 +02:00
Adam Queler
b474f60f6a ALSA: hda/realtek: Enable Mute Led for HP Victus 15-fb1xxx
The mute led is controlled by ALC245. This patch enables the already
existing quirk for this device.

Signed-off-by: Adam Queler <queler+k@gmail.com>
Cc: <stable@vger.kernel.org>
Link: https://patch.msgid.link/20240903202419.31433-1-queler+k@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-09-04 13:00:51 +02:00
Mark Brown
1324e5ff2e
Add i2s/tdm support for acp7.0 and acp7.1 platforms
Merge series from Venkata Prasad Potturu <venkataprasad.potturu@amd.com>:

1. Refactor acp generic driver to support all platforms.
2. Add i2s/tdm and support for acp7.0  and acp7.1 platforms.
2024-09-03 23:51:08 +01:00
Mark Brown
9a029545bb
Add audio support for the MediaTek Genio 350-evk
Merge series from Alexandre Mergnat <amergnat@baylibre.com>:

This serie aim to add the following audio support for the Genio 350-evk:
- Playback
  - 2ch Headset Jack (Earphone)
  - 1ch Line-out Jack (Speaker)
  - 8ch HDMI Tx
- Capture
  - 1ch DMIC (On-board Digital Microphone)
  - 1ch AMIC (On-board Analogic Microphone)
  - 1ch Headset Jack (External Analogic Microphone)

Of course, HDMI playback need the MT8365 display patches [1] and a DTS
change documented in "mediatek,mt8365-mt6357.yaml".

Applied patch:
- mfd: mt6397-core: register mt6357 sound codec

Test passed:
- mixer-test log: [3]
- pcm-test log: [4]

[1]: https://lore.kernel.org/all/20231023-display-support-v1-0-5c860ed5c33b@baylibre.com/
[2]: https://lore.kernel.org/all/20240313110147.1267793-1-angelogioacchino.delregno@collabora.com/
[3]: https://pastebin.com/pc43AVrT
[4]: https://pastebin.com/cCtGhDpg
[5]: https://gitlab.baylibre.com/baylibre/mediatek/bsp/linux/-/commits/sound/for-next/add-i350-audio-support
2024-09-03 23:50:44 +01:00
tangbin
97688a9c5b
ASoC: loongson: fix error release
In function loongson_card_parse_of(), when get device_node
'codec' failed, the function of_node_put(codec) should not
be invoked, thus fix error release.

Fixes: d24028606e ("ASoC: loongson: Add Loongson ASoC Sound Card Support")
Signed-off-by: tangbin <tangbin@cmss.chinamobile.com>
Link: https://patch.msgid.link/20240903090620.6276-1-tangbin@cmss.chinamobile.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-09-03 21:23:59 +01:00
Marek Vasut
568dc2fae5
ASoC: tlv320aic32x4: Add multi endpoint support
Support multiple endpoints on TLV320AIC32x4 codec port when
used in of_graph context.

This patch allows to share the codec port between two CPU DAIs.

Example:

Custom STM32MP157C board uses TLV320AIC32x4 audio codec. This codec
is connected to two serial audio interfaces, which are configured
either as rx or tx.

>From AsoC point of view the topolgy is the following:
// 2 CPU DAIs (SAI2A/B), 1 Codec (TLV320AIC32x4)
Playback: CPU-A-DAI(slave) -> (master)CODEC-DAI/port0
Record:   CPU-B-DAI(slave) <- (master)CODEC-DAI/port0

In the DT two endpoints have to be associated to the codec port:
tlv320aic32x4_port: port {
    tlv320aic32x4_tx_endpoint: endpoint@0 {
            remote-endpoint = <&sai2a_endpoint>;
    };
    tlv320aic32x4_rx_endpoint: endpoint@1 {
            remote-endpoint = <&sai2b_endpoint>;
    };
};

However, when the audio graph card parses the codec nodes, it expects
to find DAI interface indexes matching the endpoints indexes.

The current patch forces the use of DAI id 0 for both endpoints,
which allows to share the codec DAI between the two CPU DAIs
for playback and capture streams respectively.

Signed-off-by: Marek Vasut <marex@denx.de>
Link: https://patch.msgid.link/20240830231007.205707-1-marex@denx.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-09-03 21:23:58 +01:00
Ma Ke
fcca6d05ef
ASoC: rt5682: Return devm_of_clk_add_hw_provider to transfer the error
Return devm_of_clk_add_hw_provider() in order to transfer the error, if it
fails due to resource allocation failure or device tree clock provider
registration failure.

Cc: stable@vger.kernel.org
Fixes: ebbfabc16d ("ASoC: rt5682: Add CCF usage for providing I2S clks")
Signed-off-by: Ma Ke <make24@iscas.ac.cn>
Link: https://patch.msgid.link/20240830143154.3448004-1-make24@iscas.ac.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-09-03 21:23:57 +01:00
Alexandre Mergnat
e1991d102b
ASoC: mediatek: mt8365: Add the AFE driver support
Add a driver for the Audio Front End (AFE) PCM to provide Audio
Uplink (UL) and Downlink (DL) paths.
Use the ALSA SoC Dynamic Audio Power Management to add widget and
kcontrol supports.

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Alexandre Mergnat <amergnat@baylibre.com>
Link: https://patch.msgid.link/20240226-audio-i350-v7-11-6518d953a141@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-09-03 18:17:29 +01:00
Nicolas Belin
1bf6dbd75f
ASoc: mediatek: mt8365: Add a specific soundcard for EVK
Add a specific soundcard for mt8365-evk. It supports audio jack
in/out, dmics, the amic and lineout.

Signed-off-by: Nicolas Belin <nbelin@baylibre.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Alexandre Mergnat <amergnat@baylibre.com>
Link: https://patch.msgid.link/20240226-audio-i350-v7-10-6518d953a141@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-09-03 18:17:28 +01:00
Alexandre Mergnat
5097c0c863
ASoC: mediatek: mt8365: Add PCM DAI support
Add Pulse Code Modulation Device Audio Interface support for MT8365 SoC.

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Alexandre Mergnat <amergnat@baylibre.com>
Link: https://patch.msgid.link/20240226-audio-i350-v7-9-6518d953a141@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-09-03 18:17:27 +01:00
Alexandre Mergnat
1c50ec75ce
ASoC: mediatek: mt8365: Add DMIC DAI support
Add Digital Micro Device Audio Interface support for MT8365 SoC.

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Alexandre Mergnat <amergnat@baylibre.com>
Link: https://patch.msgid.link/20240226-audio-i350-v7-8-6518d953a141@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-09-03 18:17:26 +01:00
Alexandre Mergnat
7c58c88e52
ASoC: mediatek: mt8365: Add ADDA DAI support
Add ADDA Device Audio Interface support for MT8365 SoC.

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Alexandre Mergnat <amergnat@baylibre.com>
Link: https://patch.msgid.link/20240226-audio-i350-v7-7-6518d953a141@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-09-03 18:17:25 +01:00
Alexandre Mergnat
402bbb13a1
ASoC: mediatek: mt8365: Add I2S DAI support
Add I2S Device Audio Interface support for MT8365 SoC.

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Alexandre Mergnat <amergnat@baylibre.com>
Link: https://patch.msgid.link/20240226-audio-i350-v7-6-6518d953a141@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-09-03 18:17:24 +01:00
Alexandre Mergnat
ef307b40b7
ASoC: mediatek: mt8365: Add audio clock control support
Add audio clock wrapper and audio tuner control.

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Alexandre Mergnat <amergnat@baylibre.com>
Link: https://patch.msgid.link/20240226-audio-i350-v7-5-6518d953a141@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-09-03 18:17:24 +01:00
Alexandre Mergnat
38c7c9ddc7
ASoC: mediatek: mt8365: Add common header
Add header files for register definition and structure.

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Alexandre Mergnat <amergnat@baylibre.com>
Link: https://patch.msgid.link/20240226-audio-i350-v7-4-6518d953a141@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-09-03 18:17:23 +01:00
Takashi Iwai
2994586e2c Merge branch 'for-linus' into for-next
Pull 6.11 devel branch.  The conflicts in HD-audio Realtek codec driver
got resolved.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-09-03 18:07:46 +02:00
Asahi Lina
611a96f6ac ALSA: usb-audio: Add mixer quirk for RME Digiface USB
Implement sync, output format, and input status mixer controls, to allow
the interface to be used as a straight ADAT/SPDIF (+ Headphones) I/O
interface.

This does not implement the matrix mixer, output gain controls, or input
level meter feedback. The full mixer interface is only really usable
using a dedicated userspace control app (there are too many mixer nodes
for alsamixer to be usable), so for now we leave it up to userspace to
directly control these features using raw USB control messages. This is
similar to how it's done with some FireWire interfaces (ffado-mixer).

Signed-off-by: Asahi Lina <lina@asahilina.net>
Link: https://patch.msgid.link/20240903-rme-digiface-v2-2-71b06c912e97@asahilina.net
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-09-03 18:06:31 +02:00
Cyan Nyan
c032044e96 ALSA: usb-audio: Add quirk for RME Digiface USB
Add trivial support for audio streaming on the RME Digiface USB. Binds
only to the first interface to allow userspace to directly drive the
complex I/O and matrix mixer controls.

Signed-off-by: Cyan Nyan <cyan.vtb@gmail.com>
[Lina: Added 2x/4x sample rate support & boot/format quirks]
Co-developed-by: Asahi Lina <lina@asahilina.net>
Signed-off-by: Asahi Lina <lina@asahilina.net>
Link: https://patch.msgid.link/20240903-rme-digiface-v2-1-71b06c912e97@asahilina.net
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-09-03 18:06:11 +02:00
Marek Marczykowski-Górecki
562755501d ALSA: hda/realtek: extend quirks for Clevo V5[46]0
The mic in those laptops suffers too high gain resulting in mostly (fan
or else) noise being recorded. In addition to the existing fixup about
mic detection, apply also limiting its boost. While at it, extend the
quirk to also V5[46]0TNE models, which have the same issue.

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Cc: <stable@vger.kernel.org>
Link: https://patch.msgid.link/20240903124939.6213-1-marmarek@invisiblethingslab.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-09-03 18:04:26 +02:00
Venkata Prasad Potturu
3f600592fa
ASoC: amd: acp: Add I2S TDM support for acp7.1 platform
Add acp71 revision id to support i2s/tdm mode.

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://patch.msgid.link/20240903113427.182997-13-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-09-03 12:57:50 +01:00
Venkata Prasad Potturu
1150c18ba3
ASoC: amd: acp: Add i2s master clock generation support for acp7.1 platform
Add i2s master generation support for acp7.1 platform based on pci device
id.

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://patch.msgid.link/20240903113427.182997-12-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-09-03 12:57:49 +01:00
Venkata Prasad Potturu
f6f7d25b11
ASoC: amd: acp: Add pte configuration for ACP7.0 platform
Add page table entry configurations to support higher sample rate
streams with multiple channels for ACP7.0 platforms.

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://patch.msgid.link/20240903113427.182997-11-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-09-03 12:57:48 +01:00
Venkata Prasad Potturu
b80d5a0c87
ASoC: amd: acp: Add I2S TDM support for acp7.0 platform
Add acp70 revision id to support I2S TDM.

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://patch.msgid.link/20240903113427.182997-10-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-09-03 12:57:47 +01:00
Venkata Prasad Potturu
b24df4fa40
ASoC: amd: acp: Modify max channels and sample rate support for acp70 dai driver
Modify max channels and max sample rate support in the dai driver for
acp7.0 platform.

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://patch.msgid.link/20240903113427.182997-9-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-09-03 12:57:46 +01:00
Venkata Prasad Potturu
13073ed06a
ASoC: amd: acp: Set i2s clock for acp7.0 platform
Set i2s bclk and lrclk for acp7.0 platform.

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://patch.msgid.link/20240903113427.182997-8-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-09-03 12:57:45 +01:00
Venkata Prasad Potturu
fb2eaec6a3
ASoC: amd: acp: Add I2S master clock generation support for acp7.0 platform
Add I2S master clock generation support for acp7.0 platforms.

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://patch.msgid.link/20240903113427.182997-7-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-09-03 12:57:44 +01:00
Venkata Prasad Potturu
7a040cc557
ASoC: amd: acp: Update pcm hardware capabilities for acp7.0 platform
Update pcm hardware capabilities for acp7.0 platform.

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://patch.msgid.link/20240903113427.182997-6-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-09-03 12:57:43 +01:00
Venkata Prasad Potturu
13aeb56e6d
ASoC: amd: acp: Add I2S TDM support for acp6.3 platform
Add slots selection and 32-channels TDM support for
acp6.3 platform.

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://patch.msgid.link/20240903113427.182997-5-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-09-03 12:57:42 +01:00
Venkata Prasad Potturu
973e9edea9
ASoC: amd: acp: Update pcm hardware capabilities for acp6.3 platform
Update pcm hardware capabilities based on acp revision id.

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://patch.msgid.link/20240903113427.182997-4-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-09-03 12:57:41 +01:00
Venkata Prasad Potturu
093184a3fe
ASoC: amd: acp: Refactor I2S dai driver
All I2S instances are connected to different powertile form acp6.0
onwards, refactor dai driver to support all I2S instances for all acp
platforms.

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://patch.msgid.link/20240903113427.182997-3-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-09-03 12:57:40 +01:00
Venkata Prasad Potturu
cd60dec899
ASoC: amd: acp: Refactor TDM slots selction based on acp revision id
Refactor TDM slots selection based on acp revision id.

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://patch.msgid.link/20240903113427.182997-2-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-09-03 12:57:39 +01:00
tangbin
a14e932326
ASoC: loongson: remove unnecessary assignment in i2s_resume()
In this function, the assignment ret is unnecessary,
thus remove it.

Signed-off-by: tangbin <tangbin@cmss.chinamobile.com>
Link: https://patch.msgid.link/20240903090301.6192-1-tangbin@cmss.chinamobile.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-09-03 12:36:59 +01:00
Hongbo Li
dc70fd0240
ASoC: adi: Use str_enabled_disabled() helper
Use str_enabled_disabled() helper instead of open
coding the same.

Signed-off-by: Hongbo Li <lihongbo22@huawei.com>
Link: https://patch.msgid.link/20240831095149.4161729-1-lihongbo22@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-09-02 15:33:26 +01:00
Shuming Fan
f465d10cd7
ASoC: rt1320: Add support for version C
This patch added the support for version C.

Signed-off-by: Shuming Fan <shumingf@realtek.com>
Link: https://patch.msgid.link/20240902090845.1862354-1-shumingf@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-09-02 12:57:11 +01:00
Takashi Iwai
40a024b81d ALSA: core: Drop superfluous no_free_ptr() for memdup_user() errors
We used to wrap with no_free_ptr() for the return value from
memdup_user() with errors where the auto cleanup is applied.  This was
a workaround because the initial implementation of kfree auto-cleanup
checked only NULL pointers.

Since recently, though, the kfree auto-cleanup checks with
IS_ERR_OR_NULL() (by the commit cd7eb8f83f ("mm/slab: make
__free(kfree) accept error pointers")), hence those workarounds became
superfluous.  Let's drop them now.

Link: https://patch.msgid.link/20240902075246.3743-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-09-02 10:21:41 +02:00
Jinjie Ruan
f48bd50a1c ALSA: core: timer: Use NSEC_PER_SEC macro
1000000000L is number of ns per second, use NSEC_PER_SEC macro to replace
it to make it more readable

Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
Link: https://patch.msgid.link/20240902071622.3519787-1-ruanjinjie@huawei.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-09-02 10:18:11 +02:00
Takashi Iwai
3606f92de3 ALSA: pcm: Fix yet more compile warning at replacement with kstrtoul()
The previous fix brought yet another compile warning at pr_debug()
call with the changed size.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Closes: https://lore.kernel.org/20240902132904.5ee173f3@canb.auug.org.au
Fixes: 43b42ed438 ("ALSA: pcm: Fix the previous conversion to kstrtoul()")
Tested-by: Stephen Rothwell <sfr@canb.auug.org.au>
Link: https://patch.msgid.link/20240902062217.9777-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-09-02 10:17:42 +02:00
Colin Ian King
2657539a27 ALSA: ali5451: Remove trailing space after \n newline
There is a extraneous space after a newline in a dev_dbg message.
Remove it.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Link: https://patch.msgid.link/20240901162125.144069-1-colin.i.king@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-09-02 08:03:10 +02:00
Takashi Iwai
43b42ed438 ALSA: pcm: Fix the previous conversion to kstrtoul()
The previous replacement from simple_strtoul() to kstrtoul() forgot
that the passed pointer must be an unsigned long int pointer, while
the value used there is a sized_t pointer.  Fix it.

Fixes: 61bc4deff0 ("ALSA: pcm: replace simple_strtoul to kstrtoul")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202409010425.YPS7cWeJ-lkp@intel.com/
Link: https://patch.msgid.link/20240901134524.27107-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-09-01 15:46:11 +02:00
Hongbo Li
61bc4deff0 ALSA: pcm: replace simple_strtoul to kstrtoul
As mentioned in [1], "...simple_strtol(), simple_strtoll(),
simple_strtoul(), and simple_strtoull() functions explicitly
ignore overflows, which may lead to unexpected results in callers."
Hence, the use of those functions is discouraged.

This patch replace the use of the simple_strtoul with the safer
alternatives kstrtoul.

[1] https://www.kernel.org/doc/html/latest/process/deprecated.html#simple-strtol-simple-strtoll-simple-strtoul-simple-strtoull

Signed-off-by: Hongbo Li <lihongbo22@huawei.com>
Link: https://patch.msgid.link/20240831080639.3985143-1-lihongbo22@huawei.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-08-31 12:57:53 +02:00
Richard Fitzgerald
99c9767c04
ASoC: cs-amp-lib: Add KUnit test case for empty calibration entries
Add a test case for commit bb4485562f ("ASoC: cs-amp-lib: Ignore
empty UEFI calibration entries").

Any entries in the calibration blob that have calTime==0 are empty
entries. So they must not be returned by a lookup.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20240830144819.118362-1-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-30 15:59:54 +01:00
Srinivas Kandagatla
77212f300b
ASoC: codecs: lpass-va-macro: set the default codec version for sm8250
sm8250 and sc7280 have lpass codec version 1.0, as these are very old
platforms, they do not have a reliable way to get the codec version
from core_id registers.

On codec versions below 2.0, even though the core_id registers are
available to read, the values of these registers are not unique to be
able to determine the version of the codec dynamically.

Add the version info into of_data, so that driver does not need to use
core_id registers to get version number for such situations.

Fixes: 378918d591 ("ASoC: codecs: lpass-macro: add helpers to get codec version")
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Tested-by: Amit Pundir <amit.pundir@linaro.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Tested-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Link: https://patch.msgid.link/20240816091210.50172-1-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-30 13:54:24 +01:00
Kai Vehmanen
e9481d9b83 ALSA: hda: add HDMI codec ID for Intel PTL
Add HDMI codec ID for Intel Panther Lake platform.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@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://patch.msgid.link/20240830072458.110831-1-yung-chuan.liao@linux.intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-08-30 09:35:16 +02:00