aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
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-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-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-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]>
2024-07-08ASoC: audio-graph-card2: Use cleanup.h instead of devm_kfree()Krzysztof Kozlowski1-4/+1
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]>
2024-07-08ASoC: audio-graph-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]>
2024-07-08ASoC: simple-card-utils: Simplify with cleanup.hKrzysztof Kozlowski1-7/+6
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]> Acked-by: Kuninori Morimoto <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-07-08ASoC: codecs: wcd934x: Simplify with cleanup.hKrzysztof Kozlowski1-13/+9
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: codecs: wcd9335: Simplify with cleanup.hKrzysztof Kozlowski1-13/+9
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: codecs: audio-iio-aux: Simplify audio_iio_aux_probe() with cleanup.hKrzysztof Kozlowski1-29/+18
Allocate the memory with scoped/cleanup.h in audio_iio_aux_probe() 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: codecs: audio-iio-aux: Simplify audio_iio_aux_add_dapms() with cleanup.hKrzysztof Kozlowski1-25/+11
Allocate the memory with scoped/cleanup.h in audio_iio_aux_add_dapms() 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-05ASoc: pcm6240: Remove unnecessary name-prefix for all the controlsShenghao Ding1-24/+6
Adding name-prefix for each audio controls is a redundant, because name-prefix will be automatically added behind the control name when creating a new control. Signed-off-by: Shenghao Ding <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-07-04Add support for non-interleaved mode in qmc_audioMark Brown4-185/+506
Merge series from Herve Codina <[email protected]>: The qmc_audio driver supports only audio in interleaved mode. Non-interleaved mode can be easily supported using several QMC channel per DAI. In that case, data related to ch0 are sent to (received from) the first QMC channel, data related to ch1 use the next QMC channel and so on up to the last channel. In terms of constraints and settings, the interleaved and non-interleaved modes are slightly different. In interleaved mode: - The sample size should fit in the number of time-slots available for the QMC channel. - The number of audio channels should fit in the number of time-slots (taking into account the sample size) available for the QMC channel. In non-interleaved mode: - The number of audio channels is the number of available QMC channels. - Each QMC channel should have the same number of time-slots. - The sample size equals the number of time-slots of one QMC channel. This series add support for the non-interleaved mode in the qmc_audio driver and is composed of the following parts: - Patches 1 and 2: Fix some issues in the qmc_audio - Patches 3 to 6: Prepare qmc_audio for the non-interleaved mode - Patches 7 and 8: Extend the QMC driver API - Patches 9 and 10: The support for non-interleaved mode itself Compared to the previous iteration, this v2 series mainly improves qmc_audio_access_is_interleaved().
2024-07-04ASoC: codecs: lpass-rx-macro: Few code cleanupsMark Brown5-47/+47
Merge series from Krzysztof Kozlowski <[email protected]>: Improve a bit the Qualcomm LPASS RX macro driver and align similar parts of code with LPASS WSA macro driver for consistency. No external dependencies.
2024-07-04ASoc: tas2781: Set "Speaker Force Firmware Load" as the common kcontrol for ↵Shenghao Ding1-7/+22
both tas27871 and tas2563 Set "Speaker Force Firmware Load" as the common kcontrol for both tas27871 and tas2563 and move it into newly-created tasdevice_snd_controls, and keep the digital gain and analog gain in tas2781_snd_controls. Signed-off-by: Shenghao Ding <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-07-04ASoC: amd: Adjust error handling in case of absent codec deviceAleksandr Mishin1-1/+3
acpi_get_first_physical_node() can return NULL in several cases (no such device, ACPI table error, reference count drop to 0, etc). Existing check just emit error message, but doesn't perform return. Then this NULL pointer is passed to devm_acpi_dev_add_driver_gpios() where it is dereferenced. Adjust this error handling by adding error code return. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 02527c3f2300 ("ASoC: amd: add Machine driver for Jadeite platform") Signed-off-by: Aleksandr Mishin <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-07-04ASoC: codecs: wcd939x: Fix typec mux and switch leak during device removalKrzysztof Kozlowski1-47/+66
Driver does not unregister typec structures (typec_mux_dev and typec_switch_desc) during removal leading to leaks. Fix this by moving typec registering parts to separate function and using devm interface to release them. This also makes code a bit simpler: - Smaller probe() function with less error paths and no #ifdefs, - No need to store typec_mux_dev and typec_switch_desc in driver state container structure. Cc: [email protected] Fixes: 10f514bd172a ("ASoC: codecs: Add WCD939x Codec driver") Signed-off-by: Krzysztof Kozlowski <[email protected]> Reviewed-by: Neil Armstrong <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-07-04ASoC: ak4458: remove "reset-gpios" property handlerShengjiu Wang1-10/+1
commit c721f189e89c0 ("reset: Instantiate reset GPIO controller for shared reset-gpios") check if there is no "resets" property will fallback to "reset-gpios". So don't need to handle "reset-gpios" separately in the driver, the "reset-gpios" handler is duplicated with "resets" control handler, remove it. Signed-off-by: Shengjiu Wang <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-07-04ASoC: SOF: ipc4-topology: Use single token list for the copiersPeter Ujfalusi1-18/+11
There is no need to keep separate token list for dai and 'common' copier token list when the 'common' list is actually the aif list, the SOF_COPIER_DEEP_BUFFER_TOKENS are not applicable for buffers. We could have separate lists for all types but it is probably simpler to just use a single list for all types of copiers. Function specific tokens will be only parsed by function specific code anyways. Reviewed-by: Bard Liao <[email protected]> Reviewed-by: Ranjani Sridharan <[email protected]> Signed-off-by: Peter Ujfalusi <[email protected]> Signed-off-by: Pierre-Louis Bossart <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-07-04ASoC: fsl: fsl_qmc_audio: Add support for non-interleaved mode.Herve Codina1-75/+297
The current fsl_qmc_audio works in interleaved mode. The audio samples are interleaved and all data are sent to (received from) one QMC channel. Using several QMC channels, non interleaved mode can be easily supported. In that case, data related to ch0 are sent to (received from) the first QMC channel, data related to ch1 use the next QMC channel and so on up to the last channel. In terms of constraints and settings, the two modes are slightly different: - Interleaved mode: - The sample size should fit in the number of time-slots available for the QMC channel. - The number of audio channels should fit in the number of time-slots (taking into account the sample size) available for the QMC channel. - Non-interleaved mode: - The number of audio channels is the number of available QMC channels. - Each QMC channel should have the same number of time-slots. - The sample size equals the number of time-slots of one QMC channel. Add support for the non-interleaved mode allowing multiple QMC channel per DAI. The DAI switches in non-interleaved mode when more that one QMC channel is available. Signed-off-by: Herve Codina <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-07-04dt-bindings: sound: fsl,qmc-audio: Add support for multiple QMC channels per DAIHerve Codina1-6/+35
The QMC audio uses one QMC channel per DAI and uses this QMC channel to transmit interleaved audio channel samples. In order to work in non-interleave mode, a QMC audio DAI needs to use multiple QMC channels. In that case, the DAI maps each QMC channel to exactly one audio channel. Allow QMC audio DAIs with multiple QMC channels attached. Signed-off-by: Herve Codina <[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-04soc: fsl: cpm1: qmc: Introduce qmc_chan_count_phandles()Herve Codina2-0/+15
No function in the QMC API is available to get the number of phandles present in a phandle list. Fill this lack introducing qmc_chan_count_phandles(). Signed-off-by: Herve Codina <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-07-04soc: fsl: cpm1: qmc: Introduce functions to get a channel from a phandle listHerve Codina2-11/+33
qmc_chan_get_byphandle() and the resource managed version retrieve a channel from a simple phandle. Extend the API and introduce qmc_chan_get_byphandles_index() and the resource managed version in order to retrieve a channel from a phandle list using the provided index to identify the phandle in the list. Also update qmc_chan_get_byphandle() and the resource managed version to use qmc_chan_get_byphandles_index() and so avoid code duplication. Signed-off-by: Herve Codina <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-07-04ASoC: fsl: fsl_qmc_audio: Introduce qmc_dai_constraints_interleaved()Herve Codina1-15/+22
Constraints are set by qmc_dai_startup(). These constraints are specific to the interleaved mode. With the future introduction of support for non-interleaved mode, a new set of constraints will be set. To make the code clear and keep qmc_dai_startup() simple, extract the current interleaved mode constraints settings to a specific function. Signed-off-by: Herve Codina <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-07-04ASoC: fsl: fsl_qmc_audio: Introduce qmc_audio_pcm_{read,write}_submit()Herve Codina1-48/+45
Submitting data to QMC channels is done in several places: transfer completions and DAI start. The operation done is simple and consist in one function call. With the future introduction of support for non-interleaved mode, submitting data will be more complex. To avoid copy/paste of code in several places, introduce qmc_audio_pcm_{read,write}_submit() whose goal is to handle this data submission. Signed-off-by: Herve Codina <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-07-04ASoC: fsl: fsl_qmc_audio: Identify the QMC channel involved in completion ↵Herve Codina1-25/+47
routines The current QMC audio driver uses only one QMC channel per DAI. The context used by QMC channel transfer (read and write) completion routines does not contains any QMC channel and the only one available per DAI is used to schedule the next transfer. This works pretty well with only one QMC channel per DAI. The future support for non-inlerleave mode will use several QMC channel per DAI. In that case, QMC channel transfer completion routines need to identify the QMC channel related to the completion. In order to fill this lack, even if identifying the current QMC channel among several QMC channels is not needed for the current code, add one indirection level and introduce the qmc_dai_chan data structrure. This structure contains the QMC channel involved in the completion and refererences to the runtime context (capture and playback) used by the DAI. Signed-off-by: Herve Codina <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-07-04ASoC: fsl: fsl_qmc_audio: Split channel buffer and PCM pointer handlingHerve Codina1-38/+46
The driver mixes some internal values for channel DMA buffer handling and PCM pointer handling. In the currently supported interleaved mode, this mix does not lead to any issues but in order to prepare the support for the non-interleaved mode, having them clearly separated will ease the support and avoid additional computation to convert values used in channel DMA buffer management in values usable for PCM pointer. Use a specific set of variable for PCM pointer handling and an other set for channel DMA buffer. Signed-off-by: Herve Codina <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-07-04ASoC: fsl: fsl_qmc_audio: Fix issues detected by checkpatchHerve Codina1-34/+31
./scripts/checkpatch.pl --strict --codespell detected several issues when running on the fsl_qmc_audio.c file: - CHECK: spaces preferred around that '*' (ctx:VxV) - CHECK: Alignment should match open parenthesis - CHECK: Comparison to NULL could be written "!prtd" - CHECK: spaces preferred around that '/' (ctx:VxV) - CHECK: Lines should not end with a '(' - CHECK: Please don't use multiple blank lines Some of them are present several times. Fix all of these issues without any functional changes. Signed-off-by: Herve Codina <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-07-04ASoC: fsl: fsl_qmc_audio: Check devm_kasprintf() returned valueHerve Codina1-0/+2
devm_kasprintf() can return a NULL pointer on failure but this returned value is not checked. Fix this lack and check the returned value. Fixes: 075c7125b11c ("ASoC: fsl: Add support for QMC audio") Cc: [email protected] Signed-off-by: Herve Codina <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-07-03ASoC: codecs: lpass-wsa-macro: Simplify with cleanup.hKrzysztof Kozlowski1-12/+10
Driver's probe() has two allocations which are needed only within the probe() itself - for devm_regmap_init_mmio(). Usage of devm interface is a bit misleading here, because these can be freed right after each scope finishes. This makes the code a bit more obvious and self documenting. Signed-off-by: Krzysztof Kozlowski <[email protected]> Link: https://patch.msgid.link/20240701-b4-qcom-audio-lpass-codec-cleanups-v3-6-6d98d4dd1ef5@linaro.org Signed-off-by: Mark Brown <[email protected]>
2024-07-03ASoC: codecs: lpass-rx-macro: Use unsigned for number of widgetsKrzysztof Kozlowski1-2/+2
Driver uses ARRAY_SIZE() to get number of widgets later passed to snd_soc_dapm_new_controls(), which is an 'unsigned int'. Reviewed-by: Dmitry Baryshkov <[email protected]> Signed-off-by: Krzysztof Kozlowski <[email protected]> Link: https://patch.msgid.link/20240701-b4-qcom-audio-lpass-codec-cleanups-v3-5-6d98d4dd1ef5@linaro.org Signed-off-by: Mark Brown <[email protected]>
2024-07-03ASoC: dapm: Use unsigned for number of widgets in snd_soc_dapm_new_controls()Krzysztof Kozlowski2-2/+2
Number of widgets in array passed to snd_soc_dapm_new_controls() cannot be negative, so make it explicit by using 'unsigned int', just like snd_soc_add_component_controls() is doing. Reviewed-by: Dmitry Baryshkov <[email protected]> Signed-off-by: Krzysztof Kozlowski <[email protected]> Link: https://patch.msgid.link/20240701-b4-qcom-audio-lpass-codec-cleanups-v3-4-6d98d4dd1ef5@linaro.org Signed-off-by: Mark Brown <[email protected]>
2024-07-03ASoC: codecs: lpass-rx-macro: Keep static regmap_config as constKrzysztof Kozlowski1-4/+10
The driver has static 'struct regmap_config', which is then customized depending on device version. This works fine, because there should not be two devices in a system simultaneously and even less likely that such two devices would have different versions, thus different regmap config. However code is cleaner and more obvious when static data in the driver is also const - it serves as a template. Mark the 'struct regmap_config' as const and duplicate it in the probe() with kmemdup to allow customizing per detected device variant. Signed-off-by: Krzysztof Kozlowski <[email protected]> Link: https://patch.msgid.link/20240701-b4-qcom-audio-lpass-codec-cleanups-v3-3-6d98d4dd1ef5@linaro.org Signed-off-by: Mark Brown <[email protected]>
2024-07-03ASoC: codecs: lpass-rx-macro: Simplify with cleanup.hKrzysztof Kozlowski1-9/+6
Allocate the default register values array 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/20240701-b4-qcom-audio-lpass-codec-cleanups-v3-2-6d98d4dd1ef5@linaro.org Signed-off-by: Mark Brown <[email protected]>
2024-07-03ASoC: codecs: lpass-rx-macro: Simplify PDS cleanup with devmKrzysztof Kozlowski2-18/+17
Eliminate PDS cleanup by using devm_add_action_or_reset() which results in one less error path and smaller cleanup in remove(). Signed-off-by: Krzysztof Kozlowski <[email protected]> Link: https://patch.msgid.link/20240701-b4-qcom-audio-lpass-codec-cleanups-v3-1-6d98d4dd1ef5@linaro.org Signed-off-by: Mark Brown <[email protected]>