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

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

authored by

Kuninori Morimoto and committed by
Mark Brown
1b301182 e727c8d0

+11 -17
+11 -17
sound/soc/codecs/rt700.c
··· 272 272 273 273 static void rt700_jack_init(struct rt700_priv *rt700) 274 274 { 275 - struct snd_soc_dapm_context *dapm = 276 - snd_soc_component_get_dapm(rt700->component); 275 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(rt700->component); 277 276 278 277 /* power on */ 279 - if (dapm->bias_level <= SND_SOC_BIAS_STANDBY) 278 + if (snd_soc_dapm_get_bias_level(dapm) <= SND_SOC_BIAS_STANDBY) 280 279 regmap_write(rt700->regmap, 281 280 RT700_SET_AUDIO_POWER_STATE, AC_PWRST_D0); 282 281 ··· 306 307 } 307 308 308 309 /* power off */ 309 - if (dapm->bias_level <= SND_SOC_BIAS_STANDBY) 310 + if (snd_soc_dapm_get_bias_level(dapm) <= SND_SOC_BIAS_STANDBY) 310 311 regmap_write(rt700->regmap, 311 312 RT700_SET_AUDIO_POWER_STATE, AC_PWRST_D3); 312 313 } ··· 361 362 struct snd_ctl_elem_value *ucontrol) 362 363 { 363 364 struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 364 - struct snd_soc_dapm_context *dapm = 365 - snd_soc_component_get_dapm(component); 365 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 366 366 struct soc_mixer_control *mc = 367 367 (struct soc_mixer_control *)kcontrol->private_value; 368 368 struct rt700_priv *rt700 = snd_soc_component_get_drvdata(component); ··· 396 398 val_ll |= read_ll; 397 399 } 398 400 399 - if (dapm->bias_level <= SND_SOC_BIAS_STANDBY) 401 + if (snd_soc_dapm_get_bias_level(dapm) <= SND_SOC_BIAS_STANDBY) 400 402 regmap_write(rt700->regmap, 401 403 RT700_SET_AUDIO_POWER_STATE, AC_PWRST_D0); 402 404 ··· 448 450 break; 449 451 } 450 452 451 - if (dapm->bias_level <= SND_SOC_BIAS_STANDBY) 453 + if (snd_soc_dapm_get_bias_level(dapm) <= SND_SOC_BIAS_STANDBY) 452 454 regmap_write(rt700->regmap, 453 455 RT700_SET_AUDIO_POWER_STATE, AC_PWRST_D3); 454 456 return 0; ··· 522 524 static int rt700_mux_get(struct snd_kcontrol *kcontrol, 523 525 struct snd_ctl_elem_value *ucontrol) 524 526 { 525 - struct snd_soc_component *component = 526 - snd_soc_dapm_kcontrol_component(kcontrol); 527 + struct snd_soc_component *component = snd_soc_dapm_kcontrol_to_component(kcontrol); 527 528 struct rt700_priv *rt700 = snd_soc_component_get_drvdata(component); 528 529 unsigned int reg, val = 0, nid; 529 530 int ret; ··· 550 553 static int rt700_mux_put(struct snd_kcontrol *kcontrol, 551 554 struct snd_ctl_elem_value *ucontrol) 552 555 { 553 - struct snd_soc_component *component = 554 - snd_soc_dapm_kcontrol_component(kcontrol); 555 - struct snd_soc_dapm_context *dapm = 556 - snd_soc_dapm_kcontrol_dapm(kcontrol); 556 + struct snd_soc_component *component = snd_soc_dapm_kcontrol_to_component(kcontrol); 557 + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol); 557 558 struct rt700_priv *rt700 = snd_soc_component_get_drvdata(component); 558 559 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; 559 560 unsigned int *item = ucontrol->value.enumerated.item; ··· 834 839 static int rt700_set_bias_level(struct snd_soc_component *component, 835 840 enum snd_soc_bias_level level) 836 841 { 837 - struct snd_soc_dapm_context *dapm = 838 - snd_soc_component_get_dapm(component); 842 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 839 843 struct rt700_priv *rt700 = snd_soc_component_get_drvdata(component); 840 844 841 845 switch (level) { 842 846 case SND_SOC_BIAS_PREPARE: 843 - if (dapm->bias_level == SND_SOC_BIAS_STANDBY) { 847 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_STANDBY) { 844 848 regmap_write(rt700->regmap, 845 849 RT700_SET_AUDIO_POWER_STATE, 846 850 AC_PWRST_D0);