Commit Graph

20 Commits

Author SHA1 Message Date
Mark Brown e1de058051
ASoC: wsa883x: Update to use maple tree register cache
The maple tree register cache is based on a much more modern data structure
than the rbtree cache and makes optimisation choices which are probably
more appropriate for modern systems than those made by the rbtree cache. In
v6.5 it has also acquired the ability to generate multi-register writes in
sync operations, bringing performance up to parity with the rbtree cache
there.

Update the wsa883x driver to use the more modern data structure.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230712-asoc-qcom-maple-v1-4-15f8089664b9@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-17 06:15:23 +01:00
Mark Brown 1a32b4b9a6
ASoC: Merge fixes due to dependencies
So we can apply the tlv320aic3xxx DT conversion.
2023-06-16 14:55:20 +01:00
Krzysztof Kozlowski 99f3e7de7a
ASoC: codecs: wsa883x: use existing define instead of raw value
Use existing define for WSA883X_GLOBAL_PA_ENABLE instead of hard-coded
value, just like in other places in this driver.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230607171326.179527-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-06-07 18:24:05 +01:00
Srinivas Kandagatla 40ba041107
ASoC: codecs: wsa883x: do not set can_multi_write flag
regmap-sdw does not support multi register writes, so there is
no point in setting this flag. This also leads to incorrect
programming of WSA codecs with regmap_multi_reg_write() call.

This invalid configuration should have been rejected by regmap-sdw.

Fixes: 43b8c7dc85 ("ASoC: codecs: add wsa883x amplifier support")
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230523154605.4284-1-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-05-24 11:20:07 +01:00
Takashi Iwai 1bdb78368f ASoC: Updates for v6.3
There's been quite a lot of activity this release, but not really
 one big feature - lots of new devices, plus a lot of cleanup and
 modernisation work spread throughout the subsystem:
 
  - More factoring out of common operations into helper functions
    by Morimoto-san.
  - DT schema conversons and stylistic nits.
  - Continued work on building out the new SOF IPC4 scheme.
  - Support for Awinc AT88395, Infineon PEB2466, Iron Device
    SMA1303, Mediatek MT8188, Realtek RT712, Renesas IDT821034,
    Samsung/Tesla FSD SoC I2S, and TI TAS5720A-Q1.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmPuKzoACgkQJNaLcl1U
 h9AO6wf/Us32gNLnLhT+YaPKouVq4KYpEXDeaIOdOCgs8RtonuCgURZ/D2TkzBVL
 EHLPp4QgqdIWo3FKkWgsXIOpO7R0//cj/vpccJ0PBe4VmvDinXq3dzGPPy6ZbHAS
 SatE5zItBKRUHaDliRk6S7IFEqJKwwlBqEzV0K41Q4EstYlIe+No0XIVDj3oRjHb
 jPmAD9XRPqsDaFFFb0NrVl9M/8HwBlc3j/Gnt19eJB/07IdgIr0S8mJn3qlFfGqu
 O8KgBo4+tvVMCQAxTVZ5exb/qTtK3gEPDuMi0eOKJz+g9wMJ4tRz+D8/8TQSmxmW
 lWORmNTx8jml7G4KirxIV4q4Lr0hRQ==
 =mB3t
 -----END PGP SIGNATURE-----

Merge tag 'asoc-v6.3' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-next

ASoC: Updates for v6.3

There's been quite a lot of activity this release, but not really
one big feature - lots of new devices, plus a lot of cleanup and
modernisation work spread throughout the subsystem:

 - More factoring out of common operations into helper functions
   by Morimoto-san.
 - DT schema conversons and stylistic nits.
 - Continued work on building out the new SOF IPC4 scheme.
 - Support for Awinc AT88395, Infineon PEB2466, Iron Device
   SMA1303, Mediatek MT8188, Realtek RT712, Renesas IDT821034,
   Samsung/Tesla FSD SoC I2S, and TI TAS5720A-Q1.
2023-02-16 14:32:04 +01:00
Krzysztof Kozlowski 27681129b0
ASoC: codecs: wsa88xx: remove unneeded includes
Remove unneeded includes from wsa881x and wsa883x drivers.  The drivers
do not reference anything from the headers.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230124163953.345949-3-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-01-25 12:38:41 +00:00
Krzysztof Kozlowski 57dc05c4e6
ASoC: codecs: constify static sdw_port_config struct
The struct sdw_port_config is not modified, so make it a const for code
safety.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230124163953.345949-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-01-25 12:38:40 +00:00
Krzysztof Kozlowski 65b7b869da
ASoC: codecs: constify static sdw_slave_ops struct
The struct sdw_slave_ops is not modified and sdw_driver takes pointer to
const, so make it a const for code safety.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230124163953.345949-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-01-25 12:38:39 +00:00
Krzysztof Kozlowski 100c94ffde
ASoC: codecs: wsa883x: correct playback min/max rates
Correct reversed values used in min/max rates, leading to incorrect
playback constraints.

