Commit Graph

50484 Commits

Author SHA1 Message Date
Takashi Iwai
9a26234423 ALSA: pcm: Fix breakage of PCM rates used for topology
It turned out that the topology ABI takes the standard PCM rate bits
as is, and it means that the recent change of the PCM rate bits would
lead to the inconsistent rate values used for topology.

This patch reverts the original PCM rate bit definitions while adding
the new rates to the extended bits instead.  This needed the change of
snd_pcm_known_rates, too.  And this also required to fix the handling
in snd_pcm_hw_limit_rates() that blindly assumed that the list is
sorted while it became unsorted now.

Fixes: 090624b7dc ("ALSA: pcm: add more sample rate definitions")
Reported-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Closes: https://lore.kernel.org/1ab3efaa-863c-4dd0-8f81-b50fd9775fad@linux.intel.com
Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Tested-by: Jerome Brunet <jbrunet@baylibre.com>
Tested-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://patch.msgid.link/20240911135756.24434-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-09-11 16:17:44 +02:00
Muhammad Usama Anjum
5c4e15e632
ASoC: mediatek: mt8365: check validity before usage of i2s_data
There may be a case where i2s_data may not get initialized by the for
loop which will cause the kernel crash. Initialize the i2s_data to NULL
and abort execute if it isn't found.

Fixes: 402bbb13a1 ("ASoC: mediatek: mt8365: Add I2S DAI support")
Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://patch.msgid.link/20240911111317.4072349-1-usama.anjum@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-09-11 13:59:33 +01:00
Su Hui
38cc0334ba
ASoC: codecs: avoid possible garbage value in peb2466_reg_read()
Clang static checker (scan-build) warning:
sound/soc/codecs/peb2466.c:232:8:
Assigned value is garbage or undefined [core.uninitialized.Assign]
  232 |                 *val = tmp;
      |                      ^ ~~~

When peb2466_read_byte() fails, 'tmp' will have a garbage value.
Add a judgemnet to avoid this problem.

Fixes: 227f609c7c ("ASoC: codecs: Add support for the Infineon PEB2466 codec")
Signed-off-by: Su Hui <suhui@nfschina.com>
Link: https://patch.msgid.link/20240911115448.277828-1-suhui@nfschina.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-09-11 13:59:26 +01:00
Vijendar Mukunda
0b0aa67baa
ASoC: amd: acp: remove MODULE_ALIAS for sof based generic machine driver
As module device table added for AMD sof based generic machine driver,
MODULE_ALIAS is not required. Remove MODULE_ALIAS for AMD sof based
generic machine driver.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://patch.msgid.link/20240911093554.2076872-2-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-09-11 12:16:17 +01:00
Vijendar Mukunda
bacae49ecc
ASoC: amd: acp: remove MODULE_ALIAS for legacy machine driver
As module device table added for AMD legacy machine driver, MODULE_ALIAS
is not required. Remove MODULE_ALIAS for AMD legacy machine driver.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://patch.msgid.link/20240911093554.2076872-1-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-09-11 12:16:16 +01:00
Takashi Iwai
9408ace468 ALSA: memalloc: Drop Xen PV workaround again
Since recently in the commit e469e2045f ("ALSA: memalloc: Let IOMMU
handle S/G primarily"), the SG buffer allocation code was modified to
use the standard DMA code primarily and the fallback is applied only
limitedly.  This made the Xen PV specific workarounds we took in the
commit 53466ebdec ("ALSA: memalloc: Workaround for Xen PV") rather
superfluous.

It was a hackish workaround for the regression at that time, and it
seems that it's causing another issues (reportedly memory
corruptions).  So it's better to clean it up, after all.

Link: https://lore.kernel.org/20240906184209.25423-1-ariadne@ariadne.space
Cc: Ariadne Conill <ariadne@ariadne.space>
Link: https://patch.msgid.link/20240910113100.32542-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-09-11 08:31:19 +02:00
Leo Tsai
0ccbc99e05 ALSA: hda: Add a new CM9825 standard driver
The CM9825 is a High Definition Audio Codec.
There are 2 independent stereo outputs, one of the stereo
outputs is cap-less with HP AMP, and the other is line out to
connect the active speaker. The inputs can be Line-in and MIC-in.

