aboutsummaryrefslogtreecommitdiff
path: root/sound
AgeCommit message (Collapse)AuthorFilesLines
2024-09-12ASoC: SOF: Intel: hda: remove common_hdmi_codec_drvBrent Lu1-1/+0
Do not set common_hdmi_codec_drv in SOF platform driver since no machine driver needs it. Remove member variable common_hdmi_codec_drv from snd_soc_acpi_mach_params structure. Signed-off-by: Brent Lu <[email protected]> Reviewed-by: Péter Ujfalusi <[email protected]> Signed-off-by: Bard Liao <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-09-12ASoC: Intel: sof_pcm512x: do not check common_hdmi_codec_drvBrent Lu1-2/+1
The variable common_hdmi_codec_drv is always true on SOF platform so we could remove the reference in machine driver. Signed-off-by: Brent Lu <[email protected]> Reviewed-by: Péter Ujfalusi <[email protected]> Signed-off-by: Bard Liao <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-09-12ASoC: Intel: ehl_rt5660: do not check common_hdmi_codec_drvBrent Lu1-2/+1
The variable common_hdmi_codec_drv is always true on SOF platform so we could remove the reference in machine driver. Signed-off-by: Brent Lu <[email protected]> Reviewed-by: Péter Ujfalusi <[email protected]> Signed-off-by: Bard Liao <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-09-12ASoC: Intel: skl_hda_dsp_generic: use common module for DAI linksBrent Lu5-379/+70
Use intel_board module to create DAI link array for Intel iDisp HDMI, HDA external codec, DMIC01, DMIC16K, and BT audio offload DAI BE links. Signed-off-by: Brent Lu <[email protected]> Reviewed-by: Péter Ujfalusi <[email protected]> Signed-off-by: Bard Liao <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-09-12ASoC: Intel: board_helpers: support HDA link initializationBrent Lu2-0/+155
Add a helper function for machine drivers to initialize HDA external codec DAI link. Signed-off-by: Brent Lu <[email protected]> Reviewed-by: Péter Ujfalusi <[email protected]> Signed-off-by: Bard Liao <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-09-12ASoC: Improvements for mchp-pdmcMark Brown1-11/+29
Merge series from Andrei Simion <[email protected]>: This patch set is intended to enhance the functionality and maintainability of the mchp-pdmc driver: - Enhances performance by refining maxburst logic. - Introduces a name for better identification and management.
2024-09-12ALSA: ump: Use %*ph to print small bufferAndy Shevchenko1-10/+3
Use %*ph format to print small buffer as hex string. Signed-off-by: Andy Shevchenko <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
2024-09-11ASoC: meson: axg-card: fix 'use-after-free'Arseniy Krasnov1-1/+2
Buffer 'card->dai_link' is reallocated in 'meson_card_reallocate_links()', so move 'pad' pointer initialization after this function when memory is already reallocated. Kasan bug report: ================================================================== BUG: KASAN: slab-use-after-free in axg_card_add_link+0x76c/0x9bc Read of size 8 at addr ffff000000e8b260 by task modprobe/356 CPU: 0 PID: 356 Comm: modprobe Tainted: G O 6.9.12-sdkernel #1 Call trace: dump_backtrace+0x94/0xec show_stack+0x18/0x24 dump_stack_lvl+0x78/0x90 print_report+0xfc/0x5c0 kasan_report+0xb8/0xfc __asan_load8+0x9c/0xb8 axg_card_add_link+0x76c/0x9bc [snd_soc_meson_axg_sound_card] meson_card_probe+0x344/0x3b8 [snd_soc_meson_card_utils] platform_probe+0x8c/0xf4 really_probe+0x110/0x39c __driver_probe_device+0xb8/0x18c driver_probe_device+0x108/0x1d8 __driver_attach+0xd0/0x25c bus_for_each_dev+0xe0/0x154 driver_attach+0x34/0x44 bus_add_driver+0x134/0x294 driver_register+0xa8/0x1e8 __platform_driver_register+0x44/0x54 axg_card_pdrv_init+0x20/0x1000 [snd_soc_meson_axg_sound_card] do_one_initcall+0xdc/0x25c do_init_module+0x10c/0x334 load_module+0x24c4/0x26cc init_module_from_file+0xd4/0x128 __arm64_sys_finit_module+0x1f4/0x41c invoke_syscall+0x60/0x188 el0_svc_common.constprop.0+0x78/0x13c do_el0_svc+0x30/0x40 el0_svc+0x38/0x78 el0t_64_sync_handler+0x100/0x12c el0t_64_sync+0x190/0x194 Fixes: 7864a79f37b5 ("ASoC: meson: add axg sound card support") Cc: [email protected] Signed-off-by: Arseniy Krasnov <[email protected]> Reviewed-by: Jerome Brunet <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-09-11Add support for primary mi2s on SM8250Mark Brown1-0/+8
Merge series from Jens Reidel <[email protected]>: This patch adds support for the primary mi2s interface on devices using SM8250 audio drivers. Tested on SM7150 (xiaomi-davinci). SM7150 sound is close to SM8250 and we intend to use it as a fallback in the future. To: Srinivas Kandagatla <[email protected]> To: Liam Girdwood <[email protected]> To: Mark Brown <[email protected]> To: Jaroslav Kysela <[email protected]> To: Takashi Iwai <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Jens Reidel (1): ASoC: qcom: sm8250: enable primary mi2s sound/soc/qcom/sm8250.c | 8 ++++++++ 1 file changed, 8 insertions(+) -- 2.46.0
2024-09-11ASoC: atmel: mchp-pdmc: Add snd_soc_dai_driver nameCodrin Ciubotariu1-0/+1
Set snd_soc_dai_driver name to improve controller's display of the DAI name. Signed-off-by: Codrin Ciubotariu <[email protected]> Signed-off-by: Andrei Simion <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-09-11ASoC: atmel: mchp-pdmc: Improve maxburst calculation for better performanceCodrin Ciubotariu1-11/+28
Improve the DMA descriptor calculation by dividing the period size by the product of sample size and DMA chunk size, rather than just DMA chunk size. Ensure that all DMA descriptors start from a well-aligned address to improve the reliability and efficiency of DMA operations and avoid potential issues related to misaligned descriptors. [[email protected]: Adjust the commit title. Reword the commit message. Add MACROS for each DMA size chunk supported by mchp-pdmc. Add DMA_BURST_ALIGNED preprocesor function to check the alignment of the DMA burst.] Signed-off-by: Codrin Ciubotariu <[email protected]> Signed-off-by: Andrei Simion <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-09-11ALSA: pcm: Fix breakage of PCM rates used for topologyTakashi Iwai2-11/+17
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: 090624b7dc83 ("ALSA: pcm: add more sample rate definitions") Reported-by: Pierre-Louis Bossart <[email protected]> Closes: https://lore.kernel.org/[email protected] Reviewed-by: Jaroslav Kysela <[email protected]> Tested-by: Jerome Brunet <[email protected]> Tested-by: Bard Liao <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
2024-09-11ASoC: mediatek: mt8365: check validity before usage of i2s_dataMuhammad Usama Anjum1-1/+4
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: 402bbb13a195 ("ASoC: mediatek: mt8365: Add I2S DAI support") Signed-off-by: Muhammad Usama Anjum <[email protected]> Reviewed-by: AngeloGioacchino Del Regno <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-09-11ASoC: codecs: avoid possible garbage value in peb2466_reg_read()Su Hui1-1/+2
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: 227f609c7c0e ("ASoC: codecs: Add support for the Infineon PEB2466 codec") Signed-off-by: Su Hui <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-09-11ASoC: amd: acp: remove MODULE_ALIAS for sof based generic machine driverVijendar Mukunda1-7/+0
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 <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-09-11ASoC: amd: acp: remove MODULE_ALIAS for legacy machine driverVijendar Mukunda1-7/+0
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 <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-09-11ALSA: memalloc: Drop Xen PV workaround againTakashi Iwai1-16/+3
Since recently in the commit e469e2045f1b ("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 53466ebdec61 ("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/[email protected] Cc: Ariadne Conill <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
2024-09-11ALSA: hda: Add a new CM9825 standard driverLeo Tsai1-0/+269
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 <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
2024-09-10ASoC: tlv320aic31xx: Fix typosAndrew Kreimer1-1/+1
Fix typos in comments. Reported-by: Matthew Wilcox <[email protected]> Signed-off-by: Andrew Kreimer <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-09-10ASoC: meson: Remove unused declartion in header fileZhang Zekun1-2/+0
The declaration of aiu_fifo_hw_free() has been removed since commit e05cde84eabc ("ASoC: meson: Use managed DMA buffer allocation"). Let's remove the unused declaration. Fixes: e05cde84eabc ("ASoC: meson: Use managed DMA buffer allocation") Signed-off-by: Zhang Zekun <[email protected]> Reviewed-by: Jerome Brunet <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-09-10ASoC: qcom: sm8250: enable primary mi2sJens Reidel1-0/+8
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 <[email protected]> Tested-by: Danila Tikhonov <[email protected]> # sm7325-nothing-spacewar Link: https://patch.msgid.link/[email protected] Reviewed-by: Dmitry Baryshkov <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2024-09-10ASoC: loongson: Add the correct judgement returnTang Bin2-8/+8
Use the function dev_err_probe can simplify code, but the error return should not be deleted, that is unreasonable, thus fix it. Fixes: 3d2528d6c021 ("ASoC: loongson: Simplify with dev_err_probe()") Signed-off-by: Tang Bin <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-09-10ASoC: soc-ac97: Fix the incorrect descriptionTang Bin1-2/+2
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: 47e039413cac ("ASoC: Add support for allocating AC'97 device before registering it") Fixes: 7361fbeaeaab ("ASoC: ac97: Add support for resetting device before registration") Signed-off-by: Tang Bin <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-09-10ALSA: memalloc: Move snd_malloc_ops definition into memalloc.c againTakashi Iwai2-17/+11
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/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
2024-09-10ALSA: hda/realtek: Refactor and simplify Samsung Galaxy Book initJoshua Grisham2-317/+144
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 <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
2024-09-10ALSA: hda/realtek: Enable mic on Vaio VJFH52Edson Juliano Drosdeck1-0/+12
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 <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
2024-09-10Merge branch 'for-linus' into for-nextTakashi Iwai22-89/+128
Signed-off-by: Takashi Iwai <[email protected]>
2024-09-09ASoC: mt8365: Fix -Werror buildsMark Brown8-153/+120
Merge series from Mark Brown <[email protected]>: 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-09ASoC: loongson: Simplify code formattingMark Brown5-159/+157
Merge series from Binbin Zhou <[email protected]>: This patchset attempts to improve code readability by simplifying code formatting. No functional changes.
2024-09-09ASoC: Switch back to struct platform_driver::remove()Uwe Kleine-König184-184/+184
After commit 0edb555a65d1 ("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 <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-09-09ASoC: atmel: mchp-i2s-mcc: Remove interface name from stream_nameCodrin Ciubotariu1-2/+2
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 <[email protected]> Signed-off-by: Andrei Simion <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-09-09ASoC: codecs: fix the right check and simplify codeTang Bin1-5/+5
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: 5e2404493f9f ("ASoC: codecs: add MT6357 support") Signed-off-by: Tang Bin <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-09-09ASoC: mt8365: Allow build coverageMark Brown1-1/+1
There is no build time dependency on anything specific to ARCH_MEDIATEK so enable COMPILE_TEST builds. Reviewed-by: AngeloGioacchino Del Regno <[email protected]> Reviewed-by: Alexandre Mergnat <[email protected]> Tested-by: Nathan Chancellor <[email protected]> # build Signed-off-by: Mark Brown <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-09-09ASoC: mt8365: Remove unused DMIC IIR coefficient configurationMark Brown1-30/+0
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 <[email protected]> Reviewed-by: AngeloGioacchino Del Regno <[email protected]> Tested-by: Nathan Chancellor <[email protected]> # build Signed-off-by: Mark Brown <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-09-09ASoC: mt8365: Remove unused variablesMark Brown2-3/+1
Silence compiler warnings by removing unused variables. Reported-by: Nathan Chancellor <[email protected]> Reviewed-by: Alexandre Mergnat <[email protected]> Reviewed-by: AngeloGioacchino Del Regno <[email protected]> Tested-by: Nathan Chancellor <[email protected]> # build Signed-off-by: Mark Brown <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-09-09ASoC: mt8365: Make non-exported functions staticMark Brown2-8/+8
The compilers warn if functions without a prototype are not static so add appropriate static declarations. Reported-by: Nathan Chancellor <[email protected]> Reviewed-by: Alexandre Mergnat <[email protected]> Reviewed-by: AngeloGioacchino Del Regno <[email protected]> Tested-by: Nathan Chancellor <[email protected]> # build Signed-off-by: Mark Brown <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-09-09ASoC: mt8365: Remove unused prototype for mt8365_afe_clk_group_48k()Mark Brown1-1/+0
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 <[email protected]> Reviewed-by: Alexandre Mergnat <[email protected]> Tested-by: Nathan Chancellor <[email protected]> # build Signed-off-by: Mark Brown <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-09-09ASoC: mt8365: Remove spurious unsigned long castsMark Brown1-3/+3
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 <[email protected]> Reviewed-by: AngeloGioacchino Del Regno <[email protected]> Tested-by: Nathan Chancellor <[email protected]> # build Signed-off-by: Mark Brown <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-09-09ASoC: mt8365: Open code BIT() to avoid spurious warningsMark Brown1-107/+107
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 <[email protected]> Reviewed-by: Alexandre Mergnat <[email protected]> Tested-by: Nathan Chancellor <[email protected]> # build Signed-off-by: Mark Brown <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-09-09ASoC: loongson: Factor out loongson i2s enable clock functionsBinbin Zhou1-39/+47
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 <[email protected]> Link: https://patch.msgid.link/d6f6c818b0ecee87277f704b6a801cbbf5e712ce.1725844530.git.zhoubinbin@loongson.cn Signed-off-by: Mark Brown <[email protected]>
2024-09-09ASoC: loongson: Factor out loongson_card_acpi_find_device() functionBinbin Zhou1-24/+31
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 <[email protected]> Link: https://patch.msgid.link/3b7da05e5fd4326e7944aa749bf06dd44e964f6c.1725844530.git.zhoubinbin@loongson.cn Signed-off-by: Mark Brown <[email protected]>
2024-09-09ASoC: loongson: Replace if with ternary operatorBinbin Zhou1-14/+10
Replace an if statement with a ternary operator, making the code a tiny bit shorter. Signed-off-by: Binbin Zhou <[email protected]> Link: https://patch.msgid.link/94ec2ac178610f50af4815ef5b719695915bba31.1725844530.git.zhoubinbin@loongson.cn Signed-off-by: Mark Brown <[email protected]>
2024-09-09ASoC: loongson: Simplify if statment in loongson_card_hw_params()Binbin Zhou1-16/+16
Deal with illegal conditions first and put the normal process code outside the if condition to improve code readability. Signed-off-by: Binbin Zhou <[email protected]> Link: https://patch.msgid.link/98b71f9643970f11bc500c01599c7aeb77ff2a58.1725844530.git.zhoubinbin@loongson.cn Signed-off-by: Mark Brown <[email protected]>
2024-09-09ASoC: loongson: Simplify with dev_err_probe()Binbin Zhou2-35/+21
Error handling in probe() can be a bit simpler with dev_err_probe(). Signed-off-by: Binbin Zhou <[email protected]> Link: https://patch.msgid.link/07855aa6c290ec826d63e68b898e7f4afac5e30d.1725844530.git.zhoubinbin@loongson.cn Signed-off-by: Mark Brown <[email protected]>
2024-09-09ASoC: loongson: Simplify probe() with local dev variableBinbin Zhou2-23/+24
Simplify the probe() function by using local 'dev' instead of &pdev->dev. Signed-off-by: Binbin Zhou <[email protected]> Link: https://patch.msgid.link/1984a20930da515e2a478b02159f83c02498f6be.1725844530.git.zhoubinbin@loongson.cn Signed-off-by: Mark Brown <[email protected]>
2024-09-09ASoC: loongson: Use BIT() macroBinbin Zhou2-17/+17
Where applicable, use BIT() macro instead of shift operation to improve readability. Signed-off-by: Binbin Zhou <[email protected]> Link: https://patch.msgid.link/ccca555c96f18c0ecf5f1544c82945ba651d105f.1725844530.git.zhoubinbin@loongson.cn Signed-off-by: Mark Brown <[email protected]>
2024-09-09ALSA: hda: Use non-SG allocation for the communication buffersTakashi Iwai1-1/+1
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 37137ec26c2c ("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 9c27301342a5 ("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/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
2024-09-09ASoC: mediatek: mt8365: remove unused mt8365_i2s_hd_strArnd Bergmann1-7/+0
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: 402bbb13a195 ("ASoC: mediatek: mt8365: Add I2S DAI support") Signed-off-by: Arnd Bergmann <[email protected]> Reviewed-by: Matthias Brugger <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-09-09ASoC: mediatek: mt8365: include linux/bitfield.hArnd Bergmann1-0/+2
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: 38c7c9ddc740 ("ASoC: mediatek: mt8365: Add common header") Signed-off-by: Arnd Bergmann <[email protected]> Reviewed-by: Matthias Brugger <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-09-09ASoC: tlv320aic31xx: Add support for loading filter coefficientsRomain Gantois1-0/+100
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 <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>