summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2025-12-14spi: imx: support dynamic burst length for ECSPI DMA modeCarlos Song
ECSPI transfers only one word per frame in DMA mode, causing SCLK stalls between words due to BURST_LENGTH updates, which significantly impacts performance. To improve throughput, configure BURST_LENGTH as large as possible (up to 512 bytes per frame) instead of word length. This avoids delays between words. When transfer length is not 4-byte aligned, use bounce buffers to align data for DMA. TX uses aligned words for TXFIFO, while RX trims DMA buffer data after transfer completion. Introduce a new dma_package structure to store: 1. BURST_LENGTH values for each DMA request 2. Variables for DMA submission 3. DMA transmission length and actual data length Handle three cases: - len <= 512 bytes: one package, BURST_LENGTH = len * 8 - 1 - len > 512 and aligned: one package, BURST_LENGTH = max (512 bytes) - len > 512 and unaligned: two packages, second for tail data Performance test (spidev_test @10MHz, 4KB): Before: tx/rx ~6651.9 kbps After: tx/rx ~9922.2 kbps (~50% improvement) For compatibility with slow SPI devices, add configurable word delay in DMA mode. When word delay is set, dynamic burst is disabled and BURST_LENGTH equals word length. Signed-off-by: Carlos Song <carlos.song@nxp.com> Reviewed-by: Frank Li <Frank.Li@nxp.com> Link: https://patch.msgid.link/20251203085949.2922166-6-carlos.song@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-12-14spi: imx: handle DMA submission errors with dma_submit_error()Carlos Song
Add error handling for DMA request submission by checking the return cookie with dma_submit_error(). This prevents propagating submission failures through the DMA transfer process, which could lead to unexpected behavior. Signed-off-by: Carlos Song <carlos.song@nxp.com> Reviewed-by: Frank Li <Frank.Li@nxp.com> Link: https://patch.msgid.link/20251203085949.2922166-5-carlos.song@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-12-14spi: imx: avoid dmaengine_terminate_all() on TX prep failureCarlos Song
If dmaengine_prep_slave_sg() fails, no descriptor is submitted to the TX channel and DMA is never started. Therefore, calling dmaengine_terminate_all() for the TX DMA channel is unnecessary. Signed-off-by: Carlos Song <carlos.song@nxp.com> Reviewed-by: Frank Li <Frank.Li@nxp.com> Link: https://patch.msgid.link/20251203085949.2922166-4-carlos.song@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-12-14spi: imx: introduce helper to clear DMA mode logicCarlos Song
Add a helper function to handle clearing DMA mode, including getting the maximum watermark length and submitting the DMA request. This refactoring makes the code more concise and improves readability. No functional changes. Signed-off-by: Carlos Song <carlos.song@nxp.com> Reviewed-by: Frank Li <Frank.Li@nxp.com> Link: https://patch.msgid.link/20251203085949.2922166-3-carlos.song@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-12-14spi: imx: group spi_imx_dma_configure() with spi_imx_dma_transfer()Carlos Song
Relocate spi_imx_dma_configure() next to spi_imx_dma_transfer() so that all DMA-related functions are grouped together for better readability. No functional changes. Signed-off-by: Carlos Song <carlos.song@nxp.com> Reviewed-by: Frank Li <Frank.Li@nxp.com> Link: https://patch.msgid.link/20251203085949.2922166-2-carlos.song@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-12-14spi: rzv2h-rspi: add support for DMA modeCosmin Tanislav
The DMA controller can be used to transfer data to and from the SPI controller without involving the CPU for each word of a SPI transfer. Add support for DMA mode. Signed-off-by: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com> Link: https://patch.msgid.link/20251201134229.600817-12-cosmin-gabriel.tanislav.xa@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-12-14spi: dt-bindings: renesas,rzv2h-rspi: document optional support for DMACosmin Tanislav
The IP supports using DMA for reading and writing data from the FIFO, document it. Signed-off-by: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com> Acked-by: Rob Herring (Arm) <robh@kernel.org> Link: https://patch.msgid.link/20251201134229.600817-11-cosmin-gabriel.tanislav.xa@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-12-14spi: rzv2h-rspi: split out PIO transferCosmin Tanislav
In preparation for implementing DMA support, split out the PIO transfer code into its own function. Signed-off-by: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com> Link: https://patch.msgid.link/20251201134229.600817-10-cosmin-gabriel.tanislav.xa@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-12-14spi: rzv2h-rspi: enable TX buffer empty interruptCosmin Tanislav
In preparation for implementing DMA support, enable the transmit buffer empty interrupt, which is necessary for DMA to write more data to the FIFO. This does not affect the PIO mode as we do not even request the TX interrupt line. Signed-off-by: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com> Link: https://patch.msgid.link/20251201134229.600817-9-cosmin-gabriel.tanislav.xa@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-12-14spi: rzv2h-rspi: set TX FIFO threshold to 0Cosmin Tanislav
In PIO mode we send data word-by-word, and wait for the received data to be available after each sent word, making no use of the TX interrupt. In DMA mode, we need to set the RX and TX FIFO thresholds to 0, as described in the User Manual. In preparation for implementing DMA support, set TX FIFO threshold to 0, as RX FIFO threshold is already 0. Signed-off-by: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com> Link: https://patch.msgid.link/20251201134229.600817-8-cosmin-gabriel.tanislav.xa@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-12-14spi: rzv2h-rspi: set MUST_RX/MUST_TXCosmin Tanislav
In preparation for implementing DMA support, set MUST_RX and MUST_TX flags on the controller so that we always receive non-NULL buffers. The PIO mode already handles this manually by checking if rx_buf/tx_buf are set on the transfer, and doing a dummy read/write if not. DMA will not be able to implement this special handling, and although the SPI controller advertises support for transmit-only or receive-only transfers via SPCR's register TXMD bitfield, it does not seem to work. Remove the special handling for PIO and let the SPI controller core handle it. Signed-off-by: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com> Link: https://patch.msgid.link/20251201134229.600817-7-cosmin-gabriel.tanislav.xa@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-12-14spi: rzv2h-rspi: store RX interrupt in stateCosmin Tanislav
In preparation for implementing DMA support, store the RX interrupt number in the private state, to allow disabling it during DMA. Signed-off-by: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com> Link: https://patch.msgid.link/20251201134229.600817-6-cosmin-gabriel.tanislav.xa@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-12-14spi: rzv2h-rspi: use device-managed APIsCosmin Tanislav
Non-device-managed APIs were initially used here to avoid the buggy interaction between PM domains and device-managed actions. Commit f99508074e78 ("PM: domains: Detach on device_unbind_cleanup()") fixed the interaction between PM domains and device-managed actions. Simplify the code by using device-managed actions to unregister the SPI controller and to assert and release the resets. Signed-off-by: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com> Link: https://patch.msgid.link/20251201134229.600817-5-cosmin-gabriel.tanislav.xa@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-12-14spi: rzv2h-rspi: do not set SPI_TRANS_FAIL_IOCosmin Tanislav
Setting SPI_TRANS_FAIL_IO has no effect if the transfer completes in the current context, as it is only handled when .transfer_one() returns > 0, when the SPI core must wait for the SPI transfer to complete. Do not set SPI_TRANS_FAIL_IO as we either return an error or 0, since we do our own waiting. Signed-off-by: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com> Link: https://patch.msgid.link/20251201134229.600817-4-cosmin-gabriel.tanislav.xa@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-12-14spi: rzv2h-rspi: remove call to spi_finalize_current_transfer()Cosmin Tanislav
A call to spi_finalize_current_transfer() is only needed when the SPI transfer is completed outside of the current context, when the .transfer_one() implementation returns > 0. Since the SPI transfer is completed in the current context, and we return 0 from .transfer_one(), the SPI core assumes that the transfer has completed and it does not wait for the completion variable that would be set by a call to spi_finalize_current_transfer(). Remove the call to spi_finalize_current_transfer(). Signed-off-by: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com> Link: https://patch.msgid.link/20251201134229.600817-3-cosmin-gabriel.tanislav.xa@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-12-14spi: rzv2h-rspi: fix rzv2h_rspi_transfer_one() indentationCosmin Tanislav
Add the missing space to align to open pararenthesis. Signed-off-by: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com> Link: https://patch.msgid.link/20251201134229.600817-2-cosmin-gabriel.tanislav.xa@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-12-14rust: regulator: add __rust_helper to helpersAlice Ryhl
This is needed to inline these helpers into Rust code. Signed-off-by: Alice Ryhl <aliceryhl@google.com> Link: https://patch.msgid.link/20251202-define-rust-helper-v1-35-a2e13cbc17a6@google.com Reviewed-by: Gary Guo <gary@garyguo.net> Reviewed-by: Boqun Feng <boqun.feng@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2025-12-14regulator: max77675: Add MAX77675 regulator driverJoan Na
Add support for the Maxim Integrated MAX77675 PMIC regulator. The MAX77675 is a compact, highly efficient SIMO (Single Inductor Multiple Output) power management IC that provides four programmable buck-boost switching regulators with only one inductor. It supports up to 700mA total output current and operates from a single-cell Li-ion battery. An integrated power-up sequencer and I2C interface allow flexible startup configuration and runtime control. Signed-off-by: Joan Na <joan.na@analog.com> Link: https://patch.msgid.link/20251207032907.4850-3-joan.na@analog.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-12-14regulator: dt-bindings: Add MAX77675 regulatorJoan Na
Add device tree binding YAML schema for the Maxim MAX77675 PMIC regulator. Signed-off-by: Joan Na <joan.na@analog.com> Reviewed-by: Rob Herring (Arm) <robh@kernel.org> Link: https://patch.msgid.link/20251207032907.4850-2-joan.na@analog.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-12-14ASoC: sdw-mockup: Drop dummy remove functionUwe Kleine-König
A remove callback is optional and having no such function has the same semantic as one returning zero (and other return values are effectively ignored). This allows to remove the remove function without replacement. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com> Link: https://patch.msgid.link/20251212073555.1065284-2-u.kleine-koenig@baylibre.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-12-14firmware: cs_dsp: Don't use __free() in cs_dsp_load() and cs_dsp_load_coeff()Richard Fitzgerald
Replace the __free(kfree) in cs_dsp_load() and cs_dsp_load_coeff() with a kfree(buf) at the end of the function. The use of __free() can create new cleanup bugs that are difficult to spot because the defective code is idiomatically correct regular C. In these two functions the __free() was mixed with gotos, and also used the suspect declaration __free(kfree) = NULL;. The __free() did not do anything to simplify the code. There aren't any early returns after the pointer is set, and the __free() can be replaced by a kfree() at the end of the function. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Fixes: 900baa6e7bb0 ("firmware: cs_dsp: Remove redundant download buffer allocator") Link: https://patch.msgid.link/20251201160729.231867-1-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-12-14ASoC: codecs: wm0010: Replace cpu_to_be64 + le64_to_cpu with swab64Thorsten Blum
Replace cpu_to_be64(le64_to_cpu()) with swab64() to simplify byte_swap_64(). No functional changes. Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> Link: https://patch.msgid.link/20251209151853.432518-1-thorsten.blum@linux.dev Signed-off-by: Mark Brown <broonie@kernel.org>
2025-12-14ASoc: qcom: q6afe: use guards consistentlyJohan Hovold
A recent change switched to using guards for the port list lock but only modified two out of three functions where the lock is held. Convert also the third function for consistency while switching to a scoped guard in q6afe_port_get_from_id() for clarity. Signed-off-by: Johan Hovold <johan@kernel.org> Link: https://patch.msgid.link/20251203105542.24765-3-johan@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
2025-12-14ASoC: davinci-mcasp: remove unneeded #ifdefBartosz Golaszewski
The enablement of the CONFIG_OF_GPIO switch has nothing to do with the "gpio-controller" property which may as well come from software nodes and GPIOLIB can still be enabled separately. This driver does not call any symbols from gpiolib-of.h so has no need to check this option at all. Just use the generic device property accessor. Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com> Link: https://patch.msgid.link/20251205090534.27845-1-bartosz.golaszewski@oss.qualcomm.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-12-14ASoC: mediatek: mt8195: optimize property formatting error handling by using ↵HariKrishna Sagala
scnprintf() Replace snprintf() with scnprintf() when constructing the property and remove negative return error handling as scnprintf() returns the actual number of bytes written to buffer. snprintf() as defined by the C99 standard,returns the number of characters that *would have been* written if enough space were available.Use scnprintf() that returns the actual number of characters written. Link: https://github.com/KSPP/linux/issues/105 Signed-off-by: HariKrishna Sagala <hariconscious@gmail.com> Link: https://patch.msgid.link/20251212044408.1286-2-hariconscious@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-12-14firmware: cs_dsp: Remove __free() from cs_dsp_debugfs_string_read()Richard Fitzgerald
Don't use __free(kfree) in cs_dsp_debugfs_string_read. Instead use normal kfree() to cleanup. The use of __free() can create new cleanup bugs that are difficult to spot because the defective code is idiomatically correct regular C. This function used the suspect declaration __free(kfree) = NULL;. The __free(kfree) didn't really do anything here. The function can be rearranged to avoid any need to return or goto within the code. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Fixes: 3045e29d248b ("firmware: cs_dsp: Append \n to debugfs string during read") Link: https://patch.msgid.link/20251202113425.413700-1-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-12-14ASoC: mediatek: mt8189-nau8825: don't use card->dapm directlyKuninori Morimoto
We should get dapm via snd_soc_card_to_dapm(card), and use it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://patch.msgid.link/87bjkgnnhg.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-12-14ASoC: codec: rt274: Use devm_request_threaded_irq to manage IRQ lifetime and ↵HariKrishna Sagala
fix smatch warning Replace manual "request_threaded_irq()" with the device managed "devm_request_threaded_irq" to manage the IRQ lifetime and also it removes the smatch reported warning. Remove the manual "free_irq()" in the "remove" function as free_irq is tied to device teardown. Signed-off-by: HariKrishna Sagala <hariconscious@gmail.com> Link: https://patch.msgid.link/20251121140940.40678-4-hariconscious@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-12-14ASoC: fsl: fsl_ssi: Replace deprecated strcpy() with strscpy()HariKrishna Sagala
strcpy() is deprecated,use strscpy() instead. No functional changes intended. Link: https://github.com/KSPP/linux/issues/88 Signed-off-by: HariKrishna Sagala <hariconscious@gmail.com> Link: https://patch.msgid.link/29c40b5a-3e4d-e89d-ca22-a1059cca3480@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-12-14ASoC: Intel: catpt: Drop superfluous space in PCM codeCezary Rojewski
Those spaces are redundant. Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://patch.msgid.link/20251212103858.110701-6-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-12-14ASoC: Intel: catpt: Specify image names in the device descriptorCezary Rojewski
State files to load explicitly in the device descriptor instead of hiding the details within a loading function. Apart from readability, this also reduces the catpt module size slightly. Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://patch.msgid.link/20251212103858.110701-5-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-12-14ASoC: Intel: catpt: Simplify catpt_stream_read_position()Cezary Rojewski
Add position to the argument list to simplify the wrapper. Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://patch.msgid.link/20251212103858.110701-4-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-12-14ASoC: Intel: catpt: Update CATPT_IPC_ERROR macroCezary Rojewski
Make it easier for functions that call IPC handlers to deal with their results by accounting for '0' (success) code. Rename the macro to reflect this behaviour change. Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://patch.msgid.link/20251212103858.110701-3-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-12-14ASoC: Intel: catpt: Move IPC error messages one level downCezary Rojewski
Code size can be reduced if catpt_dsp_do_send_msg() takes responsibility for dumping logs in case of an IPC message failure. Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://patch.msgid.link/20251212103858.110701-2-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-12-14ASoC: SDCA: functions: Fix confusing cleanup.h syntaxKrzysztof Kozlowski
Initializing automatic __free variables to NULL without need (e.g. branches with different allocations), followed by actual allocation is in contrary to explicit coding rules guiding cleanup.h: "Given that the "__free(...) = NULL" pattern for variables defined at the top of the function poses this potential interdependency problem the recommendation is to always define and assign variables in one statement and not group variable definitions at the top of the function when __free() is used." Code does not have a bug, but is less readable and uses discouraged coding practice, so fix that by moving declaration to the place of assignment. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://patch.msgid.link/20251203-asoc-wrong-cleanup-h-continued-v1-3-5142be4874fb@oss.qualcomm.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-12-14ASoC: amd: acp-sdw-sof: Fix confusing cleanup.h syntaxKrzysztof Kozlowski
Initializing automatic __free variables to NULL without need (e.g. branches with different allocations), followed by actual allocation is in contrary to explicit coding rules guiding cleanup.h: "Given that the "__free(...) = NULL" pattern for variables defined at the top of the function poses this potential interdependency problem the recommendation is to always define and assign variables in one statement and not group variable definitions at the top of the function when __free() is used." Code does not have a bug, but is less readable and uses discouraged coding practice, so fix that by moving declaration to the place of assignment. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> Link: https://patch.msgid.link/20251203-asoc-wrong-cleanup-h-continued-v1-2-5142be4874fb@oss.qualcomm.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-12-14ASoC: amd: acp-sdw-legacy: Fix confusing cleanup.h syntaxKrzysztof Kozlowski
Initializing automatic __free variables to NULL without need (e.g. branches with different allocations), followed by actual allocation is in contrary to explicit coding rules guiding cleanup.h: "Given that the "__free(...) = NULL" pattern for variables defined at the top of the function poses this potential interdependency problem the recommendation is to always define and assign variables in one statement and not group variable definitions at the top of the function when __free() is used." Code does not have a bug, but is less readable and uses discouraged coding practice, so fix that by moving declaration to the place of assignment. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> Link: https://patch.msgid.link/20251203-asoc-wrong-cleanup-h-continued-v1-1-5142be4874fb@oss.qualcomm.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-12-14ASoC: qcom: Minor readability improve with new linesKrzysztof Kozlowski
Variables with automatic cleanup are special because they do not follow standard rules of declaration at top of function (see cleanup.h), but on the other hand we always expect line break between top-function declarations and first instructions. Don't pretend automatic cleanup variables are part of top-level declaration to improve readability when variable is followed by nun-NULL check. No functional impact, only style. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com> Link: https://patch.msgid.link/20251129-asoc-wrong-cleanup-h-can-people-stop-sending-this-without-reading-docs-v1-6-c38b06884e39@oss.qualcomm.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-12-14ASoC: qcom: audioreach: Fix confusing cleanup.h syntaxKrzysztof Kozlowski
Commit 88a5f8e628ef ("ASoc: qcom: audioreach: Use automatic cleanup of kfree()") did not make the code simpler but more complicated. Already simple code of allocation and free, without any error paths, got now declaration with one constructor followed by another allocation, which is in contrary to explicit coding rules guiding cleanup.h: "Given that the "__free(...) = NULL" pattern for variables defined at the top of the function poses this potential interdependency problem the recommendation is to always define and assign variables in one statement and not group variable definitions at the top of the function when __free() is used." Code does not have a bug, but is less readable and uses discouraged coding practice, so fix that by moving declaration to the place of assignment. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com> Link: https://patch.msgid.link/20251129-asoc-wrong-cleanup-h-can-people-stop-sending-this-without-reading-docs-v1-5-c38b06884e39@oss.qualcomm.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-12-14ASoC: qcom: q6afe: Fix confusing cleanup.h syntaxKrzysztof Kozlowski
Commit 55094e55ae36 ("ASoc: qcom: q6afe: Use automatic cleanup of kfree()") did not make the code simpler but more complicated. Already simple code of allocation and free, without any error paths, got now declaration with one constructor followed by another allocation, which is in contrary to explicit coding rules guiding cleanup.h: "Given that the "__free(...) = NULL" pattern for variables defined at the top of the function poses this potential interdependency problem the recommendation is to always define and assign variables in one statement and not group variable definitions at the top of the function when __free() is used." Code does not have a bug, but is less readable and uses discouraged coding practice, so fix that by moving declaration to the place of assignment. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com> Link: https://patch.msgid.link/20251129-asoc-wrong-cleanup-h-can-people-stop-sending-this-without-reading-docs-v1-4-c38b06884e39@oss.qualcomm.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-12-14ASoC: qcom: q6apm: Fix confusing cleanup.h syntaxKrzysztof Kozlowski
Commit 89cf2223ee7b ("ASoc: qcom: q6apm: Use automatic cleanup of kfree()") did not make the code simpler but more complicated. Already simple code of allocation and free, without any error paths, got now declaration with one constructor followed by another allocation, which is in contrary to explicit coding rules guiding cleanup.h: "Given that the "__free(...) = NULL" pattern for variables defined at the top of the function poses this potential interdependency problem the recommendation is to always define and assign variables in one statement and not group variable definitions at the top of the function when __free() is used." Code does not have a bug, but is less readable and uses discouraged coding practice, so fix that by moving declaration to the place of assignment. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com> Link: https://patch.msgid.link/20251129-asoc-wrong-cleanup-h-can-people-stop-sending-this-without-reading-docs-v1-3-c38b06884e39@oss.qualcomm.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-12-14ASoC: qcom: q6asm: Fix confusing cleanup.h syntaxKrzysztof Kozlowski
Commit 6e00112d31c8 ("ASoc: qcom: q6asm: Use automatic cleanup of kfree()") did not make the code simpler but more complicated. Already simple code of allocation and free, without any error paths, got now declaration with one constructor followed by another allocation, which is in contrary to explicit coding rules guiding cleanup.h: "Given that the "__free(...) = NULL" pattern for variables defined at the top of the function poses this potential interdependency problem the recommendation is to always define and assign variables in one statement and not group variable definitions at the top of the function when __free() is used." Code does not have a bug, but is less readable and uses discouraged coding practice, so fix that by moving declaration to the place of assignment. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com> Link: https://patch.msgid.link/20251129-asoc-wrong-cleanup-h-can-people-stop-sending-this-without-reading-docs-v1-2-c38b06884e39@oss.qualcomm.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-12-14ASoC: qcom: q6prm: Fix confusing cleanup.h syntaxKrzysztof Kozlowski
Commit de8e95773c48 ("ASoc: qcom: q6prm: Use automatic cleanup of kfree()") did not make the code simpler but more complicated. Already simple code of allocation and free, without any error paths, got now declaration with one constructor followed by another allocation, which is in contrary to explicit coding rules guiding cleanup.h: "Given that the "__free(...) = NULL" pattern for variables defined at the top of the function poses this potential interdependency problem the recommendation is to always define and assign variables in one statement and not group variable definitions at the top of the function when __free() is used." Code does not have a bug, but is less readable and uses discouraged coding practice, so fix that by moving declaration to the place of assignment. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com> Link: https://patch.msgid.link/20251129-asoc-wrong-cleanup-h-can-people-stop-sending-this-without-reading-docs-v1-1-c38b06884e39@oss.qualcomm.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-12-14ASoC: renesas: rz-ssi: Add support for 32 bits sample widthBiju Das
Add support for 32 bits sample format width for RZ/G2L SoCs. Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Link: https://patch.msgid.link/20251114075856.4751-6-biju.das.jz@bp.renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-12-14ASoC: renesas: rz-ssi: Add support for 24 bits sample widthBiju Das
Add support for 24 bits sample format width for RZ/G2L SoCs. Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Link: https://patch.msgid.link/20251114075856.4751-5-biju.das.jz@bp.renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-12-14ASoC: renesas: rz-ssi: Move DMA configurationBiju Das
Move DMA configuration from rz_ssi_dma_request() to rz_ssi_dai_trigger() for supporting sample widths higher than 16. Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Link: https://patch.msgid.link/20251114075856.4751-4-biju.das.jz@bp.renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-12-14ASoC: renesas: rz-ssi: Remove trailing comma in the terminator entryBiju Das
Remove trailing comma in the terminator entry for OF table. While at it, add a space between the braces and comment block. Reviewed-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Link: https://patch.msgid.link/20251114075856.4751-3-biju.das.jz@bp.renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-12-14ASoC: renesas: rz-ssi: Use dev variable in probe()Biju Das
Replace '&pdev->dev' by 'dev' in probe(), this makes few error paths shorter. Reviewed-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Link: https://patch.msgid.link/20251114075856.4751-2-biju.das.jz@bp.renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-12-14spi: fsl-cpm: Check length parity before switching to 16 bit modeChristophe Leroy
Commit fc96ec826bce ("spi: fsl-cpm: Use 16 bit mode for large transfers with even size") failed to make sure that the size is really even before switching to 16 bit mode. Until recently the problem went unnoticed because kernfs uses a pre-allocated bounce buffer of size PAGE_SIZE for reading EEPROM. But commit 8ad6249c51d0 ("eeprom: at25: convert to spi-mem API") introduced an additional dynamically allocated bounce buffer whose size is exactly the size of the transfer, leading to a buffer overrun in the fsl-cpm driver when that size is odd. Add the missing length parity verification and remain in 8 bit mode when the length is not even. Fixes: fc96ec826bce ("spi: fsl-cpm: Use 16 bit mode for large transfers with even size") Cc: stable@vger.kernel.org Closes: https://lore.kernel.org/all/638496dd-ec60-4e53-bad7-eb657f67d580@csgroup.eu/ Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu> Reviewed-by: Sverdlin Alexander <alexander.sverdlin@siemens.com> Link: https://patch.msgid.link/3c4d81c3923c93f95ec56702a454744a4bad3cfc.1763627618.git.christophe.leroy@csgroup.eu Signed-off-by: Mark Brown <broonie@kernel.org>
2025-12-14spi: mpfs: Fix an error handling path in mpfs_spi_probe()Christophe JAILLET
mpfs_spi_init() calls mpfs_spi_enable_ints(), so mpfs_spi_disable_ints() should be called if an error occurs after calling mpfs_spi_init(), as already done in the remove function. Fixes: 9ac8d17694b6 ("spi: add support for microchip fpga spi controllers") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Link: https://patch.msgid.link/eb35f168517cc402ef7e78f26da02863e2f45c03.1765612110.git.christophe.jaillet@wanadoo.fr Signed-off-by: Mark Brown <broonie@kernel.org>