Signed-off-by: Leo Tsai <antivirus621@gmail.com>
Link: https://patch.msgid.link/20240910065542.6534-1-antivirus621@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-09-11 08:29:03 +02:00
Andrew Kreimer
69f3014248
ASoC: tlv320aic31xx: Fix typos
Fix typos in comments.

Reported-by: Matthew Wilcox <willy@infradead.org>
Signed-off-by: Andrew Kreimer <algonell@gmail.com>
Link: https://patch.msgid.link/20240910211302.8909-1-algonell@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-09-10 23:46:53 +01:00
Zhang Zekun
afe671ac3e
ASoC: meson: Remove unused declartion in header file
The declaration of aiu_fifo_hw_free() has been removed since
commit e05cde84ea ("ASoC: meson: Use managed DMA buffer allocation").
Let's remove the unused declaration.

Fixes: e05cde84ea ("ASoC: meson: Use managed DMA buffer allocation")
Signed-off-by: Zhang Zekun <zhangzekun11@huawei.com>
Reviewed-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://patch.msgid.link/20240910122330.70684-1-zhangzekun11@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-09-10 18:02:37 +01:00
Jens Reidel
851e3a2a44
ASoC: qcom: sm8250: enable primary mi2s
When using primary mi2s on sm8250-compatible SoCs, the correct clock
needs to get enabled to be able to use the mi2s interface.

Signed-off-by: Jens Reidel <adrian@travitia.xyz>
Tested-by: Danila Tikhonov <danila@jiaxyga.com> # sm7325-nothing-spacewar
Link: https://patch.msgid.link/20240826134920.55148-2-adrian@travitia.xyz
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-09-10 14:16:02 +01:00
Tang Bin
5e6f78cb5f
ASoC: loongson: Add the correct judgement return
Use the function dev_err_probe can simplify code, but
the error return should not be deleted, that is
unreasonable, thus fix it.

Fixes: 3d2528d6c0 ("ASoC: loongson: Simplify with dev_err_probe()")
Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
Link: https://patch.msgid.link/20240910021104.3400-1-tangbin@cmss.chinamobile.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-09-10 12:40:25 +01:00
Tang Bin
86a7f453e9
ASoC: soc-ac97: Fix the incorrect description
In the function snd_soc_alloc_ac97_component &
snd_soc_new_ac97_component, the error return is
ERR_PTR, so fix the incorrect description.

Fixes: 47e039413c ("ASoC: Add support for allocating AC'97 device before registering it")
Fixes: 7361fbeaea ("ASoC: ac97: Add support for resetting device before registration")
Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
Link: https://patch.msgid.link/20240910013303.2044-1-tangbin@cmss.chinamobile.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-09-10 12:40:24 +01:00
Takashi Iwai
5ced8b914e ALSA: memalloc: Move snd_malloc_ops definition into memalloc.c again
The definition of struct snd_malloc_ops was moved out to
memalloc_local.h since there was another code for S/G buffer
allocation referring to the struct.  But since the code change to use
non-contiguous allocators, it's solely referred in memalloc.c, hence
it makes little sense to have a separate header file.

Let's move it back to memalloc.c.

Link: https://patch.msgid.link/20240910113141.32618-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-09-10 13:32:36 +02:00
Joshua Grisham
7e4d4b32ab ALSA: hda/realtek: Refactor and simplify Samsung Galaxy Book init
I have done a lot of analysis for these type of devices and collaborated
quite a bit with Nick Weihs (author of the first patch submitted for this
including adding samsung_helper.c). More information can be found in the
issue on Github [1] including additional rationale and testing.

The existing implementation includes a large number of equalizer coef
values that are not necessary to actually init and enable the speaker
amps, as well as create a somewhat worse sound profile. Users have
reported "muffled" or "muddy" sound; more information about this including
my analysis of the differences can be found in the linked Github issue.

This patch refactors the "v2" version of ALC298_FIXUP_SAMSUNG_AMP to a much
simpler implementation which removes the new samsung_helper.c, reuses more
of the existing patch_realtek.c, and sends significantly fewer unnecessary
coef values (including removing all of these EQ-specific coef values).

A pcm_playback_hook is used to dynamically enable and disable the speaker
amps only when there will be audio playback; this is to match the behavior
of how the driver for these devices is working in Windows, and is
suspected but not yet tested or confirmed to help with power consumption.

