[PATCH 00/15] Tidy up ASoC control get and put handlers

Charles Keepax posted 15 patches 9 months ago
There is a newer version of this series
include/sound/soc.h             |  24 +-
sound/pci/hda/tas2781_hda_i2c.c |   2 +-
sound/pci/hda/tas2781_hda_spi.c |   2 +-
sound/soc/Kconfig               |   7 +
sound/soc/Makefile              |   4 +
sound/soc/codecs/wm5110.c       |   4 +-
sound/soc/soc-ops-test.c        | 541 ++++++++++++++++++++++++
sound/soc/soc-ops.c             | 712 +++++++++++---------------------
sound/soc/soc-topology.c        |   4 +-
9 files changed, 807 insertions(+), 493 deletions(-)
create mode 100644 sound/soc/soc-ops-test.c
[PATCH 00/15] Tidy up ASoC control get and put handlers
Posted by Charles Keepax 9 months ago
There is a lot of duplicated and occasionally slightly incorrect code
around the ASoC control get and put handlers. This series add some kunit
tests and then refactors the code to get all the tests passing and
reduce some of the duplication. The focus here is on the volsw handlers,
future work could still be done on some of the others but these were the
ones that most required attention.

Hopefully the only slightly controversal change is the very last patch
which changes platform_max to be applied after the control type is
determined, more discussion in the commit message for that one.

Thanks,
Charles

Charles Keepax (15):
  ASoC: ops-test: Add some basic kunit tests for soc-ops
  ASoC: ops: Minor formatting fixups
  ASoC: ops: Update comments for xr_sx control helpers
  ASoC: ops: Update mask generation to use GENMASK
  ASoC: ops: Factor out helper to check valid control values
  ASoC: ops: Replace snd_soc_read_signed() with new helper
  ASoC: ops: Add control to register value helper
  ASoC: ops: Remove snd_soc_info_volsw_range()
  ASoC: ops: Remove snd_soc_get_volsw_range()
  ASoC: ops: Remove snd_soc_put_volsw_range()
  ASoC: ops: Factor out common code from info callbacks
  ASoC: ops: Factor out common code from put callbacks
  ASoC: ops: Factor out common code from get callbacks
  ASoC: ops: Remove some unnecessary local variables
  ASoC: ops: Apply platform_max after deciding control type

 include/sound/soc.h             |  24 +-
 sound/pci/hda/tas2781_hda_i2c.c |   2 +-
 sound/pci/hda/tas2781_hda_spi.c |   2 +-
 sound/soc/Kconfig               |   7 +
 sound/soc/Makefile              |   4 +
 sound/soc/codecs/wm5110.c       |   4 +-
 sound/soc/soc-ops-test.c        | 541 ++++++++++++++++++++++++
 sound/soc/soc-ops.c             | 712 +++++++++++---------------------
 sound/soc/soc-topology.c        |   4 +-
 9 files changed, 807 insertions(+), 493 deletions(-)
 create mode 100644 sound/soc/soc-ops-test.c

-- 
2.39.5
Re: [PATCH 00/15] Tidy up ASoC control get and put handlers
Posted by Mark Brown 9 months ago
On Tue, 18 Mar 2025 17:14:44 +0000, Charles Keepax wrote:
> There is a lot of duplicated and occasionally slightly incorrect code
> around the ASoC control get and put handlers. This series add some kunit
> tests and then refactors the code to get all the tests passing and
> reduce some of the duplication. The focus here is on the volsw handlers,
> future work could still be done on some of the others but these were the
> ones that most required attention.
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[01/15] ASoC: ops-test: Add some basic kunit tests for soc-ops
        commit: 7a24b876ad8cdd56457e881d384a038922b508c3
[02/15] ASoC: ops: Minor formatting fixups
        commit: 534bfb330b2612199b2afaafc769ccb42bebb204
[03/15] ASoC: ops: Update comments for xr_sx control helpers
        commit: 7f978180673b4f3b68fcc66fc1f1d74a1fc5a93a
[04/15] ASoC: ops: Update mask generation to use GENMASK
        commit: c6002c1177cafb4462b6c188d2a62eb67f15165f
[05/15] ASoC: ops: Factor out helper to check valid control values
        commit: eeb76cb1fa0dcccf33091b04ba150076dfbeb6fd
[06/15] ASoC: ops: Replace snd_soc_read_signed() with new helper
        commit: 1522aacd0114069b7f01f047b9e5b159399af295
[07/15] ASoC: ops: Add control to register value helper
        commit: ed336066202c02f0b0e47d0cf08fd8f40a42351f
[08/15] ASoC: ops: Remove snd_soc_info_volsw_range()
        commit: 894a37c9de4b8a447ffa609d552e91ccb447c0a9
[09/15] ASoC: ops: Remove snd_soc_get_volsw_range()
        commit: fd7442561cfe9516b37cdb1d229dc1f811dc86cc
[10/15] ASoC: ops: Remove snd_soc_put_volsw_range()
        commit: 7d5df968f95cee274740d5fa42e0798ffb59bd38
[11/15] ASoC: ops: Factor out common code from info callbacks
        commit: 9dfcafe2037acc14265cead8d8a937a8bc4e01d8
[12/15] ASoC: ops: Factor out common code from put callbacks
        commit: 318e8794e05ca1879441a602e78c74f9d7e18309
[13/15] ASoC: ops: Factor out common code from get callbacks
        commit: 1e3cd64a29baa874b89180ac0744178ecb00f3cd
[14/15] ASoC: ops: Remove some unnecessary local variables
        commit: 94dfe71f0a4eb0d7df542560c22961dedf45141d
[15/15] ASoC: ops: Apply platform_max after deciding control type
        commit: 502a668fad12b6ca10bcbb615d62e61d3b669c99

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark