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

ASoC: ti: rx51: 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/87o6p9s8u8.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Kuninori Morimoto and committed by
Mark Brown
fefd4e0b c6995160

+10 -7
+10 -7
sound/soc/ti/rx51.c
··· 42 42 43 43 static void rx51_ext_control(struct snd_soc_dapm_context *dapm) 44 44 { 45 - struct snd_soc_card *card = dapm->card; 45 + struct snd_soc_card *card = snd_soc_dapm_to_card(dapm); 46 46 struct rx51_audio_pdata *pdata = snd_soc_card_get_drvdata(card); 47 47 int hp = 0, hs = 0, tvout = 0; 48 48 ··· 89 89 { 90 90 struct snd_pcm_runtime *runtime = substream->runtime; 91 91 struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); 92 - struct snd_soc_card *card = rtd->card; 92 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(rtd->card); 93 93 94 94 snd_pcm_hw_constraint_single(runtime, SNDRV_PCM_HW_PARAM_CHANNELS, 2); 95 - rx51_ext_control(&card->dapm); 95 + rx51_ext_control(dapm); 96 96 97 97 return 0; 98 98 } ··· 125 125 struct snd_ctl_elem_value *ucontrol) 126 126 { 127 127 struct snd_soc_card *card = snd_kcontrol_chip(kcontrol); 128 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 128 129 129 130 if (rx51_spk_func == ucontrol->value.enumerated.item[0]) 130 131 return 0; 131 132 132 133 rx51_spk_func = ucontrol->value.enumerated.item[0]; 133 - rx51_ext_control(&card->dapm); 134 + rx51_ext_control(dapm); 134 135 135 136 return 1; 136 137 } ··· 140 139 struct snd_kcontrol *k, int event) 141 140 { 142 141 struct snd_soc_dapm_context *dapm = w->dapm; 143 - struct snd_soc_card *card = dapm->card; 142 + struct snd_soc_card *card = snd_soc_dapm_to_card(dapm); 144 143 struct rx51_audio_pdata *pdata = snd_soc_card_get_drvdata(card); 145 144 146 145 gpiod_set_raw_value_cansleep(pdata->speaker_amp_gpio, ··· 161 160 struct snd_ctl_elem_value *ucontrol) 162 161 { 163 162 struct snd_soc_card *card = snd_kcontrol_chip(kcontrol); 163 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 164 164 165 165 if (rx51_dmic_func == ucontrol->value.enumerated.item[0]) 166 166 return 0; 167 167 168 168 rx51_dmic_func = ucontrol->value.enumerated.item[0]; 169 - rx51_ext_control(&card->dapm); 169 + rx51_ext_control(dapm); 170 170 171 171 return 1; 172 172 } ··· 184 182 struct snd_ctl_elem_value *ucontrol) 185 183 { 186 184 struct snd_soc_card *card = snd_kcontrol_chip(kcontrol); 185 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 187 186 188 187 if (rx51_jack_func == ucontrol->value.enumerated.item[0]) 189 188 return 0; 190 189 191 190 rx51_jack_func = ucontrol->value.enumerated.item[0]; 192 - rx51_ext_control(&card->dapm); 191 + rx51_ext_control(dapm); 193 192 194 193 return 1; 195 194 }