Support for models with 2 speaker amps vs 4 speaker amps is controlled by
a specific quirk name for both types. A new int num_speaker_amps has been
added to alc_spec so that the hooks can know how many speaker amps to
enable or disable. This design was chosen to limit the number of places
that subsystem ids will need to be maintained: like this, they can be
maintained only once in the quirk table and there will not be another
separate list of subsystem ids to maintain elsewhere in the code.

Also updated the quirk name from ALC298_FIXUP_SAMSUNG_AMP2 to
ALC298_FIXUP_SAMSUNG_AMP_V2_.. as this is not a quirk for "Amp #2" on
ALC298 but is instead a different version of how to handle it.

More devices have been added (see Github issue for testing confirmation),
as well as a small cleanup to existing names.

[1]: https://github.com/thesofproject/linux/issues/4055#issuecomment-2323411911

Signed-off-by: Joshua Grisham <josh@joshuagrisham.com>
Link: https://patch.msgid.link/20240909193000.838815-1-josh@joshuagrisham.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-09-10 10:28:55 +02:00
Edson Juliano Drosdeck
fc09ea51dd ALSA: hda/realtek: Enable mic on Vaio VJFH52
Vaio VJFH52 is equipped with ACL256, and needs a
fix to make the internal mic and headphone mic to work.
Also must to limits the internal microphone boost.

Signed-off-by: Edson Juliano Drosdeck <edson.drosdeck@gmail.com>
Link: https://patch.msgid.link/20240909162751.4790-1-edson.drosdeck@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-09-10 10:28:22 +02:00
Takashi Iwai
5516e3f476 Merge branch 'for-linus' into for-next
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-09-10 10:28:00 +02:00
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
Takashi Sakamoto
5c49cc0ed4 ALSA: firewire: use nonatomic PCM operation
In the former commits, the callback of isochronous context runs on usual
work process. In the case, ALSA PCM device has a flag, nonatomic, to
acquire mutex lock instead of spin lock for PCM substream group.

This commit uses the flag. It has an advantage in the case that ALSA PCM
application uses the large size of intermediate buffer, since it takes
too long time even in tasklet softIRQ to process many of isochronous
packets, then result in the delay of system event due to disabled IRQ so
long. It is avertible to switch to nonatomic operation.

Reviewed-by: Takashi Iwai <tiwai@suse.de>
Tested-by: Edmund Raile <edmund.raile@protonmail.com>
Link: https://lore.kernel.org/r/20240904125155.461886-6-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2024-09-04 21:51:54 +09: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
Terry Cheong
ef27e89e7f ALSA: hda/realtek: add patch for internal mic in Lenovo V145
Lenovo V145 is having phase inverted dmic but simply applying inverted
dmic fixups does not work. Chaining up verb fixes for ALC283 enables
inverting dmic fixup to work properly.

Signed-off-by: Terry Cheong <htcheong@chromium.org>
Cc: <stable@vger.kernel.org>
Link: https://patch.msgid.link/20240830-lenovo-v145-fixes-v3-1-f7b7265068fa@chromium.org
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-08-30 09:24:46 +02:00
Simon Trimmer
2186fe21e5 ALSA: hda/realtek: Autodetect Cirrus Logic companion amplifier bindings
We do not need model specific HDA quirks to construct the component
binding details of Cirrus Logic companion amplifiers as this information
is already present in the ACPI.

Quirks are then only required for special workarounds not described in
the ACPI such as internal configuration of the Realtek codecs.

The codec pointer is now initialized in hda_component_manager_init() so
that we can detect when companion amplifiers are found in the ACPI but
the SSID invokes a quirk that also attempts to create the component
binding.

Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Link: https://patch.msgid.link/20240829161114.140938-1-simont@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-08-29 18:17:08 +02:00
Takashi Iwai
dfe5b1fe04 Merge branch 'for-linus' into for-next
Pull 6.11 devel branch for applying further updates for Cirrus codecs

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-08-29 18:16:24 +02:00
Krzysztof Kozlowski
6b99dc62d9
ASoC: codecs: wsa884x: Implement temperature reading and hwmon
Read temperature of the speaker and expose it via hwmon interface, which
will be later used during calibration of speaker protection algorithms.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20240809110122.137761-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-29 17:04:46 +01:00
Matteo Martelli
3e83957e8d
ASoC: sunxi: sun4i-i2s: fix LRCLK polarity in i2s mode
This fixes the LRCLK polarity for sun8i-h3 and sun50i-h6 in i2s mode
which was wrongly inverted.

