[PATCH 00/17] ASoC: remove snd_soc_dai_set_tristate()
Hi Mark
snd_soc_dai_set_tristate() has added in v2.6.27 (2008/Oct) by this commit
8c6529dbf881303920a415c2d14a500218661949 ("ALSA: asoc: core - add Digital Audio Interface (DAI) control functions.")
But it has never been used during this 16 years. Let's remove it.
Kuninori Morimoto (17): ASoC: pxa: remove snd_soc_dai_set_tristate() ASoC: codecs: cs35l32: remove snd_soc_dai_set_tristate() ASoC: codecs: cs35l33: remove snd_soc_dai_set_tristate() ASoC: codecs: cs35l34: remove snd_soc_dai_set_tristate() ASoC: codecs: cs42l73: remove snd_soc_dai_set_tristate() ASoC: codecs: cs53l30: remove snd_soc_dai_set_tristate() ASoC: codecs: wm8961: remove snd_soc_dai_set_tristate() ASoC: codecs: wm8994: remove snd_soc_dai_set_tristate() ASoC: codecs: wm8995: remove snd_soc_dai_set_tristate() ASoC: codecs: wm9713: remove snd_soc_dai_set_tristate() ASoC: codecs: adau1372: remove snd_soc_dai_set_tristate() ASoC: codecs: adau1977: remove snd_soc_dai_set_tristate() ASoC: codecs: adau7118: remove snd_soc_dai_set_tristate() ASoC: codecs: madera: remove snd_soc_dai_set_tristate() ASoC: codecs: arizona: remove snd_soc_dai_set_tristate() ASoC: codecs: twl4030: remove snd_soc_dai_set_tristate() ASoC: remove snd_soc_dai_set_tristate()
include/sound/soc-dai.h | 3 --- sound/soc/codecs/adau1372.c | 14 -------------- sound/soc/codecs/adau1977.c | 15 --------------- sound/soc/codecs/adau7118.c | 19 ------------------- sound/soc/codecs/arizona.c | 17 ----------------- sound/soc/codecs/cs35l32.c | 9 --------- sound/soc/codecs/cs35l33.c | 21 --------------------- sound/soc/codecs/cs35l34.c | 15 --------------- sound/soc/codecs/cs42l73.c | 10 ---------- sound/soc/codecs/cs53l30.c | 10 ---------- sound/soc/codecs/madera.c | 22 ---------------------- sound/soc/codecs/twl4030.c | 28 ---------------------------- sound/soc/codecs/wm8961.c | 14 -------------- sound/soc/codecs/wm8994.c | 28 ---------------------------- sound/soc/codecs/wm8995.c | 33 --------------------------------- sound/soc/codecs/wm9713.c | 17 ----------------- sound/soc/pxa/pxa-ssp.c | 21 --------------------- sound/soc/soc-dai.c | 19 ------------------- 18 files changed, 315 deletions(-)
snd_soc_dai_set_tristate() has never been used before. Let's remove it.
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com --- sound/soc/pxa/pxa-ssp.c | 21 --------------------- 1 file changed, 21 deletions(-)
diff --git a/sound/soc/pxa/pxa-ssp.c b/sound/soc/pxa/pxa-ssp.c index b8a3cb8b75978..1abacb3994aef 100644 --- a/sound/soc/pxa/pxa-ssp.c +++ b/sound/soc/pxa/pxa-ssp.c @@ -347,26 +347,6 @@ static int pxa_ssp_set_dai_tdm_slot(struct snd_soc_dai *cpu_dai, return 0; }
-/* - * Tristate the SSP DAI lines - */ -static int pxa_ssp_set_dai_tristate(struct snd_soc_dai *cpu_dai, - int tristate) -{ - struct ssp_priv *priv = snd_soc_dai_get_drvdata(cpu_dai); - struct ssp_device *ssp = priv->ssp; - u32 sscr1; - - sscr1 = pxa_ssp_read_reg(ssp, SSCR1); - if (tristate) - sscr1 &= ~SSCR1_TTE; - else - sscr1 |= SSCR1_TTE; - pxa_ssp_write_reg(ssp, SSCR1, sscr1); - - return 0; -} - static int pxa_ssp_set_dai_fmt(struct snd_soc_dai *cpu_dai, unsigned int fmt) { @@ -822,7 +802,6 @@ static const struct snd_soc_dai_ops pxa_ssp_dai_ops = { .set_sysclk = pxa_ssp_set_dai_sysclk, .set_fmt = pxa_ssp_set_dai_fmt, .set_tdm_slot = pxa_ssp_set_dai_tdm_slot, - .set_tristate = pxa_ssp_set_dai_tristate, };
static struct snd_soc_dai_driver pxa_ssp_dai = {
snd_soc_dai_set_tristate() has never been used before. Let's remove it.
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com --- sound/soc/codecs/cs35l32.c | 9 --------- 1 file changed, 9 deletions(-)
diff --git a/sound/soc/codecs/cs35l32.c b/sound/soc/codecs/cs35l32.c index 96555263e10b8..cc9decb593b54 100644 --- a/sound/soc/codecs/cs35l32.c +++ b/sound/soc/codecs/cs35l32.c @@ -169,17 +169,8 @@ static int cs35l32_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) return 0; }
-static int cs35l32_set_tristate(struct snd_soc_dai *dai, int tristate) -{ - struct snd_soc_component *component = dai->component; - - return snd_soc_component_update_bits(component, CS35L32_PWRCTL2, - CS35L32_SDOUT_3ST, tristate << 3); -} - static const struct snd_soc_dai_ops cs35l32_ops = { .set_fmt = cs35l32_set_dai_fmt, - .set_tristate = cs35l32_set_tristate, };
static struct snd_soc_dai_driver cs35l32_dai[] = {
snd_soc_dai_set_tristate() has never been used before. Let's remove it.
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com --- sound/soc/codecs/cs35l33.c | 21 --------------------- 1 file changed, 21 deletions(-)
diff --git a/sound/soc/codecs/cs35l33.c b/sound/soc/codecs/cs35l33.c index b03aab147530c..ec1de0225eed8 100644 --- a/sound/soc/codecs/cs35l33.c +++ b/sound/soc/codecs/cs35l33.c @@ -523,26 +523,6 @@ static int cs35l33_pcm_startup(struct snd_pcm_substream *substream, return 0; }
-static int cs35l33_set_tristate(struct snd_soc_dai *dai, int tristate) -{ - struct snd_soc_component *component = dai->component; - struct cs35l33_private *priv = snd_soc_component_get_drvdata(component); - - if (tristate) { - regmap_update_bits(priv->regmap, CS35L33_PWRCTL2, - CS35L33_SDOUT_3ST_I2S, CS35L33_SDOUT_3ST_I2S); - regmap_update_bits(priv->regmap, CS35L33_CLK_CTL, - CS35L33_SDOUT_3ST_TDM, CS35L33_SDOUT_3ST_TDM); - } else { - regmap_update_bits(priv->regmap, CS35L33_PWRCTL2, - CS35L33_SDOUT_3ST_I2S, 0); - regmap_update_bits(priv->regmap, CS35L33_CLK_CTL, - CS35L33_SDOUT_3ST_TDM, 0); - } - - return 0; -} - static int cs35l33_set_tdm_slot(struct snd_soc_dai *dai, unsigned int tx_mask, unsigned int rx_mask, int slots, int slot_width) { @@ -664,7 +644,6 @@ static int cs35l33_component_set_sysclk(struct snd_soc_component *component,
static const struct snd_soc_dai_ops cs35l33_ops = { .startup = cs35l33_pcm_startup, - .set_tristate = cs35l33_set_tristate, .set_fmt = cs35l33_set_dai_fmt, .hw_params = cs35l33_pcm_hw_params, .set_tdm_slot = cs35l33_set_tdm_slot,
snd_soc_dai_set_tristate() has never been used before. Let's remove it.
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com --- sound/soc/codecs/cs35l34.c | 15 --------------- 1 file changed, 15 deletions(-)
diff --git a/sound/soc/codecs/cs35l34.c b/sound/soc/codecs/cs35l34.c index 287b27476a109..e2eab209538d0 100644 --- a/sound/soc/codecs/cs35l34.c +++ b/sound/soc/codecs/cs35l34.c @@ -562,20 +562,6 @@ static int cs35l34_pcm_hw_params(struct snd_pcm_substream *substream, return ret; }
-static int cs35l34_set_tristate(struct snd_soc_dai *dai, int tristate) -{ - - struct snd_soc_component *component = dai->component; - - if (tristate) - snd_soc_component_update_bits(component, CS35L34_PWRCTL3, - CS35L34_PDN_SDOUT, CS35L34_PDN_SDOUT); - else - snd_soc_component_update_bits(component, CS35L34_PWRCTL3, - CS35L34_PDN_SDOUT, 0); - return 0; -} - static int cs35l34_dai_set_sysclk(struct snd_soc_dai *dai, int clk_id, unsigned int freq, int dir) { @@ -619,7 +605,6 @@ static int cs35l34_dai_set_sysclk(struct snd_soc_dai *dai, }
static const struct snd_soc_dai_ops cs35l34_ops = { - .set_tristate = cs35l34_set_tristate, .set_fmt = cs35l34_set_dai_fmt, .hw_params = cs35l34_pcm_hw_params, .set_sysclk = cs35l34_dai_set_sysclk,
snd_soc_dai_set_tristate() has never been used before. Let's remove it.
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com --- sound/soc/codecs/cs42l73.c | 10 ---------- 1 file changed, 10 deletions(-)
diff --git a/sound/soc/codecs/cs42l73.c b/sound/soc/codecs/cs42l73.c index 21ba796a5cd93..23d5dc912e279 100644 --- a/sound/soc/codecs/cs42l73.c +++ b/sound/soc/codecs/cs42l73.c @@ -1128,15 +1128,6 @@ static int cs42l73_set_bias_level(struct snd_soc_component *component, return 0; }
-static int cs42l73_set_tristate(struct snd_soc_dai *dai, int tristate) -{ - struct snd_soc_component *component = dai->component; - int id = dai->id; - - return snd_soc_component_update_bits(component, CS42L73_SPC(id), CS42L73_SP_3ST, - tristate << 7); -} - static const struct snd_pcm_hw_constraint_list constraints_12_24 = { .count = ARRAY_SIZE(cs42l73_asrc_rates), .list = cs42l73_asrc_rates, @@ -1160,7 +1151,6 @@ static const struct snd_soc_dai_ops cs42l73_ops = { .hw_params = cs42l73_pcm_hw_params, .set_fmt = cs42l73_set_dai_fmt, .set_sysclk = cs42l73_set_sysclk, - .set_tristate = cs42l73_set_tristate, };
static struct snd_soc_dai_driver cs42l73_dai[] = {
snd_soc_dai_set_tristate() has never been used before. Let's remove it.
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com --- sound/soc/codecs/cs53l30.c | 10 ---------- 1 file changed, 10 deletions(-)
diff --git a/sound/soc/codecs/cs53l30.c b/sound/soc/codecs/cs53l30.c index 28f4be37dec19..f436862dc5c60 100644 --- a/sound/soc/codecs/cs53l30.c +++ b/sound/soc/codecs/cs53l30.c @@ -730,15 +730,6 @@ static int cs53l30_set_bias_level(struct snd_soc_component *component, return 0; }
-static int cs53l30_set_tristate(struct snd_soc_dai *dai, int tristate) -{ - struct cs53l30_private *priv = snd_soc_component_get_drvdata(dai->component); - u8 val = tristate ? CS53L30_ASP_3ST : 0; - - return regmap_update_bits(priv->regmap, CS53L30_ASP_CTL1, - CS53L30_ASP_3ST_MASK, val); -} - /* * Note: CS53L30 counts the slot number per byte while ASoC counts the slot * number per slot_width. So there is a difference between the slots of ASoC @@ -836,7 +827,6 @@ static const struct snd_soc_dai_ops cs53l30_ops = { .hw_params = cs53l30_pcm_hw_params, .set_fmt = cs53l30_set_dai_fmt, .set_sysclk = cs53l30_set_sysclk, - .set_tristate = cs53l30_set_tristate, .set_tdm_slot = cs53l30_set_dai_tdm_slot, .mute_stream = cs53l30_mute_stream, };
snd_soc_dai_set_tristate() has never been used before. Let's remove it.
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com --- sound/soc/codecs/wm8961.c | 14 -------------- 1 file changed, 14 deletions(-)
diff --git a/sound/soc/codecs/wm8961.c b/sound/soc/codecs/wm8961.c index d1c731e25777b..13078796c4e28 100644 --- a/sound/soc/codecs/wm8961.c +++ b/sound/soc/codecs/wm8961.c @@ -685,19 +685,6 @@ static int wm8961_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) return snd_soc_component_write(component, WM8961_AUDIO_INTERFACE_0, aif); }
-static int wm8961_set_tristate(struct snd_soc_dai *dai, int tristate) -{ - struct snd_soc_component *component = dai->component; - u16 reg = snd_soc_component_read(component, WM8961_ADDITIONAL_CONTROL_2); - - if (tristate) - reg |= WM8961_TRIS; - else - reg &= ~WM8961_TRIS; - - return snd_soc_component_write(component, WM8961_ADDITIONAL_CONTROL_2, reg); -} - static int wm8961_mute(struct snd_soc_dai *dai, int mute, int direction) { struct snd_soc_component *component = dai->component; @@ -807,7 +794,6 @@ static const struct snd_soc_dai_ops wm8961_dai_ops = { .set_sysclk = wm8961_set_sysclk, .set_fmt = wm8961_set_fmt, .mute_stream = wm8961_mute, - .set_tristate = wm8961_set_tristate, .set_clkdiv = wm8961_set_clkdiv, .no_capture_mute = 1, };
snd_soc_dai_set_tristate() has never been used before. Let's remove it.
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com --- sound/soc/codecs/wm8994.c | 28 ---------------------------- 1 file changed, 28 deletions(-)
diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c index a4abe6e53bfc5..20a3cad66fc8d 100644 --- a/sound/soc/codecs/wm8994.c +++ b/sound/soc/codecs/wm8994.c @@ -3158,32 +3158,6 @@ static int wm8994_aif_mute(struct snd_soc_dai *codec_dai, int mute, return 0; }
-static int wm8994_set_tristate(struct snd_soc_dai *codec_dai, int tristate) -{ - struct snd_soc_component *component = codec_dai->component; - int reg, val, mask; - - switch (codec_dai->id) { - case 1: - reg = WM8994_AIF1_MASTER_SLAVE; - mask = WM8994_AIF1_TRI; - break; - case 2: - reg = WM8994_AIF2_MASTER_SLAVE; - mask = WM8994_AIF2_TRI; - break; - default: - return -EINVAL; - } - - if (tristate) - val = mask; - else - val = 0; - - return snd_soc_component_update_bits(component, reg, mask, val); -} - static int wm8994_aif2_probe(struct snd_soc_dai *dai) { struct snd_soc_component *component = dai->component; @@ -3210,7 +3184,6 @@ static const struct snd_soc_dai_ops wm8994_aif1_dai_ops = { .hw_params = wm8994_hw_params, .mute_stream = wm8994_aif_mute, .set_pll = wm8994_set_fll, - .set_tristate = wm8994_set_tristate, .no_capture_mute = 1, };
@@ -3221,7 +3194,6 @@ static const struct snd_soc_dai_ops wm8994_aif2_dai_ops = { .hw_params = wm8994_hw_params, .mute_stream = wm8994_aif_mute, .set_pll = wm8994_set_fll, - .set_tristate = wm8994_set_tristate, .no_capture_mute = 1, };
snd_soc_dai_set_tristate() has never been used before. Let's remove it.
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com --- sound/soc/codecs/wm8995.c | 33 --------------------------------- 1 file changed, 33 deletions(-)
diff --git a/sound/soc/codecs/wm8995.c b/sound/soc/codecs/wm8995.c index 1f9a9b6369350..c324cc5ea9416 100644 --- a/sound/soc/codecs/wm8995.c +++ b/sound/soc/codecs/wm8995.c @@ -1678,36 +1678,6 @@ static int wm8995_hw_params(struct snd_pcm_substream *substream, return 0; }
-static int wm8995_set_tristate(struct snd_soc_dai *codec_dai, int tristate) -{ - struct snd_soc_component *component = codec_dai->component; - int reg, val, mask; - - switch (codec_dai->id) { - case 0: - reg = WM8995_AIF1_MASTER_SLAVE; - mask = WM8995_AIF1_TRI; - break; - case 1: - reg = WM8995_AIF2_MASTER_SLAVE; - mask = WM8995_AIF2_TRI; - break; - case 2: - reg = WM8995_POWER_MANAGEMENT_5; - mask = WM8995_AIF3_TRI; - break; - default: - return -EINVAL; - } - - if (tristate) - val = mask; - else - val = 0; - - return snd_soc_component_update_bits(component, reg, mask, val); -} - /* The size in bits of the FLL divide multiplied by 10 * to allow rounding later */ #define FIXED_FLL_SIZE ((1 << 16) * 10) @@ -2096,7 +2066,6 @@ static const struct snd_soc_dai_ops wm8995_aif1_dai_ops = { .hw_params = wm8995_hw_params, .mute_stream = wm8995_aif_mute, .set_pll = wm8995_set_fll, - .set_tristate = wm8995_set_tristate, .no_capture_mute = 1, };
@@ -2106,12 +2075,10 @@ static const struct snd_soc_dai_ops wm8995_aif2_dai_ops = { .hw_params = wm8995_hw_params, .mute_stream = wm8995_aif_mute, .set_pll = wm8995_set_fll, - .set_tristate = wm8995_set_tristate, .no_capture_mute = 1, };
static const struct snd_soc_dai_ops wm8995_aif3_dai_ops = { - .set_tristate = wm8995_set_tristate, };
static struct snd_soc_dai_driver wm8995_dai[] = {
snd_soc_dai_set_tristate() has never been used before. Let's remove it.
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com --- sound/soc/codecs/wm9713.c | 17 ----------------- 1 file changed, 17 deletions(-)
diff --git a/sound/soc/codecs/wm9713.c b/sound/soc/codecs/wm9713.c index 64b69316e4c70..51bdad7129d56 100644 --- a/sound/soc/codecs/wm9713.c +++ b/sound/soc/codecs/wm9713.c @@ -879,22 +879,6 @@ static int wm9713_set_dai_pll(struct snd_soc_dai *codec_dai, int pll_id, return wm9713_set_pll(component, pll_id, freq_in, freq_out); }
-/* - * Tristate the PCM DAI lines, tristate can be disabled by calling - * wm9713_set_dai_fmt() - */ -static int wm9713_set_dai_tristate(struct snd_soc_dai *codec_dai, - int tristate) -{ - struct snd_soc_component *component = codec_dai->component; - - if (tristate) - snd_soc_component_update_bits(component, AC97_CENTER_LFE_MASTER, - 0x6000, 0x0000); - - return 0; -} - /* * Configure WM9713 clock dividers. * Voice DAC needs 256 FS @@ -1089,7 +1073,6 @@ static const struct snd_soc_dai_ops wm9713_dai_ops_voice = { .set_clkdiv = wm9713_set_dai_clkdiv, .set_pll = wm9713_set_dai_pll, .set_fmt = wm9713_set_dai_fmt, - .set_tristate = wm9713_set_dai_tristate, };
static struct snd_soc_dai_driver wm9713_dai[] = {
snd_soc_dai_set_tristate() has never been used before. Let's remove it.
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com --- sound/soc/codecs/adau1372.c | 14 -------------- 1 file changed, 14 deletions(-)
diff --git a/sound/soc/codecs/adau1372.c b/sound/soc/codecs/adau1372.c index fdee689cae538..9db37f12c87ef 100644 --- a/sound/soc/codecs/adau1372.c +++ b/sound/soc/codecs/adau1372.c @@ -739,19 +739,6 @@ static int adau1372_set_tdm_slot(struct snd_soc_dai *dai, unsigned int tx_mask, return 0; }
-static int adau1372_set_tristate(struct snd_soc_dai *dai, int tristate) -{ - struct adau1372 *adau1372 = snd_soc_dai_get_drvdata(dai); - unsigned int sai1; - - if (tristate) - sai1 = ADAU1372_SAI1_TDM_TS; - else - sai1 = 0; - - return regmap_update_bits(adau1372->regmap, ADAU1372_REG_SAI1, ADAU1372_SAI1_TDM_TS, sai1); -} - static int adau1372_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct adau1372 *adau1372 = snd_soc_dai_get_drvdata(dai); @@ -866,7 +853,6 @@ static const struct snd_soc_component_driver adau1372_driver = { static const struct snd_soc_dai_ops adau1372_dai_ops = { .set_fmt = adau1372_set_dai_fmt, .set_tdm_slot = adau1372_set_tdm_slot, - .set_tristate = adau1372_set_tristate, .hw_params = adau1372_hw_params, .startup = adau1372_startup, };
snd_soc_dai_set_tristate() has never been used before. Let's remove it.
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com --- sound/soc/codecs/adau1977.c | 15 --------------- 1 file changed, 15 deletions(-)
diff --git a/sound/soc/codecs/adau1977.c b/sound/soc/codecs/adau1977.c index ae59efb38f265..9e57fdc0f7ec6 100644 --- a/sound/soc/codecs/adau1977.c +++ b/sound/soc/codecs/adau1977.c @@ -726,27 +726,12 @@ static int adau1977_startup(struct snd_pcm_substream *substream, return 0; }
-static int adau1977_set_tristate(struct snd_soc_dai *dai, int tristate) -{ - struct adau1977 *adau1977 = snd_soc_component_get_drvdata(dai->component); - unsigned int val; - - if (tristate) - val = ADAU1977_SAI_OVERTEMP_DRV_HIZ; - else - val = 0; - - return regmap_update_bits(adau1977->regmap, ADAU1977_REG_SAI_OVERTEMP, - ADAU1977_SAI_OVERTEMP_DRV_HIZ, val); -} - static const struct snd_soc_dai_ops adau1977_dai_ops = { .startup = adau1977_startup, .hw_params = adau1977_hw_params, .mute_stream = adau1977_mute, .set_fmt = adau1977_set_dai_fmt, .set_tdm_slot = adau1977_set_tdm_slot, - .set_tristate = adau1977_set_tristate, };
static struct snd_soc_dai_driver adau1977_dai = {
snd_soc_dai_set_tristate() has never been used before. Let's remove it.
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com --- sound/soc/codecs/adau7118.c | 19 ------------------- 1 file changed, 19 deletions(-)
diff --git a/sound/soc/codecs/adau7118.c b/sound/soc/codecs/adau7118.c index abc4764697a53..df513bc49dd3e 100644 --- a/sound/soc/codecs/adau7118.c +++ b/sound/soc/codecs/adau7118.c @@ -207,24 +207,6 @@ static int adau7118_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) return 0; }
-static int adau7118_set_tristate(struct snd_soc_dai *dai, int tristate) -{ - struct adau7118_data *st = - snd_soc_component_get_drvdata(dai->component); - int ret; - - dev_dbg(st->dev, "Set tristate, %d\n", tristate); - - ret = snd_soc_component_update_bits(dai->component, - ADAU7118_REG_SPT_CTRL1, - ADAU7118_TRISTATE_MASK, - ADAU7118_TRISTATE(tristate)); - if (ret < 0) - return ret; - - return 0; -} - static int adau7118_set_tdm_slot(struct snd_soc_dai *dai, unsigned int tx_mask, unsigned int rx_mask, int slots, int slot_width) @@ -418,7 +400,6 @@ static const struct snd_soc_dai_ops adau7118_ops = { .set_channel_map = adau7118_set_channel_map, .set_fmt = adau7118_set_fmt, .set_tdm_slot = adau7118_set_tdm_slot, - .set_tristate = adau7118_set_tristate, };
static struct snd_soc_dai_driver adau7118_dai = {
snd_soc_dai_set_tristate() has never been used before. Let's remove it.
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com --- sound/soc/codecs/madera.c | 22 ---------------------- 1 file changed, 22 deletions(-)
diff --git a/sound/soc/codecs/madera.c b/sound/soc/codecs/madera.c index b24d6472ad5fc..92457b4a908bc 100644 --- a/sound/soc/codecs/madera.c +++ b/sound/soc/codecs/madera.c @@ -3285,27 +3285,6 @@ static int madera_dai_set_sysclk(struct snd_soc_dai *dai, return snd_soc_dapm_sync(dapm); }
-static int madera_set_tristate(struct snd_soc_dai *dai, int tristate) -{ - struct snd_soc_component *component = dai->component; - int base = dai->driver->base; - unsigned int reg; - int ret; - - if (tristate) - reg = MADERA_AIF1_TRI; - else - reg = 0; - - ret = snd_soc_component_update_bits(component, - base + MADERA_AIF_RATE_CTRL, - MADERA_AIF1_TRI, reg); - if (ret < 0) - return ret; - else - return 0; -} - static void madera_set_channels_to_mask(struct snd_soc_dai *dai, unsigned int base, int channels, unsigned int mask) @@ -3364,7 +3343,6 @@ const struct snd_soc_dai_ops madera_dai_ops = { .set_tdm_slot = &madera_set_tdm_slot, .hw_params = &madera_hw_params, .set_sysclk = &madera_dai_set_sysclk, - .set_tristate = &madera_set_tristate, }; EXPORT_SYMBOL_GPL(madera_dai_ops);
snd_soc_dai_set_tristate() has never been used before. Let's remove it.
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com --- sound/soc/codecs/arizona.c | 17 ----------------- 1 file changed, 17 deletions(-)
diff --git a/sound/soc/codecs/arizona.c b/sound/soc/codecs/arizona.c index 402b9a2ff0240..4aa31bc5de504 100644 --- a/sound/soc/codecs/arizona.c +++ b/sound/soc/codecs/arizona.c @@ -1953,22 +1953,6 @@ static int arizona_dai_set_sysclk(struct snd_soc_dai *dai, return snd_soc_dapm_sync(dapm); }
-static int arizona_set_tristate(struct snd_soc_dai *dai, int tristate) -{ - struct snd_soc_component *component = dai->component; - int base = dai->driver->base; - unsigned int reg; - - if (tristate) - reg = ARIZONA_AIF1_TRI; - else - reg = 0; - - return snd_soc_component_update_bits(component, - base + ARIZONA_AIF_RATE_CTRL, - ARIZONA_AIF1_TRI, reg); -} - static void arizona_set_channels_to_mask(struct snd_soc_dai *dai, unsigned int base, int channels, unsigned int mask) @@ -2028,7 +2012,6 @@ const struct snd_soc_dai_ops arizona_dai_ops = { .set_tdm_slot = arizona_set_tdm_slot, .hw_params = arizona_hw_params, .set_sysclk = arizona_dai_set_sysclk, - .set_tristate = arizona_set_tristate, }; EXPORT_SYMBOL_GPL(arizona_dai_ops);
snd_soc_dai_set_tristate() has never been used before. Let's remove it.
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com --- sound/soc/codecs/twl4030.c | 28 ---------------------------- 1 file changed, 28 deletions(-)
diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c index e3782762139f6..28ab6540d3400 100644 --- a/sound/soc/codecs/twl4030.c +++ b/sound/soc/codecs/twl4030.c @@ -1891,19 +1891,6 @@ static int twl4030_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) return 0; }
-static int twl4030_set_tristate(struct snd_soc_dai *dai, int tristate) -{ - struct snd_soc_component *component = dai->component; - u8 reg = twl4030_read(component, TWL4030_REG_AUDIO_IF); - - if (tristate) - reg |= TWL4030_AIF_TRI_EN; - else - reg &= ~TWL4030_AIF_TRI_EN; - - return twl4030_write(component, TWL4030_REG_AUDIO_IF, reg); -} - /* In case of voice mode, the RX1 L(VRX) for downlink and the TX2 L/R * (VTXL, VTXR) for uplink has to be enabled/disabled. */ static void twl4030_voice_enable(struct snd_soc_component *component, int direction, @@ -2085,19 +2072,6 @@ static int twl4030_voice_set_dai_fmt(struct snd_soc_dai *codec_dai, return 0; }
-static int twl4030_voice_set_tristate(struct snd_soc_dai *dai, int tristate) -{ - struct snd_soc_component *component = dai->component; - u8 reg = twl4030_read(component, TWL4030_REG_VOICE_IF); - - if (tristate) - reg |= TWL4030_VIF_TRI_EN; - else - reg &= ~TWL4030_VIF_TRI_EN; - - return twl4030_write(component, TWL4030_REG_VOICE_IF, reg); -} - #define TWL4030_RATES (SNDRV_PCM_RATE_8000_48000) #define TWL4030_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S32_LE)
@@ -2107,7 +2081,6 @@ static const struct snd_soc_dai_ops twl4030_dai_hifi_ops = { .hw_params = twl4030_hw_params, .set_sysclk = twl4030_set_dai_sysclk, .set_fmt = twl4030_set_dai_fmt, - .set_tristate = twl4030_set_tristate, };
static const struct snd_soc_dai_ops twl4030_dai_voice_ops = { @@ -2116,7 +2089,6 @@ static const struct snd_soc_dai_ops twl4030_dai_voice_ops = { .hw_params = twl4030_voice_hw_params, .set_sysclk = twl4030_voice_set_dai_sysclk, .set_fmt = twl4030_voice_set_dai_fmt, - .set_tristate = twl4030_voice_set_tristate, };
static struct snd_soc_dai_driver twl4030_dai[] = {
snd_soc_dai_set_tristate() has never been used before. Let's remove it.
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com --- include/sound/soc-dai.h | 3 --- sound/soc/soc-dai.c | 19 ------------------- 2 files changed, 22 deletions(-)
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h index aab57c19f62b2..eeadb636c9f64 100644 --- a/include/sound/soc-dai.h +++ b/include/sound/soc-dai.h @@ -191,8 +191,6 @@ int snd_soc_dai_set_channel_map(struct snd_soc_dai *dai, unsigned int tx_num, const unsigned int *tx_slot, unsigned int rx_num, const unsigned int *rx_slot);
-int snd_soc_dai_set_tristate(struct snd_soc_dai *dai, int tristate); - /* Digital Audio Interface mute */ int snd_soc_dai_digital_mute(struct snd_soc_dai *dai, int mute, int direction); @@ -306,7 +304,6 @@ struct snd_soc_dai_ops { int (*get_channel_map)(const struct snd_soc_dai *dai, unsigned int *tx_num, unsigned int *tx_slot, unsigned int *rx_num, unsigned int *rx_slot); - int (*set_tristate)(struct snd_soc_dai *dai, int tristate);
int (*set_stream)(struct snd_soc_dai *dai, void *stream, int direction); diff --git a/sound/soc/soc-dai.c b/sound/soc/soc-dai.c index 34ba1a93a4c95..e42b99f12f0b3 100644 --- a/sound/soc/soc-dai.c +++ b/sound/soc/soc-dai.c @@ -341,25 +341,6 @@ int snd_soc_dai_get_channel_map(const struct snd_soc_dai *dai, } EXPORT_SYMBOL_GPL(snd_soc_dai_get_channel_map);
-/** - * snd_soc_dai_set_tristate - configure DAI system or master clock. - * @dai: DAI - * @tristate: tristate enable - * - * Tristates the DAI so that others can use it. - */ -int snd_soc_dai_set_tristate(struct snd_soc_dai *dai, int tristate) -{ - int ret = -EINVAL; - - if (dai->driver->ops && - dai->driver->ops->set_tristate) - ret = dai->driver->ops->set_tristate(dai, tristate); - - return soc_dai_ret(dai, ret); -} -EXPORT_SYMBOL_GPL(snd_soc_dai_set_tristate); - /** * snd_soc_dai_digital_mute - configure DAI system or master clock. * @dai: DAI
On Mon, Dec 09, 2024 at 07:38:52AM +0000, Kuninori Morimoto wrote:
Hi Mark
snd_soc_dai_set_tristate() has added in v2.6.27 (2008/Oct) by this commit
8c6529dbf881303920a415c2d14a500218661949 ("ALSA: asoc: core - add Digital Audio Interface (DAI) control functions.")
But it has never been used during this 16 years. Let's remove it.
We have definitely used it in out of tree code for some phones in our times. Whilst I don't feel super strongly, I would say it seems like fairly reasonable functionality and it does no harm, so I would vote to keep it.
Thanks, Charles
On 09/12/2024 9:52 am, Charles Keepax wrote:
On Mon, Dec 09, 2024 at 07:38:52AM +0000, Kuninori Morimoto wrote:
Hi Mark
snd_soc_dai_set_tristate() has added in v2.6.27 (2008/Oct) by this commit
8c6529dbf881303920a415c2d14a500218661949 ("ALSA: asoc: core - add Digital Audio Interface (DAI) control functions.")
But it has never been used during this 16 years. Let's remove it.
We have definitely used it in out of tree code for some phones in our times. Whilst I don't feel super strongly, I would say it seems like fairly reasonable functionality and it does no harm, so I would vote to keep it.
Thanks, Charles
Yes, I'd forgotten that this function even existed. Now I've been reminded of it, it's a useful function because our I2S/TDM DAIs have configurable tri-stating. If we remove the function the alternative of using a pinmux driver is a lot of overhead.
But the kerneldoc description is not very good:
"Tristates the DAI so that others can use it."
That makes it sound like it disables the DAI. Should it say "Set the DAI TX pin to be hi-impedance in TDM slots where it is not transmitting"?
Hi Charles
snd_soc_dai_set_tristate() has added in v2.6.27 (2008/Oct) by this commit
8c6529dbf881303920a415c2d14a500218661949 ("ALSA: asoc: core - add Digital Audio Interface (DAI) control functions.")
But it has never been used during this 16 years. Let's remove it.
We have definitely used it in out of tree code for some phones in our times. Whilst I don't feel super strongly, I would say it seems like fairly reasonable functionality and it does no harm, so I would vote to keep it.
Ah, out of tree... OK, I have no strong opinion if there is a user. let's keep it
Thank you for your help !!
Best regards --- Kuninori Morimoto
participants (3)
-
Charles Keepax
-
Kuninori Morimoto
-
Richard Fitzgerald