[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250905154430.12268-1-srinivas.kandagatla@oss.qualcomm.com>
Date: Fri, 5 Sep 2025 16:44:18 +0100
From: Srinivas Kandagatla <srinivas.kandagatla@....qualcomm.com>
To: broonie@...nel.org
Cc: lgirdwood@...il.com, tiwai@...e.com, vkoul@...nel.org, srini@...nel.org,
yung-chuan.liao@...ux.intel.com, pierre-louis.bossart@...ux.dev,
linux-arm-msm@...r.kernel.org, linux-kernel@...r.kernel.org,
neil.armstrong@...aro.org, krzysztof.kozlowski@...aro.org,
dmitry.baryshkov@....qualcomm.com, linux-sound@...r.kernel.org,
Srinivas Kandagatla <srinivas.kandagatla@....qualcomm.com>
Subject: [PATCH v3 00/12] ASoC: codecs: wcd93xxx: remove code duplication
All the Qualcomm WCD codecs and WCD based codecs have lots of code in
common, resulting in lot of duplicate code.
This series is an attempt to clean some of this by moving the common
code to wcd-common library or to soundwire helper functions.
Currently I have done cleanups for 4 codecs wcd934x, wcd937x, wcd938x
and wcd939x, however any new Qualcomm codecs can avoid this duplication
by using the wcd-common library.
I have also added two helpers of_sdw_find_device_by_node() and
sdw_slave_get_current_bank() in soundwire layer for the codecs to use them,
this series was already acked by Soundwire maintainer Vinod.
As original cleanup series was depending on the new soundwire interfaces
I have combined both the series as they are cleaning up code
duplications.
As am touching the same codec drivers, a bug fix is also added at the
start of the series.
There is still lot of code that is duplicate, but this is just a
starting point for such cleanups.
I have tested this on T14s, any testing is appreciated.
Changes since v2:
-combined other cleanup patch series
("[PATCH v2 0/4] ASoC: codecs: wcd937x/8x/9x: cleanup")
https://www.spinics.net/linux/fedora/linux-sound/msg25202.html
into this series to make it easy to apply.
- fixed copyright text.
- fixed few empty spaces and re-arrage header inclusion into
source file.
Changes since v1:
- add new patches to remove usage of dev_get_regmap
- add fix to wcd937x for comp soundwire ports
Srinivas Kandagatla (12):
ASoC: codecs: wcd937x: set the comp soundwire port correctly
soundwire: bus: add of_sdw_find_device_by_node helper
soundwire: bus: add sdw_slave_get_current_bank helper
ASoC: codecs: wcdxxxx: use of_sdw_find_device_by_node helper
ASoC: codecs: wcdxxxx: use sdw_slave_get_current_bank helper
ASoC: codecs: wcd: add common helper for wcd codecs
ASoC: codecs: wcd-common: move WCD_SDW_CH to common
ASoC: codecs: wcd-common: move component ops to common
ASoC: codecs: wcd939x: get regmap directly
ASoC: codecs: wcd-common: move status_update callback to common
ASoC: codecs: wcd938x: get regmap directly
ASoC: codecs: wcd937x: get regmap directly
drivers/soundwire/bus.c | 12 +++
drivers/soundwire/slave.c | 6 ++
include/linux/soundwire/sdw.h | 17 ++++
sound/soc/codecs/Kconfig | 8 ++
sound/soc/codecs/Makefile | 2 +
sound/soc/codecs/wcd-common.c | 143 +++++++++++++++++++++++++++++++++
sound/soc/codecs/wcd-common.h | 44 ++++++++++
sound/soc/codecs/wcd934x.c | 82 ++++++-------------
sound/soc/codecs/wcd937x-sdw.c | 67 ++-------------
sound/soc/codecs/wcd937x.c | 85 +++++---------------
sound/soc/codecs/wcd937x.h | 24 ++----
sound/soc/codecs/wcd938x-sdw.c | 83 +++----------------
sound/soc/codecs/wcd938x.c | 99 +++++------------------
sound/soc/codecs/wcd938x.h | 26 +-----
sound/soc/codecs/wcd939x-sdw.c | 98 +++-------------------
sound/soc/codecs/wcd939x.c | 104 ++++++------------------
sound/soc/codecs/wcd939x.h | 32 +-------
17 files changed, 354 insertions(+), 578 deletions(-)
create mode 100644 sound/soc/codecs/wcd-common.c
create mode 100644 sound/soc/codecs/wcd-common.h
--
2.50.0
Powered by blists - more mailing lists