The LRCLK was being set in reversed logic compared to the DAI format:
inverted LRCLK for SND_SOC_DAIFMT_IB_NF and SND_SOC_DAIFMT_NB_NF; normal
LRCLK for SND_SOC_DAIFMT_IB_IF and SND_SOC_DAIFMT_NB_IF. Such reversed
logic applies properly for DSP_A, DSP_B, LEFT_J and RIGHT_J modes but
not for I2S mode, for which the LRCLK signal results reversed to what
expected on the bus. The issue is due to a misinterpretation of the
LRCLK polarity bit of the H3 and H6 i2s controllers. Such bit in this
case does not mean "0 => normal" or "1 => inverted" according to the
expected bus operation, but it means "0 => frame starts on low edge" and
"1 => frame starts on high edge" (from the User Manuals).

This commit fixes the LRCLK polarity by setting the LRCLK polarity bit
according to the selected bus mode and renames the LRCLK polarity bit
definition to avoid further confusion.

Fixes: dd657eae81 ("ASoC: sun4i-i2s: Fix the LRCK polarity")
Fixes: 73adf87b7a ("ASoC: sun4i-i2s: Add support for H6 I2S")
Signed-off-by: Matteo Martelli <matteomartelli3@gmail.com>
Link: https://patch.msgid.link/20240801-asoc-fix-sun4i-i2s-v2-1-a8e4e9daa363@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-29 15:57:07 +01:00
Markuss Broks
283844c355
ASoC: amd: yc: Add a quirk for MSI Bravo 17 (D7VEK)
MSI Bravo 17 (D7VEK), like other laptops from the family,
has broken ACPI tables and needs a quirk for internal mic
to work.

Signed-off-by: Markuss Broks <markuss.broks@gmail.com>
Link: https://patch.msgid.link/20240829130313.338508-1-markuss.broks@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-29 14:08:18 +01:00
Zhang Yi
5325b96769
ASoC: mediatek: mt8188-mt6359: Modify key
In order to get the correct keys when using the ES8326.We will associate
SND_JACK_BTN_1 to KEY_VOLUMEUP and SND_JACK_BTN_2 to KEY_VOLUMEDOWN
when the ES8326 flag is recognized.

Signed-off-by: Zhang Yi <zhangyi@everest-semi.com>
Link: https://patch.msgid.link/20240816114921.48913-1-zhangyi@everest-semi.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-28 21:41:43 +01:00
Mark Brown
4f451bc91e
ASoC: Intel: boards: updates for 6.12
Merge series from Bard Liao <yung-chuan.liao@linux.intel.com>:

Some simplifications from Brent Lu for Chromebooks, a new SoundWire codec
support from Bard Liao, new cs42l43 match entries support from
Charles Keepax, Add quirks from some new Dell laptops from Maciej
Strozek, some ACPI match entries from Balamurugan C, and few bug
fixes from Pierre-Louis Bossart.

v2:
 - Add "ASoC: SOF: Intel: hda: support BT link mask in mach_params"
   commit to fix the build issue in v1.

Balamurugan C (2):
  ASoC: Intel: soc-acpi: Add entry for sof_es8336 in ARL match table.
  ASoC: Intel: soc-acpi: Add entry for HDMI_In capture support in ARL
    match table

Bard Liao (4):
  ASoC: Intel: sof_sdw: add rt1320 amp support
  ASoC: SOF: Intel: hda: refactoring topology name fixup for HDA mach
  ASoC: Intel: sof_sdw: move ignore_internal_dmic check earlier
  ASoC: Intel: sof_sdw: overwrite mach_params->dmic_num

Brent Lu (5):
  ASoC: SOF: Intel: hda: refactoring topology name fixup for SDW mach
  ASoC: SOF: Intel: hda: support BT link mask in mach_params
  ASoC: Intel: skl_hda_dsp_generic: support BT audio offload
  ASoC: Intel: skl_hda_dsp_generic: remove hdac-hdmi support
  ASoC: Intel: skl_hda_dsp_generic: use sof_hdmi_private to init HDMI

