Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ASoC: mediatek: mt6358: Remove unused functions

The functions:
mt6358_mtkaif_calibration_disable()
mt6358_mtkaif_calibration_enable()
mt6358_set_mtkaif_calibration_phase()
were added in the 2019
commit 6a8d4198ca80 ("ASoC: mediatek: mt6358: add codec driver")

but never used.

Remove them.

This leaves mt6358_set_dcxo(), mt6358_set_clksq(),
mt6358_set_aud_global_bias(), also unused.

Remove them.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Link: https://patch.msgid.link/20250128005243.295977-1-linux@treblig.org
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Dr. David Alan Gilbert and committed by
Mark Brown
fb6ec1d2 a05143a8

-108
-104
sound/soc/codecs/mt6358.c
··· 162 162 0xf << 12, 0x0); 163 163 } 164 164 165 - /* use only when not govern by DAPM */ 166 - static int mt6358_set_dcxo(struct mt6358_priv *priv, bool enable) 167 - { 168 - regmap_update_bits(priv->regmap, MT6358_DCXO_CW14, 169 - 0x1 << RG_XO_AUDIO_EN_M_SFT, 170 - (enable ? 1 : 0) << RG_XO_AUDIO_EN_M_SFT); 171 - return 0; 172 - } 173 - 174 - /* use only when not govern by DAPM */ 175 - static int mt6358_set_clksq(struct mt6358_priv *priv, bool enable) 176 - { 177 - /* audio clk source from internal dcxo */ 178 - regmap_update_bits(priv->regmap, MT6358_AUDENC_ANA_CON6, 179 - RG_CLKSQ_IN_SEL_TEST_MASK_SFT, 180 - 0x0); 181 - 182 - /* Enable/disable CLKSQ 26MHz */ 183 - regmap_update_bits(priv->regmap, MT6358_AUDENC_ANA_CON6, 184 - RG_CLKSQ_EN_MASK_SFT, 185 - (enable ? 1 : 0) << RG_CLKSQ_EN_SFT); 186 - return 0; 187 - } 188 - 189 - /* use only when not govern by DAPM */ 190 - static int mt6358_set_aud_global_bias(struct mt6358_priv *priv, bool enable) 191 - { 192 - regmap_update_bits(priv->regmap, MT6358_AUDDEC_ANA_CON13, 193 - RG_AUDGLB_PWRDN_VA28_MASK_SFT, 194 - (enable ? 0 : 1) << RG_AUDGLB_PWRDN_VA28_SFT); 195 - return 0; 196 - } 197 - 198 - /* use only when not govern by DAPM */ 199 - static int mt6358_set_topck(struct mt6358_priv *priv, bool enable) 200 - { 201 - regmap_update_bits(priv->regmap, MT6358_AUD_TOP_CKPDN_CON0, 202 - 0x0066, enable ? 0x0 : 0x66); 203 - return 0; 204 - } 205 - 206 165 static int mt6358_mtkaif_tx_enable(struct mt6358_priv *priv) 207 166 { 208 167 switch (priv->mtkaif_protocol) { ··· 210 251 0xff00, 0x3000); 211 252 return 0; 212 253 } 213 - 214 - int mt6358_mtkaif_calibration_enable(struct snd_soc_component *cmpnt) 215 - { 216 - struct mt6358_priv *priv = snd_soc_component_get_drvdata(cmpnt); 217 - 218 - playback_gpio_set(priv); 219 - capture_gpio_set(priv); 220 - mt6358_mtkaif_tx_enable(priv); 221 - 222 - mt6358_set_dcxo(priv, true); 223 - mt6358_set_aud_global_bias(priv, true); 224 - mt6358_set_clksq(priv, true); 225 - mt6358_set_topck(priv, true); 226 - 227 - /* set dat_miso_loopback on */ 228 - regmap_update_bits(priv->regmap, MT6358_AUDIO_DIG_CFG, 229 - RG_AUD_PAD_TOP_DAT_MISO2_LOOPBACK_MASK_SFT, 230 - 1 << RG_AUD_PAD_TOP_DAT_MISO2_LOOPBACK_SFT); 231 - regmap_update_bits(priv->regmap, MT6358_AUDIO_DIG_CFG, 232 - RG_AUD_PAD_TOP_DAT_MISO_LOOPBACK_MASK_SFT, 233 - 1 << RG_AUD_PAD_TOP_DAT_MISO_LOOPBACK_SFT); 234 - return 0; 235 - } 236 - EXPORT_SYMBOL_GPL(mt6358_mtkaif_calibration_enable); 237 - 238 - int mt6358_mtkaif_calibration_disable(struct snd_soc_component *cmpnt) 239 - { 240 - struct mt6358_priv *priv = snd_soc_component_get_drvdata(cmpnt); 241 - 242 - /* set dat_miso_loopback off */ 243 - regmap_update_bits(priv->regmap, MT6358_AUDIO_DIG_CFG, 244 - RG_AUD_PAD_TOP_DAT_MISO2_LOOPBACK_MASK_SFT, 245 - 0 << RG_AUD_PAD_TOP_DAT_MISO2_LOOPBACK_SFT); 246 - regmap_update_bits(priv->regmap, MT6358_AUDIO_DIG_CFG, 247 - RG_AUD_PAD_TOP_DAT_MISO_LOOPBACK_MASK_SFT, 248 - 0 << RG_AUD_PAD_TOP_DAT_MISO_LOOPBACK_SFT); 249 - 250 - mt6358_set_topck(priv, false); 251 - mt6358_set_clksq(priv, false); 252 - mt6358_set_aud_global_bias(priv, false); 253 - mt6358_set_dcxo(priv, false); 254 - 255 - mt6358_mtkaif_tx_disable(priv); 256 - playback_gpio_reset(priv); 257 - capture_gpio_reset(priv); 258 - return 0; 259 - } 260 - EXPORT_SYMBOL_GPL(mt6358_mtkaif_calibration_disable); 261 - 262 - int mt6358_set_mtkaif_calibration_phase(struct snd_soc_component *cmpnt, 263 - int phase_1, int phase_2) 264 - { 265 - struct mt6358_priv *priv = snd_soc_component_get_drvdata(cmpnt); 266 - 267 - regmap_update_bits(priv->regmap, MT6358_AUDIO_DIG_CFG, 268 - RG_AUD_PAD_TOP_PHASE_MODE_MASK_SFT, 269 - phase_1 << RG_AUD_PAD_TOP_PHASE_MODE_SFT); 270 - regmap_update_bits(priv->regmap, MT6358_AUDIO_DIG_CFG, 271 - RG_AUD_PAD_TOP_PHASE_MODE2_MASK_SFT, 272 - phase_2 << RG_AUD_PAD_TOP_PHASE_MODE2_SFT); 273 - return 0; 274 - } 275 - EXPORT_SYMBOL_GPL(mt6358_set_mtkaif_calibration_phase); 276 254 277 255 /* dl pga gain */ 278 256 enum {
-4
sound/soc/codecs/mt6358.h
··· 2307 2307 /* set only during init */ 2308 2308 int mt6358_set_mtkaif_protocol(struct snd_soc_component *cmpnt, 2309 2309 int mtkaif_protocol); 2310 - int mt6358_mtkaif_calibration_enable(struct snd_soc_component *cmpnt); 2311 - int mt6358_mtkaif_calibration_disable(struct snd_soc_component *cmpnt); 2312 - int mt6358_set_mtkaif_calibration_phase(struct snd_soc_component *cmpnt, 2313 - int phase_1, int phase_2); 2314 2310 #endif /* __MT6358_H__ */