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

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

authored by

Kuninori Morimoto and committed by
Mark Brown
6db8ba34 49a22e98

+11 -17
+11 -17
sound/soc/codecs/rt711.c
··· 360 360 361 361 static void rt711_jack_init(struct rt711_priv *rt711) 362 362 { 363 - struct snd_soc_dapm_context *dapm = 364 - snd_soc_component_get_dapm(rt711->component); 363 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(rt711->component); 365 364 366 365 mutex_lock(&rt711->calibrate_mutex); 367 366 /* power on */ 368 - if (dapm->bias_level <= SND_SOC_BIAS_STANDBY) 367 + if (snd_soc_dapm_get_bias_level(dapm) <= SND_SOC_BIAS_STANDBY) 369 368 regmap_write(rt711->regmap, 370 369 RT711_SET_AUDIO_POWER_STATE, AC_PWRST_D0); 371 370 ··· 447 448 } 448 449 449 450 /* power off */ 450 - if (dapm->bias_level <= SND_SOC_BIAS_STANDBY) 451 + if (snd_soc_dapm_get_bias_level(dapm) <= SND_SOC_BIAS_STANDBY) 451 452 regmap_write(rt711->regmap, 452 453 RT711_SET_AUDIO_POWER_STATE, AC_PWRST_D3); 453 454 mutex_unlock(&rt711->calibrate_mutex); ··· 503 504 struct snd_ctl_elem_value *ucontrol) 504 505 { 505 506 struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 506 - struct snd_soc_dapm_context *dapm = 507 - snd_soc_component_get_dapm(component); 507 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 508 508 struct soc_mixer_control *mc = 509 509 (struct soc_mixer_control *)kcontrol->private_value; 510 510 struct rt711_priv *rt711 = snd_soc_component_get_drvdata(component); ··· 541 543 val_ll |= read_ll; 542 544 } 543 545 544 - if (dapm->bias_level <= SND_SOC_BIAS_STANDBY) 546 + if (snd_soc_dapm_get_bias_level(dapm) <= SND_SOC_BIAS_STANDBY) 545 547 regmap_write(rt711->regmap, 546 548 RT711_SET_AUDIO_POWER_STATE, AC_PWRST_D0); 547 549 ··· 595 597 break; 596 598 } 597 599 598 - if (dapm->bias_level <= SND_SOC_BIAS_STANDBY) 600 + if (snd_soc_dapm_get_bias_level(dapm) <= SND_SOC_BIAS_STANDBY) 599 601 regmap_write(rt711->regmap, 600 602 RT711_SET_AUDIO_POWER_STATE, AC_PWRST_D3); 601 603 ··· 680 682 static int rt711_mux_get(struct snd_kcontrol *kcontrol, 681 683 struct snd_ctl_elem_value *ucontrol) 682 684 { 683 - struct snd_soc_component *component = 684 - snd_soc_dapm_kcontrol_component(kcontrol); 685 + struct snd_soc_component *component = snd_soc_dapm_kcontrol_to_component(kcontrol); 685 686 struct rt711_priv *rt711 = snd_soc_component_get_drvdata(component); 686 687 unsigned int reg, val = 0, nid; 687 688 int ret; ··· 709 712 static int rt711_mux_put(struct snd_kcontrol *kcontrol, 710 713 struct snd_ctl_elem_value *ucontrol) 711 714 { 712 - struct snd_soc_component *component = 713 - snd_soc_dapm_kcontrol_component(kcontrol); 714 - struct snd_soc_dapm_context *dapm = 715 - snd_soc_dapm_kcontrol_dapm(kcontrol); 715 + struct snd_soc_component *component = snd_soc_dapm_kcontrol_to_component(kcontrol); 716 + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol); 716 717 struct rt711_priv *rt711 = snd_soc_component_get_drvdata(component); 717 718 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; 718 719 unsigned int *item = ucontrol->value.enumerated.item; ··· 895 900 static int rt711_set_bias_level(struct snd_soc_component *component, 896 901 enum snd_soc_bias_level level) 897 902 { 898 - struct snd_soc_dapm_context *dapm = 899 - snd_soc_component_get_dapm(component); 903 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 900 904 struct rt711_priv *rt711 = snd_soc_component_get_drvdata(component); 901 905 902 906 switch (level) { 903 907 case SND_SOC_BIAS_PREPARE: 904 - if (dapm->bias_level == SND_SOC_BIAS_STANDBY) { 908 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_STANDBY) { 905 909 regmap_write(rt711->regmap, 906 910 RT711_SET_AUDIO_POWER_STATE, 907 911 AC_PWRST_D0);