Charles Keepax (3):
  ASoC: Intel: soc-acpi: arl: Add match entries for new cs42l43 laptops
  ASoC: Intel: soc-acpi: adl: Add match entries for new cs42l43 laptops
  ASoC: Intel: soc-acpi: lnl: Add match entries for new cs42l43 laptops

Maciej Strozek (1):
  ASoC: Intel: sof_sdw: Add quirks from some new Dell laptops

Pierre-Louis Bossart (2):
  ASoC: Intel: sof_sdw: make sof_sdw_quirk static
  ASoC: Intel: boards: always check the result of
    acpi_dev_get_first_match_dev()

 include/sound/soc-acpi.h                      |   2 +
 sound/soc/intel/boards/Kconfig                |   2 +-
 sound/soc/intel/boards/bytcht_cx2072x.c       |   4 +
 sound/soc/intel/boards/bytcht_da7213.c        |   4 +
 sound/soc/intel/boards/bytcht_es8316.c        |   2 +-
 sound/soc/intel/boards/bytcr_rt5640.c         |   2 +-
 sound/soc/intel/boards/bytcr_rt5651.c         |   2 +-
 sound/soc/intel/boards/cht_bsw_rt5645.c       |   4 +
 sound/soc/intel/boards/cht_bsw_rt5672.c       |   4 +
 sound/soc/intel/boards/skl_hda_dsp_common.c   |  56 ++--
 sound/soc/intel/boards/skl_hda_dsp_common.h   |  39 +--
 sound/soc/intel/boards/skl_hda_dsp_generic.c  |  58 ++--
 sound/soc/intel/boards/sof_es8336.c           |  12 +-
 sound/soc/intel/boards/sof_sdw.c              |  85 +++++-
 sound/soc/intel/boards/sof_sdw_common.h       |   2 -
 sound/soc/intel/boards/sof_wm8804.c           |   4 +
 .../intel/common/soc-acpi-intel-adl-match.c   | 105 +++++++
 .../intel/common/soc-acpi-intel-arl-match.c   | 244 +++++++++++++++
 .../intel/common/soc-acpi-intel-hda-match.c   |  12 +-
 .../intel/common/soc-acpi-intel-lnl-match.c   | 104 +++++++
 sound/soc/sdw_utils/soc_sdw_rt_amp.c          |  11 +-
 sound/soc/sdw_utils/soc_sdw_utils.c           |  19 ++
 sound/soc/sof/intel/hda.c                     | 281 ++++++++----------
 23 files changed, 780 insertions(+), 278 deletions(-)

--
2.43.0
2024-08-28 17:33:56 +01:00
Mark Brown
a1a94016db
ASoC: soc-pcm: makes snd_soc_dpcm_can_be_xxx() local
Merge series from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:

No driver is calling snd_soc_dpcm_can_be_xxx() functions. We don't need
to have EXPORT_SYMBOL_GPL() for them. This patch-set makes it static function.
2024-08-28 17:33:49 +01:00
Hongbo Li
75560718e8
ASoC: dapm: Use IS_ERR_OR_NULL() helper function
Use the IS_ERR_OR_NULL() helper instead of open-coding a
NULL and an error pointer checks to simplify the code and
improve readability.

Signed-off-by: Hongbo Li <lihongbo22@huawei.com>
Link: https://patch.msgid.link/20240828122829.3697502-1-lihongbo22@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-28 13:52:18 +01:00
Kuninori Morimoto
290f31e943
ASoC: soc-pcm: makes snd_soc_dpcm_can_be_xxx() local function
No driver is calling snd_soc_dpcm_can_be_xxx() functions. We don't need
to have EXPORT_SYMBOL_GPL() for them. Let's makes it static function.
One note is that snd_soc_dpcm_fe_can_update() is not used in upstream.
Use #if-endif and keep it for future support.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87h6b6df7e.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-28 13:02:20 +01:00
Kuninori Morimoto
4dd4baa440
ASoC: soc-pcm: move snd_soc_dpcm_can_be_xxx() to top
This patch moves snd_soc_dpcm_can_be_xxx() functions to top of soc-pcm.c
This is prepare for cleanup.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87ikvmdf7j.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-28 13:02:19 +01:00
Maciej Strozek
9307694f34
ASoC: Intel: sof_sdw: Add quirks from some new Dell laptops
Add quirks for some new Dell laptops using cs42l43's speaker outputs.

