diff options
| author | Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com> | 2025-09-09 13:19:45 +0100 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2025-09-18 22:24:27 +0100 |
| commit | 2e07017b28e8bbace4a4973d11d0646575d36f94 (patch) | |
| tree | 3c8271aa079b01ecc1eda96e0f7f478c8348b618 /include | |
| parent | soundwire: bus: add of_sdw_find_device_by_node helper (diff) | |
| download | linux-2e07017b28e8bbace4a4973d11d0646575d36f94.tar.gz linux-2e07017b28e8bbace4a4973d11d0646575d36f94.zip | |
soundwire: bus: add sdw_slave_get_current_bank helper
There has been 2 instances of this helper in codec drivers,
it does not make sense to keep duplicating this part of code.
Lets add a helper sdw_get_current_bank() for codec drivers to use it.
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Acked-by: Vinod Koul <vkoul@kernel.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Link: https://patch.msgid.link/20250909121954.225833-5-srinivas.kandagatla@oss.qualcomm.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/soundwire/sdw.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/soundwire/sdw.h b/include/linux/soundwire/sdw.h index 096213956d31..e6a3476bcef1 100644 --- a/include/linux/soundwire/sdw.h +++ b/include/linux/soundwire/sdw.h @@ -1089,6 +1089,8 @@ int sdw_stream_remove_slave(struct sdw_slave *slave, 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 */ @@ -1128,6 +1130,12 @@ static inline struct device *of_sdw_find_device_by_node(struct device_node *np) 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) { |
