summaryrefslogtreecommitdiff
path: root/sound/soc/codecs
AgeCommit message (Collapse)Author
2024-08-08ASoC: codecs: warn on unknown codec versionMark Brown
Merge series from Dmitry Baryshkov <dmitry.baryshkov@linaro.org>: While debugging broken audio issues on some of Qualcomm platforms I stumbled upon the kernel not providing the actual error information. It prints an error from the wsa_macro driver, but the actual issue is in the VA macro driver. Add error message to point to the actual error location. va_macro 3370000.codec: Unknown VA Codec version, ID: 00 / 0f / 00 wsa_macro 3240000.codec: Unsupported Codec version (0)
2024-08-08ASoC: tas*: Fix up GPIO usageMark Brown
Merge series from Linus Walleij <linus.walleij@linaro.org>: The TI TAS drivers use some legacy GPIO code and headers, this series fixes it up. The TAS2781 is a special case since it adds a handful of lines of deviating code to reconfigure a GPIO line for IRQ mode and then never actually use the IRQ obtained in the code. Is the line used by autonomous hardware? I'm puzzled by this. Anyways the patch suggest how to solve this properly by fixing the parent irqchip and I'm happy to help.
2024-08-08ASoC: cs35l56: Patch CS35L56_IRQ1_MASK_18 to the default valueSimon Trimmer
Device tuning files made with early revision tooling may contain configuration that can unmask IRQ signals that are owned by the host. Adding a safe default to the regmap patch ensures that the hardware matches the driver expectations. Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com> Link: https://patch.msgid.link/20240807142648.46932-1-simont@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-08ASoC: codecs: ES8326: button detect issueZhang Yi
We find that we need to set snd_jack_types to 0. If not, there will be a probability of button detection errors Signed-off-by: Zhang Yi <zhangyi@everest-semi.com> Link: https://patch.msgid.link/20240807025356.24904-2-zhangyi@everest-semi.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-08ASoC: codecs: ES8326: input issue after initZhang Yi
We found an input issue after initiation.So we added the default input source at initiation. Signed-off-by: Zhang Yi <zhangyi@everest-semi.com> Link: https://patch.msgid.link/20240807025356.24904-3-zhangyi@everest-semi.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-08ASoC: cs35l56: Use regmap_read_bypassed() to wake the deviceSimon Trimmer
Now that regmap_read_bypassed() has been added to the kernel it is preferable to wake the device with a read rather than a write as the utility function can be called at a time before the device has been identified. Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com> Link: https://patch.msgid.link/20240807142715.47077-1-simont@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-08ASoC: Merge fixesMark Brown
So we can apply AMD patches that rely on them.
2024-08-07ASoC: tas*: Drop unused GPIO includesLinus Walleij
These drivers all use <linux/gpio/consumer.h> and has no business including the legacy headers <linux/gpio.h> or <linux/of_gpio.h>. Drop the surplus includes. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://patch.msgid.link/20240807-asoc-tas-gpios-v2-3-bd0f2705d58b@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-07ASoC: tas2781-i2c: Get the right GPIO lineLinus Walleij
The code is obtaining a GPIO reset using the reset GPIO name "reset-gpios", but the gpiolib is already adding the suffix "-gpios" to anything passed to this function and will be looking for "reset-gpios-gpios" which is most certainly not what the author desired. Fix it up. Fixes: ef3bcde75d06 ("ASoC: tas2781: Add tas2781 driver") Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://patch.msgid.link/20240807-asoc-tas-gpios-v2-2-bd0f2705d58b@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-07ASoC: tas2781-i2c: Drop weird GPIO codeLinus Walleij
The tas2781-i2c driver gets an IRQ from either ACPI or device tree, then proceeds to check if the IRQ has a corresponding GPIO and in case it does enforce the GPIO as input and set a label on it. This is abuse of the API: - First we cannot guarantee that the numberspaces of the GPIOs and the IRQs are the same, i.e that an IRQ number corresponds to a GPIO number like that. - Second, GPIO chips and IRQ chips should be treated as orthogonal APIs, the irqchip needs to ascertain that the backing GPIO line is set to input etc just using the irqchip. - Third it is using the legacy <linux/gpio.h> API which should not be used in new code yet this was added just a year ago. Delete the offending code. If this creates problems the GPIO and irqchip maintainers can help to fix the issues. It *should* not create any problems, because the irq isn't used anywhere in the driver, it's just obtained and then left unused. Fixes: ef3bcde75d06 ("ASoC: tas2781: Add tas2781 driver") Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://patch.msgid.link/20240807-asoc-tas-gpios-v2-1-bd0f2705d58b@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-07ASoC: codecs: lpass-va-macro: warn on unknown versionDmitry Baryshkov
Warn the users if the driver doesn't know the codec version. This helps in debugging the issues with other codec not detecting the correct version. va_macro 3370000.codec: Unknown VA Codec version, ID: 00 / 0f / 00 Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Link: https://patch.msgid.link/20240803-codec-version-v1-2-bc29baa5e417@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-07ASoC: codecs: lpass-macro: fix version strings returned for 1.x codecsDmitry Baryshkov
Add missing cases to lpass_macro_get_codec_version_string() to let it print the correct codec version for 1.x codec platforms. Fixes: 378918d59181 ("ASoC: codecs: lpass-macro: add helpers to get codec version") Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Link: https://patch.msgid.link/20240803-codec-version-v1-1-bc29baa5e417@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-06ASoC: Extend wm_adsp so cs35l56 can suppress controlsMark Brown
Merge series from Simon Trimmer <simont@opensource.cirrus.com>: This pair of patches extend wm_adsp to add a callback that can be used to control whether ALSA controls are added and then tweak cs35l56 to use it to suppress controls made from firmware coefficients.
2024-08-05ASoC: cs35l56: Handle OTP read latency over SoundWireRichard Fitzgerald
Use the late-read buffer in the CS35L56 SoundWire interface to read OTP memory. The OTP memory has a longer access latency than chip registers and cannot guarantee to return the data value in the SoundWire control response if the bus clock is >4.8 MHz. The Cirrus SoundWire peripheral IP exposes the bridge-to-bus read buffer and status bits. For a read from OTP the bridge status bits are polled to wait for the OTP data to be loaded into the read buffer and the data is then read from there. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Fixes: e1830f66f6c6 ("ASoC: cs35l56: Add helper functions for amp calibration") Link: https://patch.msgid.link/20240805140839.26042-1-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-05ASoC: codecs: lpass-macro: fix missing codec versionJohan Hovold
Recent changes that started checking the codec version broke audio on the Lenovo ThinkPad X13s: wsa_macro 3240000.codec: Unsupported Codec version (0) wsa_macro 3240000.codec: probe with driver wsa_macro failed with error -22 rx_macro 3200000.rxmacro: Unsupported Codec version (0) rx_macro 3200000.rxmacro: probe with driver rx_macro failed with error -22 Add the missing codec version to the lookup table so that the codec drivers probe successfully. Note that I'm just assuming that this is a 2.0 codec based on the fact that this device uses the older register layout. Fixes: 378918d59181 ("ASoC: codecs: lpass-macro: add helpers to get codec version") Fixes: dbacef05898d ("ASoC: codec: lpass-rx-macro: prepare driver to accomdate new codec versions") Fixes: 727de4fbc546 ("ASoC: codecs: lpass-wsa-macro: Correct support for newer v2.5 version") Signed-off-by: Johan Hovold <johan+linaro@kernel.org> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://patch.msgid.link/20240729131351.27886-1-johan+linaro@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-05ASoC: cs-amp-lib: Fix NULL pointer crash if efi.get_variable is NULLRichard Fitzgerald
Call efi_rt_services_supported() to check that efi.get_variable exists before calling it. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Fixes: 1cad8725f2b9 ("ASoC: cs-amp-lib: Add helpers for factory calibration data") Link: https://patch.msgid.link/20240805114222.15722-1-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-05ASoC: cs35l56: Stop creating ALSA controls for firmware coefficientsSimon Trimmer
A number of laptops have gone to market with old firmware versions that export controls that have since been hidden, but we can't just install a newer firmware because the firmware for each product is customized and qualified by the OEM. The issue is that alsactl save and restore has no idea what controls are good to persist which can lead to misconfiguration. There is no reason that the UCM or user should need to interact with any of the ALSA controls for the firmware coefficients so they can be removed entirely. Fixes: e49611252900 ("ASoC: cs35l56: Add driver for Cirrus Logic CS35L56") Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com> Link: https://patch.msgid.link/20240805102721.30102-3-simont@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-05ASoC: wm_adsp: Add control_add callback and export wm_adsp_control_add()Simon Trimmer
The callback allows codec drivers to affect how firmware coefficients are added as controls. For example a codec driver may selectively add controls by choosing to call wm_adsp_control_add() based on some filter logic. Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com> Link: https://patch.msgid.link/20240805102721.30102-2-simont@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-02ASoC: cs43130: Constify snd_soc_component_driver structChristophe JAILLET
In order to constify `snd_soc_component_driver` struct, duplicate `soc_component_dev_cs43130` into a `soc_component_dev_cs43130_digital` and `soc_component_dev_cs43130_analog`. These 2 new structures share the same .dapm_widgets and .dapm_routes arrays but differ for .num_dapm_widgets and .num_dapm_routes. In the digital case, the last entries are not taken into account. Doing so has several advantages: - `snd_soc_component_driver` can be declared as const to move their declarations to read-only sections. - code in the probe is simpler. There is no need to concatenate some arrays to handle the "analog" case - this saves some memory because all_hp_widgets and analog_hp_routes can be removed. Before : ====== text data bss dec hex filename 53965 8265 4512 66742 104b6 sound/soc/codecs/cs43130.o After : ===== text data bss dec hex filename 54409 7881 64 62354 f392 sound/soc/codecs/cs43130.o Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Link: https://patch.msgid.link/1f04bb0366d9640d7ee361dae114ff79e4b381c1.1722274212.git.christophe.jaillet@wanadoo.fr Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-02ASoC: sti-sas: Constify snd_soc_component_driver structChristophe JAILLET
In order to constify `snd_soc_component_driver` struct, simplify the logic and the `sti_sas_dev_data` struct. Since commit 165a57a3df02 ("ASoC: sti-sas: clean legacy in sti-sas") only only chip is supported and `sti_sas_driver` can be fully defined at compilation time. Before: ====== text data bss dec hex filename 8033 1547 16 9596 257c sound/soc/codecs/sti-sas.o After: ===== text data bss dec hex filename 8257 1163 16 9436 24dc sound/soc/codecs/sti-sas.o Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Link: https://patch.msgid.link/2c08558813e3bbfae0a5302199cf6ca226e7cde1.1722544073.git.christophe.jaillet@wanadoo.fr Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-02ASoC: tas2781: Fix a compiling warning reported by robot kernel test due to ↵Shenghao Ding
adding tas2563_dvc_table Move tas2563_dvc_table into a separate Header file, as only tas2781 codec driver use this table, and hda side codec driver won't use it. Fixes: 75ed63a5ab5d ("ASoC: tas2781: Add new Kontrol to set tas2563 digital Volume") Signed-off-by: Shenghao Ding <shenghao-ding@ti.com> Link: https://patch.msgid.link/20240802072055.1462-1-shenghao-ding@ti.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-02ASoC: cs42l43: Cache shutter IRQ control pointersCharles Keepax
The microphone/speaker privacy shutter ALSA control handlers need to call pm_runtime_resume, since the hardware needs to be powered up to check the hardware state of the shutter. The IRQ handler for the shutters also needs to notify the ALSA control to inform user-space the shutters updated. However this leads to a mutex inversion, between the sdw_dev_lock and the controls_rwsem. To avoid this mutex inversion cache the kctl pointers before the IRQ handler, which avoids the need to lookup the control and take the controls_rwsem. Suggested-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://patch.msgid.link/20240802105734.2309788-5-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-02ASoC: cs35l45: Use new snd_soc_component_get_kcontrol_locked() helperCharles Keepax
No longer any need to hard code the addition of the name prefix, use the new helper function. Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://patch.msgid.link/20240802105734.2309788-4-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-02ASoC: cs42l43: Remove redundant semi-colon at end of functionCharles Keepax
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://patch.msgid.link/20240802105734.2309788-2-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-01ASoC: Use of_property_read_bool()Rob Herring (Arm)
Use of_property_read_bool() to read boolean properties rather than of_get_property(). This is part of a larger effort to remove callers of of_get_property() and similar functions. of_get_property() leaks the DT property data pointer which is a problem for dynamically allocated nodes which may be freed. Signed-off-by: Rob Herring (Arm) <robh@kernel.org> Link: https://patch.msgid.link/20240731191312.1710417-20-robh@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-31ASoC: nau8822: Lower debug print priorityFrancesco Dolcini
NAU8822 codec PLL parameters are not an information that the general user should care about, this print is supposed to be used for debugging, adjust the debug print priority accordingly. Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com> Link: https://patch.msgid.link/20240731114828.61238-1-francesco@dolcini.it Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-29ASoC: codecs: wcd93xx/wsa88xx: Correct Soundwire portsMark Brown
Merge series from Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>: Incorrect mask of Soundwire ports - one bit too long/big - was passed. Theoretically, too wide mask could cause an out of bounds read in sdw_get_slave_dpn_prop() in stream.c, however only in the case of buggy driver, e.g. adding incorrect number of ports via sdw_stream_add_slave(). Not adding Cc-stable because I don't think the issue can lead to real out-of-bounds read.
2024-07-29ASoC: tas2781: Add TAS2563 into the HeaderShenghao Ding
Add TAS2563 into the Header in case of misunderstanding and add channel No information for error debug in tasdevice_dev_read. Signed-off-by: Shenghao Ding <shenghao-ding@ti.com> Link: https://patch.msgid.link/20240716064120.158-1-shenghao-ding@ti.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-29ASoC: codecs: wsa88xx and wcd93xx: Soundwire portMark Brown
Merge series from Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>: Few cleanups to make the code more robust or readable. No functional impact (compiled objects stay the same).
2024-07-29ASoC: codecs: wsa88xx: Few cleanupsMark Brown
Merge series from Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>: A few cleanups around wsa88xx codecs.
2024-07-29ASoC: cs530x: Change IN HPF Select kcontrol namePaul Handrigan
Change to the IN HPF Select kcontrol to the correct name IN DEC Filter Select. Signed-off-by: Paul Handrigan <paulha@opensource.cirrus.com> Link: https://patch.msgid.link/20240726151111.3247774-1-paulha@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-29ASoC: codecs: wsa884x: Correct Soundwire ports maskKrzysztof Kozlowski
Device has up to WSA884X_MAX_SWR_PORTS number of ports and the array assigned to prop.sink_dpn_prop has 0..WSA884X_MAX_SWR_PORTS-1 elements. On the other hand, GENMASK(high, low) creates an inclusive mask between <high, low>, so we need the mask from 0 up to WSA884X_MAX_SWR_PORTS-1. Theoretically, too wide mask could cause an out of bounds read in sdw_get_slave_dpn_prop() in stream.c, however only in the case of buggy driver, e.g. adding incorrect number of ports via sdw_stream_add_slave(). Fixes: aa21a7d4f68a ("ASoC: codecs: wsa884x: Add WSA884x family of speakers") Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://patch.msgid.link/20240726-asoc-wcd-wsa-swr-ports-genmask-v1-6-d4d7a8b56f05@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-29ASoC: codecs: wsa883x: Correct Soundwire ports maskKrzysztof Kozlowski
Device has up to WSA883X_MAX_SWR_PORTS number of ports and the array assigned to prop.sink_dpn_prop has 0..WSA883X_MAX_SWR_PORTS-1 elements. On the other hand, GENMASK(high, low) creates an inclusive mask between <high, low>, so we need the mask from 0 up to WSA883X_MAX_SWR_PORTS-1. Theoretically, too wide mask could cause an out of bounds read in sdw_get_slave_dpn_prop() in stream.c, however only in the case of buggy driver, e.g. adding incorrect number of ports via sdw_stream_add_slave(). Fixes: 43b8c7dc85a1 ("ASoC: codecs: add wsa883x amplifier support") Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://patch.msgid.link/20240726-asoc-wcd-wsa-swr-ports-genmask-v1-5-d4d7a8b56f05@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-29ASoC: codecs: wsa881x: Correct Soundwire ports maskKrzysztof Kozlowski
Device has up to WSA881X_MAX_SWR_PORTS number of ports and the array assigned to prop.sink_dpn_prop has 0..WSA881X_MAX_SWR_PORTS-1 elements. On the other hand, GENMASK(high, low) creates an inclusive mask between <high, low>, so we need the mask from 0 up to WSA881X_MAX_SWR_PORTS-1. Theoretically, too wide mask could cause an out of bounds read in sdw_get_slave_dpn_prop() in stream.c, however only in the case of buggy driver, e.g. adding incorrect number of ports via sdw_stream_add_slave(). Fixes: a0aab9e1404a ("ASoC: codecs: add wsa881x amplifier support") Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://patch.msgid.link/20240726-asoc-wcd-wsa-swr-ports-genmask-v1-4-d4d7a8b56f05@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-29ASoC: codecs: wcd939x-sdw: Correct Soundwire ports maskKrzysztof Kozlowski
Device has up to WCD939X_MAX_TX_SWR_PORTS (or WCD939X_MAX_RX_SWR_PORTS for sink) number of ports and the array assigned to prop.src_dpn_prop and prop.sink_dpn_prop has 0..WCD939X_MAX_TX_SWR_PORTS-1 elements. On the other hand, GENMASK(high, low) creates an inclusive mask between <high, low>, so we need the mask from 0 up to WCD939X_MAX_TX_SWR_PORTS-1. Theoretically, too wide mask could cause an out of bounds read in sdw_get_slave_dpn_prop() in stream.c, however only in the case of buggy driver, e.g. adding incorrect number of ports via sdw_stream_add_slave(). Fixes: be2af391cea0 ("ASoC: codecs: Add WCD939x Soundwire devices driver") Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://patch.msgid.link/20240726-asoc-wcd-wsa-swr-ports-genmask-v1-3-d4d7a8b56f05@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-29ASoC: codecs: wcd938x-sdw: Correct Soundwire ports maskKrzysztof Kozlowski
Device has up to WCD938X_MAX_SWR_PORTS number of ports and the array assigned to prop.src_dpn_prop and prop.sink_dpn_prop has 0..WCD938X_MAX_SWR_PORTS-1 elements. On the other hand, GENMASK(high, low) creates an inclusive mask between <high, low>, so we need the mask from 0 up to WCD938X_MAX_SWR_PORTS-1. Theoretically, too wide mask could cause an out of bounds read in sdw_get_slave_dpn_prop() in stream.c, however only in the case of buggy driver, e.g. adding incorrect number of ports via sdw_stream_add_slave(). Fixes: 16572522aece ("ASoC: codecs: wcd938x-sdw: add SoundWire driver") Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://patch.msgid.link/20240726-asoc-wcd-wsa-swr-ports-genmask-v1-2-d4d7a8b56f05@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-29ASoC: codecs: wcd937x-sdw: Correct Soundwire ports maskKrzysztof Kozlowski
Device has up to WCD937X_MAX_TX_SWR_PORTS (or WCD937X_MAX_SWR_PORTS for sink) number of ports and the array assigned to prop.src_dpn_prop and prop.sink_dpn_prop has 0..WCD937X_MAX_TX_SWR_PORTS-1 elements. On the other hand, GENMASK(high, low) creates an inclusive mask between <high, low>, so we need the mask from 0 up to WCD937X_MAX_TX_SWR_PORTS-1. Theoretically, too wide mask could cause an out of bounds read in sdw_get_slave_dpn_prop() in stream.c, however only in the case of buggy driver, e.g. adding incorrect number of ports via sdw_stream_add_slave(). Fixes: c99a515ff153 ("ASoC: codecs: wcd937x-sdw: add SoundWire driver") Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://patch.msgid.link/20240726-asoc-wcd-wsa-swr-ports-genmask-v1-1-d4d7a8b56f05@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-29ASoC: codecs: wcd939x: Move max port number defines to enumKrzysztof Kozlowski
Instead of having separate define to indicate number of TX and RX Soundwire ports, move it to the enums defining actual port indices/values. This makes it more obvious why such value was chosen as number of TX/RX ports. Note: the enums start from 1, thus number of ports equals to the last vaue in the enum. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Link: https://patch.msgid.link/20240725-asoc-wsa88xx-port-arrays-v1-7-80a03f440c72@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-29ASoC: codecs: wcd938x: Move max port number defines to enumKrzysztof Kozlowski
Instead of having separate define to indicate number of TX and RX Soundwire ports, move it to the enums defining actual port indices/values. This makes it more obvious why such value was chosen as number of TX/RX ports. Note: the enums start from 1, thus number of ports equals to the last vaue in the enum. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Link: https://patch.msgid.link/20240725-asoc-wsa88xx-port-arrays-v1-6-80a03f440c72@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-29ASoC: codecs: wcd937x: Move max port number defines to enumKrzysztof Kozlowski
Instead of having separate define to indicate number of TX and RX Soundwire ports, move it to the enums defining actual port indices/values. This makes it more obvious why such value was chosen as number of TX/RX ports. Note: the enums start from 1, thus number of ports equals to the last vaue in the enum. WCD937X_MAX_SWR_PORTS is used in one of structures in the header, so entire enum must be moved to the top of the header file. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Link: https://patch.msgid.link/20240725-asoc-wsa88xx-port-arrays-v1-5-80a03f440c72@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-29ASoC: codecs: wcd938x: Drop unused defines and enumsKrzysztof Kozlowski
Drop defines and enums not used in the driver. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Link: https://patch.msgid.link/20240725-asoc-wsa88xx-port-arrays-v1-4-80a03f440c72@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-29ASoC: codecs: wsa884x: Use designator array initializers for Soundwire portsKrzysztof Kozlowski
Two arrays (with 'struct sdw_dpn_prop' and 'struct sdw_port_config') store configuration of Soundwire ports, thus each of their element is indexed according to the port number (enum wsa884x_port_ids, e.g. WSA884X_PORT_DAC). Except the indexing, they also store port number offset by one in member 'num'. Entire code depends on that correlation between array index and port number, thus make it explicit by using designators. The code is functionally the same, but more obvious for reading. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Link: https://patch.msgid.link/20240725-asoc-wsa88xx-port-arrays-v1-3-80a03f440c72@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-29ASoC: codecs: wsa883x: Use designator array initializers for Soundwire portsKrzysztof Kozlowski
Two arrays (with 'struct sdw_dpn_prop' and 'struct sdw_port_config') store configuration of Soundwire ports, thus each of their element is indexed according to the port number (enum wsa_port_ids, e.g. WSA883X_PORT_DAC). Except the indexing, they also store port number offset by one in member 'num'. Entire code depends on that correlation between array index and port number, thus make it explicit by using designators. The code is functionally the same, but more obvious for reading. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Link: https://patch.msgid.link/20240725-asoc-wsa88xx-port-arrays-v1-2-80a03f440c72@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-29ASoC: codecs: wsa881x: Use designator array initializers for Soundwire portsKrzysztof Kozlowski
Two arrays (with 'struct sdw_dpn_prop' and 'struct sdw_port_config') store configuration of Soundwire ports, thus each of their element is indexed according to the port number (enum wsa_port_ids, e.g. WSA881X_PORT_DAC). Except the indexing, they also store port number offset by one in member 'num'. Entire code depends on that correlation between array index and port number, thus make it explicit by using designators. The code is functionally the same, but more obvious for reading. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Link: https://patch.msgid.link/20240725-asoc-wsa88xx-port-arrays-v1-1-80a03f440c72@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-29ASoC: cs42l42: Convert comma to semicolonChen Ni
Replace a comma between expression statements by a semicolon. Fixes: 90f6a2a20bd2 ("ASoC: cs42l42: Add SoundWire support") Signed-off-by: Chen Ni <nichen@iscas.ac.cn> Reviewed-by: Richard Fitzgerald <rf@opensource.cirrus.com> Reviewed-by: Dragan Simic <dsimic@manjaro.org> Link: https://patch.msgid.link/20240716025307.400156-1-nichen@iscas.ac.cn Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-29ASoC: codecs: lpass-wsa-macro: Do not hard-code dai in VI mixerKrzysztof Kozlowski
The wsa_macro_vi_feed_mixer_put() callback for setting VI feedback mixer value could be used for different DAIs (planned in the future CPS DAI), so make the code a bit more generic by using DAI ID from widget->shift, instead of hard-coding it. The get() callback already follows such convention. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://patch.msgid.link/20240723144607.123240-1-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-29ASoC: rt5682s: Return devm_of_clk_add_hw_provider to transfer the errorMa Ke
Return devm_of_clk_add_hw_provider() in order to transfer the error, if it fails due to resource allocation failure or device tree clock provider registration failure. Fixes: bdd229ab26be ("ASoC: rt5682s: Add driver for ALC5682I-VS codec") Signed-off-by: Ma Ke <make24@iscas.ac.cn> Link: https://patch.msgid.link/20240717115436.3449492-1-make24@iscas.ac.cn Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-29ASoC: codecs: ES8326: suspend issueZhang Yi
We find that we need to disable micbias for the codec to enter suspend So We modify the trigger conditions for enable_micbias and disable_micbias Signed-off-by: Zhang Yi <zhangyi@everest-semi.com> Link: https://patch.msgid.link/20240726031002.35055-1-zhangyi@everest-semi.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-29ASoC: codecs: wsa884x: Simplify handling variantKrzysztof Kozlowski
Driver does not use detected variant variable past the init function, so do not store it in the state container structure. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://patch.msgid.link/20240710-asoc-wsa88xx-version-v1-4-f1c54966ccde@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-29ASoC: codecs: wsa883x: Simplify handling variant/versionKrzysztof Kozlowski
Driver does not use detected variant/version variables past the init function, so do not store them in the state container structure. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://patch.msgid.link/20240710-asoc-wsa88xx-version-v1-3-f1c54966ccde@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>