Signed-off-by: Maciej Strozek <mstrozek@opensource.cirrus.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://patch.msgid.link/20240827123215.258859-18-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-28 13:02:06 +01:00
Charles Keepax
1be6b1c689
ASoC: Intel: soc-acpi: lnl: Add match entries for new cs42l43 laptops
Add some new match table entries on Lunarlake for some coming cs42l43
laptops.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://patch.msgid.link/20240827123215.258859-17-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-28 13:02:05 +01:00
Charles Keepax
9ed85cb8c3
ASoC: Intel: soc-acpi: adl: Add match entries for new cs42l43 laptops
Add some new match table entries on Alderlake for some coming cs42l43
laptops.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://patch.msgid.link/20240827123215.258859-16-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-28 13:02:04 +01:00
Charles Keepax
c052406765
ASoC: Intel: soc-acpi: arl: Add match entries for new cs42l43 laptops
Add some new match table entries on Arrowlake for some coming cs42l43
laptops.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://patch.msgid.link/20240827123215.258859-15-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-28 13:02:03 +01:00
Brent Lu
690640ef35
ASoC: Intel: skl_hda_dsp_generic: use sof_hdmi_private to init HDMI
Use sof_hdmi_private structure instead of a link list of
skl_hda_hdmi_pcm structure for HDMI dai link initialization since
hdac-hdmi support is removed.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://patch.msgid.link/20240827123215.258859-14-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-28 13:02:02 +01:00
Brent Lu
a2a0312ac9
ASoC: Intel: skl_hda_dsp_generic: remove hdac-hdmi support
Since this machine driver has no longer been enumerated by SKL
platform driver, we could remove hdac-hdmi support code just like
what we did to other SOF machine drivers.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://patch.msgid.link/20240827123215.258859-13-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-28 13:02:01 +01:00
Balamurugan C
e1580f48d4
ASoC: Intel: soc-acpi: Add entry for HDMI_In capture support in ARL match table
Adding HDMI-In capture via I2S feature support in ARL platform.

Signed-off-by: Balamurugan C <balamurugan.c@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://patch.msgid.link/20240827123215.258859-12-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-28 13:02:00 +01:00
Balamurugan C
26254073e7
ASoC: Intel: soc-acpi: Add entry for sof_es8336 in ARL match table.
Adding ES83x6 codec support for ARL platforms and entry in match table.

Signed-off-by: Balamurugan C <balamurugan.c@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://patch.msgid.link/20240827123215.258859-11-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-28 13:01:59 +01:00
Brent Lu
0752ba426a
ASoC: Intel: skl_hda_dsp_generic: support BT audio offload
Add BT offload BE link to dai link array if the BT offload link mask
is valid (only one bit set).

Signed-off-by: Brent Lu <brent.lu@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://patch.msgid.link/20240827123215.258859-10-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-28 13:01:58 +01:00
Brent Lu
65dc80a78c
ASoC: SOF: Intel: hda: support BT link mask in mach_params
Add an new variable bt_link_mask to snd_soc_acpi_mach_params structure.
SSP port mask of BT offload found in NHLT table will be sent to
machine driver to setup BE dai link with correct SSP port number.

This patch only detects and enables the BT dailink. The functionality
will only be unlocked with a topology file that makes a reference to
that BT dailink. For backwards-compatibility reasons, this topology
will not be used by default. Chromebooks and Linux users willing to
experiment shall use the tplg_name kernel parameter to force the use
of an enhanced topology.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://patch.msgid.link/20240827123215.258859-9-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-28 13:01:57 +01:00
Bard Liao
7db9f63611
ASoC: Intel: sof_sdw: overwrite mach_params->dmic_num
mach_params->dmic_num will be used to set the cfg-mics value of
card->components string. Overwrite it to the actual number of PCH
DMICs used in the device.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://patch.msgid.link/20240827123215.258859-8-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-28 13:01:56 +01:00
Bard Liao
775c1a4aa6
ASoC: Intel: sof_sdw: move ignore_internal_dmic check earlier
dmic links will not be created if ctx->ignore_internal_dmic is set, and
dmic_num should be 0 in this case. Move ignore_internal_dmic check
earlier where dmic_num is set to get an accurate dmic_num.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://patch.msgid.link/20240827123215.258859-7-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-28 13:01:55 +01:00
Brent Lu
85b66359c5
ASoC: SOF: Intel: hda: refactoring topology name fixup for SDW mach
Remove SDW mach's topology name fixup code and use the code in
hda_machine_select() to fixup its topology file name. No functional
change in this commit.