Cc: <stable@vger.kernel.org>
Fixes: 43b8c7dc85 ("ASoC: codecs: add wsa883x amplifier support")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230124123049.285395-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-01-25 12:37:35 +00:00
Krzysztof Kozlowski d5ce5d3895
ASoC: codecs: wsa883x: Simplify &pdev->dev in probe
The probe already stores pointer to &pdev->dev, so use it to make the
code a bit easier to read.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230102114152.297305-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-01-16 11:16:35 +00:00
Krzysztof Kozlowski 6b6ab406ce
ASoC: codecs: wsa883x: Simplify with dev_err_probe
Code can be a bit simpler with dev_err_probe().

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20221109163759.1158837-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-11-16 16:25:53 +00:00
Krzysztof Kozlowski 8e02238744
ASoC: codecs: wsa883x: Shutdown on error path
If probe fails, toggle shutdown via GPIO to save power and reverse
probe actions.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20221109163759.1158837-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-11-16 16:25:52 +00:00
Randy Dunlap 5f52ceddc4
ASoC: codecs: wsa883x: use correct header file
Fix build errors when GPIOLIB is not set/enabled:

../sound/soc/codecs/wsa883x.c: In function 'wsa883x_probe':
../sound/soc/codecs/wsa883x.c:1394:25: error: implicit declaration of function 'devm_gpiod_get_optional'; did you mean 'devm_regulator_get_optional'? [-Werror=implicit-function-declaration]
         wsa883x->sd_n = devm_gpiod_get_optional(&pdev->dev, "powerdown",
../sound/soc/codecs/wsa883x.c:1395:49: error: 'GPIOD_FLAGS_BIT_NONEXCLUSIVE' undeclared (first use in this function)
         GPIOD_FLAGS_BIT_NONEXCLUSIVE);
../sound/soc/codecs/wsa883x.c:1414:9: error: implicit declaration of function 'gpiod_direction_output'; did you mean 'gpio_direction_output'? [-Werror=implicit-function-declaration]
         gpiod_direction_output(wsa883x->sd_n, 1);

Fixes: 43b8c7dc85 ("ASoC: codecs: add wsa883x amplifier support")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Reported-by: kernel test robot <lkp@intel.com>
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: Banajit Goswami <bgoswami@quicinc.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: alsa-devel@alsa-project.org
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.com>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20221108001829.5100-1-rdunlap@infradead.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-11-11 18:44:27 +00:00
Krzysztof Kozlowski ec5dba73f7
ASoC: codecs: wsa883x: Use proper shutdown GPIO polarity
The shutdown GPIO is active low (SD_N), but this depends on actual board
layout.  Linux drivers should only care about logical state, where high
(1) means shutdown and low (0) means do not shutdown.

Invert the GPIO to match logical value.

Fixes: 43b8c7dc85 ("ASoC: codecs: add wsa883x amplifier support")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20221110133512.478831-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-11-11 18:44:26 +00:00
Srinivas Kandagatla 3e29fb7479
ASoC: codecs: wsa883x: add clock stop support
WSA883x does support clock stop, so remove code that reset
the Codec during runtime pm suspend and add flag to mark
clock stop support.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20220906170112.1984-7-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-09-23 14:25:03 +01:00
Gaosheng Cui eec8a5f44e
ASoC: codecs: wsa883x: fix warning using-module-alias-sdw.cocci
This patch adds missing MODULE_DEVICE_TABLE definition which generates
correct modalias for automatic loading of this driver when it is built
as an external module.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Gaosheng Cui <cuigaosheng1@huawei.com>
Link: https://lore.kernel.org/r/20220705005315.663920-1-cuigaosheng1@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-05 16:44:31 +01:00
Srinivas Kandagatla 68f26639dc
ASoC: codecs: wsa883x: add missing break statement
Add missing break in one of the switch statement.

Reported-by: kernel test robot <lkp@intel.com>
Fixes: cdb09e6231 ("ASoC: codecs: wsa883x: add control, dapm widgets and map")
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20220701125515.32332-1-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-01 15:23:33 +01:00
Srinivas Kandagatla 0df73e1a9f
ASoC: codecs: wsa883x: handle timeouts in resume path
Currently we do not check if SoundWire slave initialization timeout
expired before continuing to access its registers.

Its possible that the registers are not accessible if timeout is
expired. Handle this by returning timeout in resume path.

Reported-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Fixes: 43b8c7dc85 ("ASoC: codecs: add wsa883x amplifier support")
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20220630130023.9308-2-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-30 16:10:50 +01:00
Srinivas Kandagatla cdb09e6231
ASoC: codecs: wsa883x: add control, dapm widgets and map
Add controls, dapm widgets along with route.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20220630123633.8047-1-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-30 13:40:28 +01:00
Srinivas Kandagatla 43b8c7dc85
ASoC: codecs: add wsa883x amplifier support
This patch adds support to WSA8830/WSA8812/WSA8835 Class-D Smart
Speaker Amplifier. This Amplifier is primarily interfaced with
SoundWire.

This patch is tested on SM8450 MTP Board.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20220629090644.67982-3-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-29 11:58:41 +01:00