aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2024-07-19ALSA: hda: tas2781: mark const variables as __maybe_unusedArnd Bergmann1-3/+3
An earlier patch changed the DECLARE_TLV_DB_SCALE declaration, but now there are additional static const variables that cause the same build warnings: In file included from sound/pci/hda/tas2781_hda_i2c.c:23: include/sound/tas2781-tlv.h:23:28: error: 'tas2563_dvc_table' defined but not used [-Werror=unused-const-variable=] 23 | static const unsigned char tas2563_dvc_table[][4] = { | ^~~~~~~~~~~~~~~~~ In file included from include/sound/tlv.h:10, from sound/pci/hda/tas2781_hda_i2c.c:22: include/sound/tas2781-tlv.h:20:35: error: 'tas2563_dvc_tlv' defined but not used [-Werror=unused-const-variable=] 20 | static const DECLARE_TLV_DB_SCALE(tas2563_dvc_tlv, -12150, 50, 1); | ^~~~~~~~~~~~~~~ Mark them all as unused as well. Signed-off-by: Arnd Bergmann <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
2024-07-19ALSA: usb-audio: Fix microphone sound on HD webcam.wangdicheng2-0/+9
I own an external usb Webcam, HD webcam, which had low mic volume and inconsistent sound quality. Video works as expected. (snip) [ 95.473820][ 1] [ T73] usb 5-2.2: new high-speed USB device number 7 using xhci_hcd [ 95.773974][ 1] [ T73] usb 5-2.2: New USB device found, idVendor=1bcf, idProduct=2281, bcdDevice= 0.05 [ 95.783445][ 1] [ T73] usb 5-2.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ 95.791872][ 1] [ T73] usb 5-2.2: Product: HD webcam [ 95.797001][ 1] [ T73] usb 5-2.2: Manufacturer: Sunplus IT Co [ 95.802996][ 1] [ T73] usb 5-2.2: SerialNumber: 20200513 [ 96.092610][ 2] [ T3680] usb 5-2.2: Warning! Unlikely big volume range (=4096), cval->res is probably wrong. [ 96.102436][ 2] [ T3680] usb 5-2.2: [5] FU [Mic Capture Volume] ch = 1, val = 0/4096/1 Set up quirk cval->res to 16 for 256 levels, Set GET_SAMPLE_RATE quirk flag to stop trying to get the sample rate. Confirmed that happened anyway later due to the backoff mechanism, After 3 failures. All audio stream on device interfaces share the same values, apart from wMaxPacketSize and tSamFreq : bLength 9 bDescriptorType 4 bInterfaceNumber 3 bAlternateSetting 4 bNumEndpoints 1 bInterfaceClass 1 Audio Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 3 bAlternateSetting 4 bNumEndpoints 1 bInterfaceClass 1 Audio bInterfaceSubClass 2 Streaming bInterfaceProtocol 0 iInterface 0 AudioStreaming Interface Descriptor: bLength 7 bDescriptorType 36 bDescriptorSubtype 1 (AS_GENERAL) bTerminalLink 3 bDelay 1 frames wFormatTag 0x0001 PCM AudioStreaming Interface Descriptor: bLength 11 bDescriptorType 36 bDescriptorSubtype 2 (FORMAT_TYPE) bFormatType 1 (FORMAT_TYPE_I) bNrChannels 1 bSubframeSize 2 bBitResolution 16 bSamFreqType 1 Discrete tSamFreq[ 0] 48000 Endpoint Descriptor: bLength 9 bDescriptorType 5 bEndpointAddress 0x86 EP 6 IN bmAttributes 5 Transfer Type Isochronous Synch Type Asynchronous Usage Type Data wMaxPacketSize 0x0064 1x 100 bytes bInterval 4 bRefresh 0 bSynchAddress 0 AudioStreaming Endpoint Descriptor: bLength 7 bDescriptorType 37 bDescriptorSubtype 1 (EP_GENERAL) bmAttributes 0x01 Sampling Frequency bLockDelayUnits 0 Undefined wLockDelay 0x0000 (snip) Testing patch provides consistent good sound recording quality and volume range. (snip) [ 95.473820][ 1] [ T73] usb 5-2.2: new high-speed USB device number 7 using xhci_hcd [ 95.773974][ 1] [ T73] usb 5-2.2: New USB device found, idVendor=1bcf, idProduct=2281, bcdDevice= 0.05 [ 95.783445][ 1] [ T73] usb 5-2.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ 95.791872][ 1] [ T73] usb 5-2.2: Product: HD webcam [ 95.797001][ 1] [ T73] usb 5-2.2: Manufacturer: Sunplus IT Co [ 95.802996][ 1] [ T73] usb 5-2.2: SerialNumber: 20200513 [ 96.110630][ 3] [ T3680] usbcore: registered new interface driver snd-usb-audio [ 96.114329][ 7] [ T3677] usb 5-2.2: Found UVC 1.00 device HD webcam (1bcf:2281) [ 96.167555][ 7] [ T3677] usbcore: registered new interface driver uvcvideo Signed-off-by: wangdicheng <[email protected]> Cc: <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
2024-07-18kselftest/alsa: Log the PCM ID in pcm-testMark Brown1-0/+4
Drivers report a string with a name for each PCM, log it during startup of pcm-test as a diagnostic aid. Signed-off-by: Mark Brown <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
2024-07-18kselftest/alsa: Use card name rather than number in test namesMark Brown2-58/+104
Currently for the PCM and mixer tests we report test names which identify the card being tested with the card number. This ensures we have unique names but since card numbers are dynamically assigned at runtime the names we end up with will often not be stable on systems with multiple cards especially where those cards are provided by separate modules loeaded at runtime. This makes it difficult for automated systems and UIs to relate test results between runs on affected platforms. Address this by replacing our use of card numbers with card names which are more likely to be stable across runs. We use the card ID since it is guaranteed to be unique by default, unlike the long name. There is still some vulnerability to ordering issues if multiple cards with the same base ID are present in the system but have separate dependencies but not all drivers put distinguishing information in their long names. Signed-off-by: Mark Brown <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
2024-07-18ALSA: hda/realtek: Fix the speaker output on Samsung Galaxy Book Pro 360Seunghun Han1-0/+1
Samsung Galaxy Book Pro 360 (13" 2022 NT935QDB-KC71S) with codec SSID 144d:c1a4 requires the same workaround to enable the speaker amp as other Samsung models with the ALC298 codec. Signed-off-by: Seunghun Han <[email protected]> Cc: <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
2024-07-17ALSA: hda/tas2781: Add new quirk for Lenovo Hera2 LaptopShenghao Ding1-0/+1
Add new vendor_id and subsystem_id in quirk for Lenovo Hera2 Laptop. Signed-off-by: Shenghao Ding <[email protected]> Cc: <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
2024-07-17ALSA: seq: ump: Skip useless ports for static blocksTakashi Iwai1-0/+16
When the UMP Endpoint is configured with static blocks, the block configuration will never change, hence the unused ports will be unchanged as well. Creating sequencer ports for those unused ports is simply useless, and it might be rather confusing for users. The idea behind the inactive ports was for allowing connections from/to ports that can become usable later, but this will never happen for inactive groups in static blocks. Let's change the sequencer UMP binding to skip those unused ports when the UMP EP is with static blocks. Fixes: 81fd444aa371 ("ALSA: seq: Bind UMP device") Cc: <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
2024-07-17ALSA: pcm_dmaengine: Don't synchronize DMA channel when DMA is pausedShengjiu Wang1-1/+5
When suspended, the DMA channel may enter PAUSE state if dmaengine_pause() is supported by DMA. At this state, dmaengine_synchronize() should not be called, otherwise the DMA channel can't be resumed successfully. Fixes: e8343410ddf0 ("ALSA: dmaengine: Synchronize dma channel after drop()") Signed-off-by: Shengjiu Wang <[email protected]> Cc: <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
2024-07-15Merge tag 'asoc-v6.11' of ↵Takashi Iwai661-5937/+23899
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Updates for for v6.11 There are a lot of changes in here, though the big bulk of things is cleanups and simplifications of various kinds which are internally rather than externally visible. A good chunk of those are DT schema conversions, but there's also a lot of changes in the code. Highlights: - Syncing of features between simple-audio-card and the two audio-graph cards so there is no reason to stick with an older driver. - Support for specifying the order of operations for components within cards to allow quirking for unusual systems. - New support for Asahi Kasei AK4619, Cirrus Logic CS530x, Everest Semiconductors ES8311, NXP i.MX95 and LPC32xx, Qualcomm LPASS v2.5 and WCD937x, Realtek RT1318 and RT1320 and Texas Instruments PCM5242.
2024-07-15ALSA: usb: Use BIT() for bit valuesTakashi Iwai3-39/+36
Instead of the explicit "1 << x", use BIT() macro for one bit values. This will improve the readability and also avoids the possible bad value for 31bit shift. Link: https://patch.msgid.link/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
2024-07-15ALSA: usb: Fix UBSAN warning in parse_audio_unit()Takashi Iwai1-0/+7
A malformed USB descriptor may pass the lengthy mixer description with a lot of channels, and this may overflow the 32bit integer shift size, as caught by syzbot UBSAN test. Although this won't cause any real trouble, it's better to address. This patch introduces a sanity check of the number of channels to bail out the parsing when too many channels are found. Reported-by: [email protected] Closes: https://lore.kernel.org/[email protected] Link: https://patch.msgid.link/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
2024-07-15Merge branch 'for-next' into for-linusTakashi Iwai40-264/+779
Pull 6.11 devel branch Signed-off-by: Takashi Iwai <[email protected]>
2024-07-14ALSA: hda/realtek: Enable headset mic on Positivo SU C1400Edson Juliano Drosdeck1-0/+1
Positivo SU C1400 is equipped with ALC256, and it needs ALC269_FIXUP_ASPIRE_HEADSET_MIC quirk to make its headset mic work. Signed-off-by: Edson Juliano Drosdeck <[email protected]> Cc: <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
2024-07-12Fix the unbalanced pm_runtime_enable in wcd937x-sdwMark Brown3-85/+30
Merge series from Mohammad Rafi Shaik <[email protected]>: This patch set change will fix the unbalanced pm_runtime_enable in wcd937x-sdw soundwire slave. And removed the string compare with widget name in MIC BIAS settings, instead of string compare use the MIC BIAS id's as value. Removed separate handling for vdd-buck regulator supply which is not required. The vdd-buck regulator supply enabled using bulk enable. Added the error handling in wcd937x_probe() and disable the regulators in error case.
2024-07-12ASoC: tas2781: Add new Kontrol to set tas2563 digital VolumeShenghao Ding3-10/+382
Requriment from customer to add new kcontrol to set tas2563 digital Volume Signed-off-by: Shenghao Ding <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-07-12ASoC: codecs: wcd937x: Remove separate handling for vdd-buck supplyMohammad Rafi Shaik2-49/+14
Remove separate handling for vdd-buck regulator supply which is not required. The vdd-buck regulator supply enabled using bulk enable. Add the error handling in wcd937x_probe() and disable the regulators in error case. Reported-by: Christophe JAILLET <[email protected]> Closes: https://lore.kernel.org/linux-sound/[email protected]/ Signed-off-by: Mohammad Rafi Shaik <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-07-12ASoC: codecs: wcd937x: Remove the string compare in MIC BIAS widget settingsMohammad Rafi Shaik1-26/+8
Remove the string compare with widget name in MIC BIAS settings, instead of string compare use the MIC BIAS id's. Reported-by: Srinivas Kandagatla <[email protected]> Closes: https://lore.kernel.org/linux-sound/[email protected]/ Signed-off-by: Mohammad Rafi Shaik <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-07-12ASoC: codecs: wcd937x-sdw: Fix Unbalanced pm_runtime_enableMohammad Rafi Shaik1-10/+8
Fix the unbalanced pm_runtime_enable! in wcd937x-sdw soundwire slave. Fixes: c99a515ff153 ("ASoC: codecs: wcd937x-sdw: add SoundWire driver") Signed-off-by: Mohammad Rafi Shaik <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-07-12ASoC: dt-bindings: cirrus,cs42xx8: Convert to dtschemaAnimesh Agarwal2-34/+81
Convert the Cirrus Logic CS42448/CS42888 audio CODEC bindings to DT schema format. Set power supply properties to required only for CS42888. Cc: Daniel Baluta <[email protected]> Signed-off-by: Animesh Agarwal <[email protected]> Reviewed-by: Rob Herring (Arm) <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-07-11Merge tag 'asoc-fix-v6.10-rc7' of ↵Takashi Iwai4-71/+176
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Fixes for v6.10 A few fairly small fixes for ASoC, there's a relatively large set of hardening changes for the cs_dsp firmware file parsing and a couple of other small device specific fixes.
2024-07-11ASoC: dt-bindings: convert qcom sound bindings toMark Brown4-148/+56
Merge series from Rayyan Ansari <[email protected]>: These patches convert the remaining plain text bindings for Qualcomm sound drivers to dt schema, so device trees can be validated against them.
2024-07-11firmware: cs_dsp: Some small coding improvementsMark Brown10-128/+237
Merge series from Richard Fitzgerald <[email protected]>: Commit series that makes some small improvements to code and the kernel log messages.
2024-07-10ASoC: cs530x: Remove bclk from private structurePaul Handrigan2-13/+12
Remove the bclk int from the private structure and pass it into the set_bclk function. Signed-off-by: Paul Handrigan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-07-10ASoC: cs530x: Calculate proper bclk rate using TDMPaul Handrigan2-5/+11
Calculate the proper bclk rate using the number of tdm slots and the width of the tdm data. Fixes: 2884c29152c0 ("ASoC: cs530x: Support for cs530x ADCs") Signed-off-by: Paul Handrigan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-07-10ASoC: dt-bindings: cirrus,cs4270: Convert to dtschemaAnimesh Agarwal2-21/+59
Convert the Cirrus Logic CS4270 audio CODEC bindings to DT schema. Add missing va-supply, vd-supply and vlc-supply properties, because they are already being used in the DTS and the driver for this device. Cc: Daniel Baluta <[email protected]> Signed-off-by: Animesh Agarwal <[email protected]> Reviewed-by: Krzysztof Kozlowski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-07-10firmware: cs_dsp: Rename fw_ver to wmfw_verRichard Fitzgerald3-12/+12
Rename the confusingly named struct member fw_ver to wmfw_ver. It contains the wmfw format version of the loaded wmfw file. This commit also contains an update to wm_adsp for the new name. Signed-off-by: Richard Fitzgerald <[email protected]> Reviewed-by: Charles Keepax <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-07-10firmware: cs_dsp: Clarify wmfw format version log messageRichard Fitzgerald1-3/+2
Change the log message of the wmfw format version to include the file name, and change the message to say "format" instead of "Firmware version". Merge this with the message that logs the timestamp. The wmfw format version is information that is useful to have logged because the behaviour of firmware controls depends on the wmfw format. So "unexpected" behaviour could be caused by having expectations based on one format of wmfw when a different format has been loaded. But the original message was confusing. It reported the file format version but didn't actually log the name of the file it referred to. It also called it "Firmware version", which is confusing when a later message also logs a firmware version that is the version of the actual firmware within the wmfw. The logging of the firmware timestamp has been merged into this. That was originally a dbg-only message, but as we are already logging a line of info, we might as well add a few extra characters to log the timestamp. The timestamp is now logged in hexadecimal - it's not particularly useful as a decimal value. Signed-off-by: Richard Fitzgerald <[email protected]> Reviewed-by: Charles Keepax <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-07-10firmware: cs_dsp: Make wmfw and bin filename arguments const char *Richard Fitzgerald2-8/+8
The wmfw_filename and bin_filename strings passed into cs_dsp_power_up() and cs_dsp_adsp1_power_up() should be const char *. Signed-off-by: Richard Fitzgerald <[email protected]> Reviewed-by: Charles Keepax <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-07-10firmware: cs_dsp: Don't allocate temporary buffer for info textRichard Fitzgerald1-28/+7
Don't allocate a temporary buffer to hold a NUL-terminated copy of the NAME/INFO string from the wmfw/bin. It can be printed directly to the log. Also limit the maximum number of characters that will be logged from this string. The NAME/INFO blocks in the firmware files are an array of characters with a length, not a NUL-terminated C string. The original code allocated a temporary buffer to make a NUL-terminated copy of the string and then passed that to dev_info(). There's no need for this: printf formatting can use "%.*s" to print a character array of a given length. Signed-off-by: Richard Fitzgerald <[email protected]> Reviewed-by: Charles Keepax <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-07-10ASoC: dt-bindings: qcom,apq8096-sndcard: use dtschemaRayyan Ansari2-128/+1
Remove old txt bindings and add apq8096 soundcard entry to existing dt schema. Signed-off-by: Rayyan Ansari <[email protected]> Reviewed-by: Krzysztof Kozlowski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-07-10ASoC: dt-bindings: qcom,msm8916-wcd-digital-codec: convert to dtschemaRayyan Ansari2-20/+55
Convert the Qualcomm MSM8916 WCD Digital Audio Codec bindings from text to yaml dt schema format. Make bindings complete by adding #sound-dai-cells. Signed-off-by: Rayyan Ansari <[email protected]> Reviewed-by: Krzysztof Kozlowski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-07-09ASoC: qcom: topology: Simplify with cleanup.hKrzysztof Kozlowski1-5/+5
Allocate memory, which is being freed at end of the scope, with scoped/cleanup.h to reduce number of error paths and make code a bit simpler. Signed-off-by: Krzysztof Kozlowski <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-07-09ASoC: codecs: aw88395: Simplify with cleanup.hKrzysztof Kozlowski1-34/+17
Allocate memory, which is being freed at end of the scope, with scoped/cleanup.h to reduce number of error paths and make code a bit simpler. Signed-off-by: Krzysztof Kozlowski <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-07-09ASoC: Intel: sof_sdw: Convert comma to semicolonChen Ni1-3/+3
Replace a comma between expression statements by a semicolon. Signed-off-by: Chen Ni <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-07-09ASoc: TAS2781: rename the tas2781_reset as tasdevice_resetShenghao Ding4-10/+12
Rename the tas2781_reset as tasdevice_reset in case of misunderstanding. RESET register for both tas2563 and tas2781 is same and the use of reset pin is also same. Signed-off-by: Shenghao Ding <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-07-09ALSA: hda/realtek: Enable Mute LED on HP 250 G7Nazar Bilinskyi1-0/+1
HP 250 G7 has a mute LED that can be made to work using quirk ALC269_FIXUP_HP_LINE1_MIC1_LED. Enable already existing quirk. Signed-off-by: Nazar Bilinskyi <[email protected]> Cc: <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
2024-07-09ALSA: ppc: keywest: Drop explicit initialization of struct ↵Uwe Kleine-König1-2/+2
i2c_device_id::driver_data to 0 The driver doesn't use the driver_data member of struct i2c_device_id, so don't explicitly initialize this member. This prepares putting driver_data in an anonymous union which requires either no initialization or named designators. But it's also a nice cleanup on its own. Signed-off-by: Uwe Kleine-König <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
2024-07-08ASoC: fsl-asoc-card: add S/PDIF controller supportMark Brown8-313/+306
Merge series from Elinor Montmasson <[email protected]>: This is a series of patches aiming to make the machine driver `fsl-asoc-card` compatible with S/PDIF controllers on imx boards. The main goal is to allow the use of S/PDIF controllers with ASRC modules. The `imx-spdif` machine driver already has specific support for S/PDIF controllers but doesn't support using an ASRC with it. However, the `fsl-asoc-card` machine driver has the necessary code to create a sound card which can use an ASRC module. It is then possible to extend the support for S/PDIF audio cards by merging the `imx-spdif` driver into `fsl-asoc-card`. The first three patches adapt the `fsl-asoc-card` driver to support multiple codec use cases. The driver can get 2 codec phandles from the device tree, and codec-related variables are doubled. `for_each_codecs` macros are also used when possible to ease adding other multi-codec use cases in the future. It makes possible to use the two S/PDIF dummy codec drivers `spdif_receiver` and `spdif_transmitter` instead of `snd-soc-dummy`, which was used in `imx-spdif`. The fourth patch merges the S/PDIF support from `imx-spdif` to `fsl-asoc-card`. `fsl-asoc-card` offers the same functionalities as `imx-spdif` did, but this merge also extends the S/PDIF support with the possibility of using an ASRC. Compatible "fsl,imx-audio-spdif" is kept, but `fsl-asoc-card` uses different DT properties compared to `imx-spdif`: * The "spdif-controller" property from `imx-spdif` is named "audio-cpu" in `fsl-asoc-card`. * `fsl-asoc-card` uses codecs explicitly declared in DT with "audio-codec". With an S/PDIF, codec drivers `spdif_transmitter` and `spdif_receiver` should be used. Driver `imx-spdif` used instead the dummy codec and a pair of boolean properties, "spdif-in" and "spdif-out". Backward compatibility is therefore implemented in `fsl-asoc-card`. However, it is recommended to use the new properties when needed. Especially, declaring and using S/PDIF transmitter and/or receiver nodes is better than using the dummy codec. The last three patches update the device tree bindings of `fsl-asoc-card` and update all in-tree device trees to use the `fsl-asoc-card` properties. Note that as the old properties are still supported: * previous versions of in-tree device trees are still supported. * out-of-tree device trees are still supported. This series of patches was successfully built for arm64 and x86 on top of the latest "for-next" branch of the ASoC git tree on the 26th of June 2024. These modifications have also been tested on an i.MX8MN evaluation board with a linux kernel RT v6.1.26-rt8.
2024-07-08ASoC: Simplify code with cleanup.hMark Brown9-141/+87
Merge series from Krzysztof Kozlowski <[email protected]>: Allocate the memory with scoped/cleanup.h to reduce error handling (simpler error paths) and make the code a bit smaller.
2024-07-08ASoC: dt-bindings: update fsl-asoc-card bindings after imx-spdif mergeElinor Montmasson2-70/+49
The S/PDIF audio card support with compatible "fsl,imx-audio-spdif" was merged from imx-spdif into the fsl-asoc-card driver. It makes possible to use an S/PDIF with an ASRC. This merge introduces new DT bindings to use with compatible "fsl,imx-audio-spdif" to follow the way fsl-asoc-card works: * the "spdif-controller" property from imx-spdif is named "audio-cpu" in fsl-asoc-card. * fsl-asoc-card uses codecs explicitly declared in DT with "audio-codec". With an SPDIF, codec drivers spdif_transmitter and spdif_receiver should be used. Driver imx-spdif used instead the dummy codec and a pair of boolean properties, "spdif-in" and "spdif-out". In an upcoming commit, in-tree DTs will be modified to follow these new properties: * Property "spdif-controller" will be renamed "audio-cpu". * spdif_transmitter and spdif_receiver nodes will be declared and linked to the fsl-asoc-card node with the property "audio-codec". To keep backward compatibility with other DTs, support for "spdif-controller", "spdif-in" and "spdif-out" properties is kept. However, it is recommended to use the new properties if possible. It is better to declare transmitter and/or receiver in DT than using the dummy codec. DTs using compatible "fsl,imx-audio-spdif" are still supported, and fsl-asoc-card will behave the same as imx-spdif for these DTs. Signed-off-by: Elinor Montmasson <[email protected]> Reviewed-by: Rob Herring (Arm) <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-07-08ASoC: fsl-asoc-card: merge spdif support from imx-spdif.cElinor Montmasson6-118/+84
The imx-spdif machine driver creates audio card to directly use an S/PDIF device. However, it doesn't support interacting with an ASRC. fsl-asoc-card already has the support to create audio card which can use the ASRC. Merge the S/PDIF support from imx-spdif into driver fsl-asoc-card to extend the support of S/PDIF audio card with the use of ASRC devices. fsl-asoc-card uses slightly different DT properties than imx-spdif: * the "spdif-controller" property from imx-spdif is named "audio-cpu" in fsl-asoc-card. * fsl-asoc-card uses codecs explicitly declared in DT with "audio-codec". With an SPDIF, codec drivers spdif_transmitter and spdif_receiver should be used. Driver imx-spdif used instead the dummy codec and a pair of boolean properties, "spdif-in" and "spdif-out". To keep backward compatibility, support for "spdif-controller", "spdif-in" and "spdif-out" is also added to fsl-asoc-card. However, it is recommended to use the new properties if possible. It is better to declare transmitter and/or receiver in DT than using the dummy codec. DTs using compatible "fsl,imx-audio-spdif" are still compatible, and fsl-asoc-card will behave the same as imx-spdif for these DTs. Signed-off-by: Elinor Montmasson <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-07-08ASoC: fsl-asoc-card: add compatibility to use 2 codecs in dai-linksElinor Montmasson1-118/+161
Adapt the driver to work with configurations using two codecs or more. Modify fsl_asoc_card_probe() to handle use cases where 2 codecs are given in the device tree. This will be needed to add support for the SPDIF. Use cases using one codec will ignore any given codecs other than the first. Co-developed-by: Philip-Dylan Gleonec <[email protected]> Signed-off-by: Philip-Dylan Gleonec <[email protected]> Signed-off-by: Elinor Montmasson <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-07-08ASoC: fsl-asoc-card: add second dai link component for codecsElinor Montmasson1-2/+4
Add a second dai link component for codecs that will be used for use cases with 2 codecs. It is needed for future integration of the SPDIF support, which will use spdif_receiver and spdif_transmitter drivers. To prevent deferring in use cases using only one codec, also set by default the number of codecs to 1 for the relevant dai links. Co-developed-by: Philip-Dylan Gleonec <[email protected]> Signed-off-by: Philip-Dylan Gleonec <[email protected]> Signed-off-by: Elinor Montmasson <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-07-08ASoC: fsl-asoc-card: add support for dai links with multiple codecsElinor Montmasson1-8/+11
Add support for dai links using multiple codecs for multi-codec use cases. Co-developed-by: Philip-Dylan Gleonec <[email protected]> Signed-off-by: Philip-Dylan Gleonec <[email protected]> Signed-off-by: Elinor Montmasson <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-07-08firmware: cs_dsp: Use strnlen() on name fields in V1 wmfw filesRichard Fitzgerald1-2/+2
Use strnlen() instead of strlen() on the algorithm and coefficient name string arrays in V1 wmfw files. In V1 wmfw files the name is a NUL-terminated string in a fixed-size array. cs_dsp should protect against overrunning the array if the NUL terminator is missing. Signed-off-by: Richard Fitzgerald <[email protected]> Fixes: f6bc909e7673 ("firmware: cs_dsp: add driver to support firmware loading on Cirrus Logic DSPs") Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-07-08ASoc: TAS2781: replace beXX_to_cpup with get_unaligned_beXX for potentially ↵Shenghao Ding1-36/+35
broken alignment Use get_unaligned_be16 instead of be16_to_cpup and get_unaligned_be32 instead of be32_to_cpup for potentially broken alignment. Signed-off-by: Shenghao Ding <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-07-08ASoC: dapm: Simplify snd_soc_dai_link_event_pre_pmu() with cleanup.hKrzysztof Kozlowski1-20/+12
Allocate the memory with scoped/cleanup.h in snd_soc_dai_link_event_pre_pmu() to reduce error handling (less error paths) and make the code a bit simpler. Signed-off-by: Krzysztof Kozlowski <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-07-08ASoC: dapm: Simplify dapm_cnew_widget() with cleanup.hKrzysztof Kozlowski1-8/+7
Allocate the memory with scoped/cleanup.h in dapm_cnew_widget() to reduce error handling (less error paths) and make the code a bit simpler. Signed-off-by: Krzysztof Kozlowski <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-07-08ASoC: ops: Simplify with cleanup.hKrzysztof Kozlowski1-16/+10
Allocate the memory with scoped/cleanup.h to reduce error handling (less error paths) and make the code a bit simpler. Signed-off-by: Krzysztof Kozlowski <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-07-08ASoC: simple-card: Use cleanup.h instead of devm_kfree()Krzysztof Kozlowski1-3/+2
Allocate the memory with scoped/cleanup.h, instead of devm interface, to make the code more obvious that memory is not used outside this scope. Signed-off-by: Krzysztof Kozlowski <[email protected]> Acked-by: Kuninori Morimoto <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>