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

ASoC: mediatek: mt8186-mt6366: convert to snd_soc_dapm_xxx()

This patch converts below functions.

dapm->dev -> snd_soc_dapm_to_dev()
dapm->card -> snd_soc_dapm_to_card()
dapm->component -> snd_soc_dapm_to_component()

dapm_kcontrol_get_value() -> snd_soc_dapm_kcontrol_get_value()

snd_soc_component_enable_pin() -> snd_soc_dapm_enable_pin()
snd_soc_component_enable_pin_unlocked() -> snd_soc_dapm_enable_pin_unlocked()
snd_soc_component_disable_pin() -> snd_soc_dapm_disable_pin()
snd_soc_component_disable_pin_unlocked() -> snd_soc_dapm_disable_pin_unlocked()
snd_soc_component_nc_pin() -> snd_soc_dapm_nc_pin()
snd_soc_component_nc_pin_unlocked() -> snd_soc_dapm_nc_pin_unlocked()
snd_soc_component_get_pin_status() -> snd_soc_dapm_get_pin_status()
snd_soc_component_force_enable_pin() -> snd_soc_dapm_force_enable_pin()
snd_soc_component_force_enable_pin_unlocked() -> snd_soc_dapm_force_enable_pin_unlocked()
snd_soc_component_force_bias_level() -> snd_soc_dapm_force_bias_level()
snd_soc_component_get_bias_level() -> snd_soc_dapm_get_bias_level()
snd_soc_component_init_bias_level() -> snd_soc_dapm_init_bias_level()
snd_soc_component_get_dapm() -> snd_soc_component_to_dapm()

snd_soc_dapm_kcontrol_component() -> snd_soc_dapm_kcontrol_to_component()
snd_soc_dapm_kcontrol_widget() -> snd_soc_dapm_kcontrol_to_widget()
snd_soc_dapm_kcontrol_dapm() -> snd_soc_dapm_kcontrol_to_dapm()
snd_soc_dapm_np_pin() -> snd_soc_dapm_disable_pin()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/875xbhwgps.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Kuninori Morimoto and committed by
Mark Brown
771f522d aa851ed8

+10 -9
+10 -9
sound/soc/mediatek/mt8186/mt8186-mt6366.c
··· 88 88 static int dmic_get(struct snd_kcontrol *kcontrol, 89 89 struct snd_ctl_elem_value *ucontrol) 90 90 { 91 - struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_dapm(kcontrol); 92 - struct mtk_soc_card_data *soc_card_data = 93 - snd_soc_card_get_drvdata(dapm->card); 91 + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol); 92 + struct snd_soc_card *card = snd_soc_dapm_to_card(dapm); 93 + struct mtk_soc_card_data *soc_card_data = snd_soc_card_get_drvdata(card); 94 94 struct mt8186_mt6366_rt1019_rt5682s_priv *priv = soc_card_data->mach_priv; 95 95 96 96 ucontrol->value.integer.value[0] = priv->dmic_switch; ··· 100 100 static int dmic_set(struct snd_kcontrol *kcontrol, 101 101 struct snd_ctl_elem_value *ucontrol) 102 102 { 103 - struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_dapm(kcontrol); 104 - struct mtk_soc_card_data *soc_card_data = 105 - snd_soc_card_get_drvdata(dapm->card); 103 + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol); 104 + struct snd_soc_card *card = snd_soc_dapm_to_card(dapm); 105 + struct mtk_soc_card_data *soc_card_data = snd_soc_card_get_drvdata(card); 106 106 struct mt8186_mt6366_rt1019_rt5682s_priv *priv = soc_card_data->mach_priv; 107 107 108 108 priv->dmic_switch = ucontrol->value.integer.value[0]; 109 109 if (priv->dmic_sel) { 110 110 gpiod_set_value(priv->dmic_sel, priv->dmic_switch); 111 - dev_dbg(dapm->card->dev, "dmic_set_value %d\n", 111 + dev_dbg(card->dev, "dmic_set_value %d\n", 112 112 priv->dmic_switch); 113 113 } 114 114 return 0; ··· 140 140 static int primary_codec_init(struct snd_soc_pcm_runtime *rtd) 141 141 { 142 142 struct snd_soc_card *card = rtd->card; 143 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 143 144 struct mtk_soc_card_data *soc_card_data = snd_soc_card_get_drvdata(card); 144 145 struct mt8186_mt6366_rt1019_rt5682s_priv *priv = soc_card_data->mach_priv; 145 146 int ret; ··· 157 156 return 0; 158 157 } 159 158 160 - ret = snd_soc_dapm_new_controls(&card->dapm, dmic_widgets, 159 + ret = snd_soc_dapm_new_controls(dapm, dmic_widgets, 161 160 ARRAY_SIZE(dmic_widgets)); 162 161 if (ret) { 163 162 dev_err(card->dev, "DMic widget addition failed: %d\n", ret); ··· 165 164 return ret; 166 165 } 167 166 168 - ret = snd_soc_dapm_add_routes(&card->dapm, dmic_map, 167 + ret = snd_soc_dapm_add_routes(dapm, dmic_map, 169 168 ARRAY_SIZE(dmic_map)); 170 169 171 170 if (ret)