mirror of
https://github.com/torvalds/linux.git
synced 2026-05-27 08:33:17 +02:00
ASoC: codecs: wcdxxxx: use sdw_slave_get_current_bank helper
use sdw_slave_get_current_bank() helper function, rather than duplicating this function in every codec driver. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Acked-by: Vinod Koul <vkoul@kernel.org> Link: https://patch.msgid.link/20250909121954.225833-7-srinivas.kandagatla@oss.qualcomm.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
772ed12bd0
commit
45a3295a30
|
|
@ -82,16 +82,6 @@ static struct sdw_dpn_prop wcd938x_dpn_prop[WCD938X_MAX_SWR_PORTS] = {
|
|||
}
|
||||
};
|
||||
|
||||
int wcd938x_swr_get_current_bank(struct sdw_slave *sdev)
|
||||
{
|
||||
int bank;
|
||||
|
||||
bank = sdw_read(sdev, SDW_SCP_CTRL);
|
||||
|
||||
return ((bank & 0x40) ? 1 : 0);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(wcd938x_swr_get_current_bank);
|
||||
|
||||
int wcd938x_sdw_hw_params(struct wcd938x_sdw_priv *wcd,
|
||||
struct snd_pcm_substream *substream,
|
||||
struct snd_pcm_hw_params *params,
|
||||
|
|
|
|||
|
|
@ -1094,8 +1094,7 @@ static int wcd938x_tx_swr_ctrl(struct snd_soc_dapm_widget *w,
|
|||
int bank;
|
||||
int rate;
|
||||
|
||||
bank = (wcd938x_swr_get_current_bank(wcd938x->sdw_priv[AIF1_CAP]->sdev)) ? 0 : 1;
|
||||
bank = bank ? 0 : 1;
|
||||
bank = sdw_slave_get_current_bank(wcd938x->sdw_priv[AIF1_CAP]->sdev);
|
||||
|
||||
switch (event) {
|
||||
case SND_SOC_DAPM_PRE_PMU:
|
||||
|
|
|
|||
|
|
@ -669,9 +669,6 @@ int wcd938x_sdw_hw_params(struct wcd938x_sdw_priv *wcd,
|
|||
struct snd_pcm_substream *substream,
|
||||
struct snd_pcm_hw_params *params,
|
||||
struct snd_soc_dai *dai);
|
||||
|
||||
int wcd938x_swr_get_current_bank(struct sdw_slave *sdev);
|
||||
|
||||
#else
|
||||
|
||||
static inline int wcd938x_sdw_free(struct wcd938x_sdw_priv *wcd,
|
||||
|
|
@ -696,9 +693,5 @@ static inline int wcd938x_sdw_hw_params(struct wcd938x_sdw_priv *wcd,
|
|||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
static inline int wcd938x_swr_get_current_bank(struct sdw_slave *sdev)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif /* CONFIG_SND_SOC_WCD938X_SDW */
|
||||
#endif /* __WCD938X_H__ */
|
||||
|
|
|
|||
|
|
@ -128,13 +128,6 @@ static struct sdw_dpn_prop wcd939x_tx_dpn_prop[WCD939X_MAX_TX_SWR_PORTS] = {
|
|||
}
|
||||
};
|
||||
|
||||
unsigned int wcd939x_swr_get_current_bank(struct sdw_slave *sdev)
|
||||
{
|
||||
return FIELD_GET(SDW_SCP_STAT_CURR_BANK,
|
||||
sdw_read(sdev, SDW_SCP_CTRL));
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(wcd939x_swr_get_current_bank);
|
||||
|
||||
int wcd939x_sdw_hw_params(struct wcd939x_sdw_priv *wcd,
|
||||
struct snd_pcm_substream *substream,
|
||||
struct snd_pcm_hw_params *params,
|
||||
|
|
|
|||
|
|
@ -1017,7 +1017,7 @@ static int wcd939x_tx_swr_ctrl(struct snd_soc_dapm_widget *w,
|
|||
int bank;
|
||||
int rate;
|
||||
|
||||
bank = wcd939x_swr_get_current_bank(wcd939x->sdw_priv[AIF1_CAP]->sdev);
|
||||
bank = sdw_slave_get_current_bank(wcd939x->sdw_priv[AIF1_CAP]->sdev);
|
||||
|
||||
switch (event) {
|
||||
case SND_SOC_DAPM_PRE_PMU:
|
||||
|
|
|
|||
|
|
@ -930,8 +930,6 @@ int wcd939x_sdw_hw_params(struct wcd939x_sdw_priv *wcd,
|
|||
struct snd_pcm_hw_params *params,
|
||||
struct snd_soc_dai *dai);
|
||||
|
||||
unsigned int wcd939x_swr_get_current_bank(struct sdw_slave *sdev);
|
||||
|
||||
struct regmap *wcd939x_swr_get_regmap(struct wcd939x_sdw_priv *wcd);
|
||||
#else
|
||||
|
||||
|
|
@ -957,11 +955,6 @@ static inline int wcd939x_sdw_hw_params(struct wcd939x_sdw_priv *wcd,
|
|||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
static inline unsigned int wcd939x_swr_get_current_bank(struct sdw_slave *sdev)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct regmap *wcd939x_swr_get_regmap(struct wcd939x_sdw_priv *wcd)
|
||||
{
|
||||
return PTR_ERR(-EINVAL);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user