Compared with I2S/HDA mach, SDW mach always fixup topology file name
with dmic num without using DMIC quirk flag and pass topology name
with file extension to SOF driver. Therefore, we add extra code to
remove file extension if it exists.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://patch.msgid.link/20240827123215.258859-6-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-28 13:01:54 +01:00
Bard Liao
5458411d75
ASoC: SOF: Intel: hda: refactoring topology name fixup for HDA mach
Move I2S mach's topology name fixup code to the end of machine driver
enumeration flow so HDA mach could also use same code to fixup its
topology file name as well. No functional change in this commit.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://patch.msgid.link/20240827123215.258859-5-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-28 13:01:54 +01:00
Pierre-Louis Bossart
14e91ddd5c
ASoC: Intel: boards: always check the result of acpi_dev_get_first_match_dev()
The code seems mostly copy-pasted, with some machine drivers
forgetting to test if the 'adev' result is NULL.

Add this check when missing, and use -ENOENT consistently as an error
code.

Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/alsa-devel/918944d2-3d00-465e-a9d1-5d57fc966113@stanley.mountain/T/#u
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://patch.msgid.link/20240827123215.258859-4-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-28 13:01:53 +01:00
Bard Liao
1ab959bea2
ASoC: Intel: sof_sdw: add rt1320 amp support
Add Realtek rt1320 amp support.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://patch.msgid.link/20240827123215.258859-3-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-28 13:01:52 +01:00
Pierre-Louis Bossart
6785244f3d
ASoC: Intel: sof_sdw: make sof_sdw_quirk static
There's no need to make this variable visible at a higher level.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://patch.msgid.link/20240827123215.258859-2-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-28 13:01:51 +01:00
Chen-Yu Tsai
e0be875c5b
ASoc: SOF: topology: Clear SOF link platform name upon unload
The SOF topology loading function sets the device name for the platform
component link. This should be unset when unloading the topology,
otherwise a machine driver unbind/bind or reprobe would complain about
an invalid component as having both its component name and of_node set:

    mt8186_mt6366 sound: ASoC: Both Component name/of_node are set for AFE_SOF_DL1
    mt8186_mt6366 sound: error -EINVAL: Cannot register card
    mt8186_mt6366 sound: probe with driver mt8186_mt6366 failed with error -22

This happens with machine drivers that set the of_node separately.

Clear the SOF link platform name in the topology unload callback.

Fixes: 311ce4fe76 ("ASoC: SOF: Add support for loading topologies")
Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
Link: https://patch.msgid.link/20240821041006.2618855-1-wenst@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-28 13:01:44 +01:00
Christoffer Sandberg
4178d78cd7 ALSA: hda/conexant: Add pincfg quirk to enable top speakers on Sirius devices
The Sirius notebooks have two sets of speakers 0x17 (sides) and
0x1d (top center). The side speakers are active by default but
the top speakers aren't.

This patch provides a pincfg quirk to activate the top speakers.

