diff options
| author | Mark Brown <broonie@kernel.org> | 2025-09-19 14:27:28 +0100 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2025-09-19 14:27:28 +0100 |
| commit | 309e94a64b61d1b18a0d0d83de4bf2d2582708ce (patch) | |
| tree | 1ccb7d6bbbd09559fd60a1069884f0f7e108d472 /include | |
| parent | ASoC: soc-dapm: prepare for hiding struct (diff) | |
| parent | ASoC: codecs: wcd937x: get regmap directly (diff) | |
| download | linux-309e94a64b61d1b18a0d0d83de4bf2d2582708ce.tar.gz linux-309e94a64b61d1b18a0d0d83de4bf2d2582708ce.zip | |
ASoC: codecs: wcd93xxx: remove code duplication
Merge series from Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>:
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, 2 bug fixes are 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.
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/soundwire/sdw.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/linux/soundwire/sdw.h b/include/linux/soundwire/sdw.h index 0832776262ac..e6a3476bcef1 100644 --- a/include/linux/soundwire/sdw.h +++ b/include/linux/soundwire/sdw.h @@ -19,6 +19,7 @@ struct dentry; struct fwnode_handle; +struct device_node; struct sdw_bus; struct sdw_slave; @@ -1086,6 +1087,10 @@ int sdw_stream_add_slave(struct sdw_slave *slave, int sdw_stream_remove_slave(struct sdw_slave *slave, struct sdw_stream_runtime *stream); +struct device *of_sdw_find_device_by_node(struct device_node *np); + +int sdw_slave_get_current_bank(struct sdw_slave *sdev); + int sdw_slave_get_scale_index(struct sdw_slave *slave, u8 *base); /* messaging and data APIs */ @@ -1119,6 +1124,18 @@ static inline int sdw_stream_remove_slave(struct sdw_slave *slave, return -EINVAL; } +static inline struct device *of_sdw_find_device_by_node(struct device_node *np) +{ + WARN_ONCE(1, "SoundWire API is disabled"); + return NULL; +} + +static inline int sdw_slave_get_current_bank(struct sdw_slave *sdev) +{ + WARN_ONCE(1, "SoundWire API is disabled"); + return -EINVAL; +} + /* messaging and data APIs */ static inline int sdw_read(struct sdw_slave *slave, u32 addr) { |
