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

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

authored by

Kuninori Morimoto and committed by
Mark Brown
cd0cd7e5 c3282ede

+8 -7
+8 -7
sound/soc/codecs/rt5645.c
··· 3071 3071 enum snd_soc_bias_level level) 3072 3072 { 3073 3073 struct rt5645_priv *rt5645 = snd_soc_component_get_drvdata(component); 3074 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 3074 3075 3075 3076 switch (level) { 3076 3077 case SND_SOC_BIAS_PREPARE: 3077 - if (SND_SOC_BIAS_STANDBY == snd_soc_component_get_bias_level(component)) { 3078 + if (SND_SOC_BIAS_STANDBY == snd_soc_dapm_get_bias_level(dapm)) { 3078 3079 snd_soc_component_update_bits(component, RT5645_PWR_ANLG1, 3079 3080 RT5645_PWR_VREF1 | RT5645_PWR_MB | 3080 3081 RT5645_PWR_BG | RT5645_PWR_VREF2, ··· 3100 3099 snd_soc_component_update_bits(component, RT5645_PWR_ANLG1, 3101 3100 RT5645_PWR_FV1 | RT5645_PWR_FV2, 3102 3101 RT5645_PWR_FV1 | RT5645_PWR_FV2); 3103 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { 3102 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) { 3104 3103 snd_soc_component_write(component, RT5645_DEPOP_M2, 0x1140); 3105 3104 msleep(40); 3106 3105 if (rt5645->en_button_func) ··· 3131 3130 static void rt5645_enable_push_button_irq(struct snd_soc_component *component, 3132 3131 bool enable) 3133 3132 { 3134 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 3133 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 3135 3134 int ret; 3136 3135 3137 3136 if (enable) { ··· 3170 3169 3171 3170 static int rt5645_jack_detect(struct snd_soc_component *component, int jack_insert) 3172 3171 { 3173 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 3172 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 3174 3173 struct rt5645_priv *rt5645 = snd_soc_component_get_drvdata(component); 3175 3174 unsigned int val; 3176 3175 ··· 3181 3180 snd_soc_dapm_force_enable_pin(dapm, "LDO2"); 3182 3181 snd_soc_dapm_force_enable_pin(dapm, "Mic Det Power"); 3183 3182 snd_soc_dapm_sync(dapm); 3184 - if (!snd_soc_card_is_instantiated(dapm->card)) { 3183 + if (!snd_soc_card_is_instantiated(component->card)) { 3185 3184 /* Power up necessary bits for JD if dapm is 3186 3185 not ready yet */ 3187 3186 regmap_update_bits(rt5645->regmap, RT5645_PWR_ANLG1, ··· 3450 3449 3451 3450 static int rt5645_probe(struct snd_soc_component *component) 3452 3451 { 3453 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 3452 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 3454 3453 struct rt5645_priv *rt5645 = snd_soc_component_get_drvdata(component); 3455 3454 3456 3455 rt5645->component = component; ··· 3479 3478 break; 3480 3479 } 3481 3480 3482 - snd_soc_component_force_bias_level(component, SND_SOC_BIAS_OFF); 3481 + snd_soc_dapm_force_bias_level(dapm, SND_SOC_BIAS_OFF); 3483 3482 3484 3483 /* for JD function */ 3485 3484 if (rt5645->pdata.jd_mode) {