Signed-off-by: Christoffer Sandberg <cs@tuxedo.de>
Signed-off-by: Werner Sembach <wse@tuxedocomputers.com>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20240827102540.9480-1-wse@tuxedocomputers.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-08-28 08:27:06 +02:00
Linus Torvalds
6ace1c7ea2 sound fixes for 6.11-rc6
It became a bit larger collection of fixes than wished at this time,
 but all changes are small and mostly device-specific fixes that
 should be fairly safe to apply.  Majority of fixes are about ASoC
 for AMD SOF, Cirrus codecs, lpass, etc, in addition to the usual
 HD-audio quirks / fixes.
 -----BEGIN PGP SIGNATURE-----
 
 iQJCBAABCAAsFiEEIXTw5fNLNI7mMiVaLtJE4w1nLE8FAmbNkGYOHHRpd2FpQHN1
 c2UuZGUACgkQLtJE4w1nLE/yZxAAwFz2l10Kia6qPJuqmlfZU4o6Wwt7x4MPO+hS
 v0t2P9HqesiFA3ObYpOHYTsR1ufz1Jvh8X99Ie5GinjxOvAO95TAvAL1UVq9zWTw
 J1pUQ8eFJjRAufAzFFo4Ffn2F5VmYdTK8HYPzy+3+ck5pdFSNcF3x1oc3b6gOb7f
 xA9I6L6xLQdcKYAOfUFRuh1HvV970vdPNwJnxQXwy4R/UwJWqkkVlnwPmnpiz/Xg
 7u95QdtlL8H46AqNgufDBZ0i+1reO3vMaJY5Xrz2c7egxyQqbH4fcHEqgRRVKZ7N
 WF9Bti8YXcruBB0FLIuNIPs2dRnnYmZy1fZy0gOtJzhIUZI08+zr+gm5BxAat/q2
 /ktjPWTc7LGRQLrZ1T9x6zmnJ6Cq8vCF4zyN/bSI7VhWr/KtfyZzu5PKpgx81zS9
 r3UP+edaOcf4Xvsg95D6QQxFTkg46kg730jUeKAg47R1dnCqZvZKLkZWS/IusV9u
 TBnV1JKrgkyJu3a/1RP1hN1eGWaAPm1Z8aI2VorG16/FUNlBkyn6KFiLRJk7phRL
 RtHN8oZUiyxV+swLprYnZ1e8uYhLEklqQ3HZkchj2DKOj/Oe180udlEQpxAzLnd+
 4G2iY2A/4x2Aab1YgH5xuPoC6sw1l7EJ0lZbxhlE6vHnOBL8+wx0cwnmH51QxftS
 lk0eCSI=
 =u+nW
 -----END PGP SIGNATURE-----

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

Pull sound fixes from Takashi Iwai:
 "It became a bit larger collection of fixes than wished at this time,
  but all changes are small and mostly device-specific fixes that should
  be fairly safe to apply.

  Majority of fixes are about ASoC for AMD SOF, Cirrus codecs, lpass,
  etc, in addition to the usual HD-audio quirks / fixes"

* tag 'sound-6.11-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (22 commits)
  ALSA: hda: hda_component: Fix mutex crash if nothing ever binds
  ALSA: hda/realtek: support HP Pavilion Aero 13-bg0xxx Mute LED
  ALSA: hda/realtek: Fix the speaker output on Samsung Galaxy Book3 Ultra
  ASoC: cs-amp-lib: Ignore empty UEFI calibration entries
  ASoC: cs-amp-lib-test: Force test calibration blob entries to be valid
  ALSA: hda/realtek - FIxed ALC285 headphone no sound
  ALSA: hda/realtek - Fixed ALC256 headphone no sound
  ASoC: allow module autoloading for table board_ids
  ASoC: allow module autoloading for table db1200_pids
  ALSA: hda: cs35l56: Don't use the device index as a calibration index
  ALSA: seq: Skip event type filtering for UMP events
  ALSA: hda/realtek: Enable mute/micmute LEDs on HP Laptop 14-ey0xxx
  ASoC: SOF: amd: Fix for acp init sequence
  ASoC: amd: acp: fix module autoloading
  ASoC: mediatek: mt8188: Mark AFE_DAC_CON0 register as volatile
  ASoC: codecs: wcd937x: Fix missing de-assert of reset GPIO
  ASoC: SOF: mediatek: Add missing board compatible
  ASoC: MAINTAINERS: Drop Banajit Goswami from Qualcomm sound drivers
  ASoC: SOF: amd: Fix for incorrect acp error register offsets
  ASoC: SOF: amd: move iram-dram fence register programming sequence
  ...
2024-08-28 06:24:22 +12:00
Takashi Iwai
5e1c5c5a68 ALSA: pcm: Drop PCM vmalloc buffer helpers
As the last-standing user of PCM vmalloc buffer helper API took its
own buffer management, we can finally drop those API functions, which
were leftover after reorganization of ALSA memalloc code.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240807152725.18948-3-tiwai@suse.de
2024-08-27 08:44:58 +02:00