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

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

authored by

Kuninori Morimoto and committed by
Mark Brown
bdc210a4 6254032a

+14 -21
+14 -21
sound/soc/codecs/rt715.c
··· 125 125 struct snd_ctl_elem_value *ucontrol) 126 126 { 127 127 struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 128 - struct snd_soc_dapm_context *dapm = 129 - snd_soc_component_get_dapm(component); 128 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 130 129 struct soc_mixer_control *mc = 131 130 (struct soc_mixer_control *)kcontrol->private_value; 132 131 struct rt715_priv *rt715 = snd_soc_component_get_drvdata(component); ··· 151 152 152 153 rt715_get_gain(rt715, addr_h, addr_l, val_h, &read_rl, &read_ll); 153 154 154 - if (dapm->bias_level <= SND_SOC_BIAS_STANDBY) 155 + if (snd_soc_dapm_get_bias_level(dapm) <= SND_SOC_BIAS_STANDBY) 155 156 regmap_write(rt715->regmap, 156 157 RT715_SET_AUDIO_POWER_STATE, AC_PWRST_D0); 157 158 ··· 205 206 } 206 207 207 208 /* D0:power on state, D3: power saving mode */ 208 - if (dapm->bias_level <= SND_SOC_BIAS_STANDBY) 209 + if (snd_soc_dapm_get_bias_level(dapm) <= SND_SOC_BIAS_STANDBY) 209 210 regmap_write(rt715->regmap, 210 211 RT715_SET_AUDIO_POWER_STATE, AC_PWRST_D3); 211 212 return k_vol_changed; ··· 249 250 struct snd_ctl_elem_value *ucontrol) 250 251 { 251 252 struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 252 - struct snd_soc_dapm_context *dapm = 253 - snd_soc_component_get_dapm(component); 253 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 254 254 struct rt715_priv *rt715 = snd_soc_component_get_drvdata(component); 255 255 static const unsigned int capture_reg_H[] = { 256 256 RT715_SET_GAIN_MIC_ADC_H, RT715_SET_GAIN_LINE_ADC_H, ··· 272 274 addr_l = capture_reg_L[j]; 273 275 rt715_get_gain(rt715, addr_h, addr_l, val_h, &read_rl, &read_ll); 274 276 275 - if (dapm->bias_level <= SND_SOC_BIAS_STANDBY) 277 + if (snd_soc_dapm_get_bias_level(dapm) <= SND_SOC_BIAS_STANDBY) 276 278 regmap_write(rt715->regmap, 277 279 RT715_SET_AUDIO_POWER_STATE, AC_PWRST_D0); 278 280 ··· 320 322 } 321 323 322 324 /* D0:power on state, D3: power saving mode */ 323 - if (dapm->bias_level <= SND_SOC_BIAS_STANDBY) 325 + if (snd_soc_dapm_get_bias_level(dapm) <= SND_SOC_BIAS_STANDBY) 324 326 regmap_write(rt715->regmap, 325 327 RT715_SET_AUDIO_POWER_STATE, AC_PWRST_D3); 326 328 return k_changed; ··· 356 358 struct snd_ctl_elem_value *ucontrol) 357 359 { 358 360 struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 359 - struct snd_soc_dapm_context *dapm = 360 - snd_soc_component_get_dapm(component); 361 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 361 362 struct rt715_priv *rt715 = snd_soc_component_get_drvdata(component); 362 363 static const unsigned int capture_reg_H[] = { 363 364 RT715_SET_GAIN_MIC_ADC_H, RT715_SET_GAIN_LINE_ADC_H, ··· 378 381 addr_l = capture_reg_L[j]; 379 382 rt715_get_gain(rt715, addr_h, addr_l, val_h, &read_rl, &read_ll); 380 383 381 - if (dapm->bias_level <= SND_SOC_BIAS_STANDBY) 384 + if (snd_soc_dapm_get_bias_level(dapm) <= SND_SOC_BIAS_STANDBY) 382 385 regmap_write(rt715->regmap, 383 386 RT715_SET_AUDIO_POWER_STATE, AC_PWRST_D0); 384 387 ··· 428 431 } 429 432 430 433 /* D0:power on state, D3: power saving mode */ 431 - if (dapm->bias_level <= SND_SOC_BIAS_STANDBY) 434 + if (snd_soc_dapm_get_bias_level(dapm) <= SND_SOC_BIAS_STANDBY) 432 435 regmap_write(rt715->regmap, 433 436 RT715_SET_AUDIO_POWER_STATE, AC_PWRST_D3); 434 437 return k_changed; ··· 543 546 static int rt715_mux_get(struct snd_kcontrol *kcontrol, 544 547 struct snd_ctl_elem_value *ucontrol) 545 548 { 546 - struct snd_soc_component *component = 547 - snd_soc_dapm_kcontrol_component(kcontrol); 549 + struct snd_soc_component *component = snd_soc_dapm_kcontrol_to_component(kcontrol); 548 550 struct rt715_priv *rt715 = snd_soc_component_get_drvdata(component); 549 551 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; 550 552 unsigned int reg, val; ··· 573 577 static int rt715_mux_put(struct snd_kcontrol *kcontrol, 574 578 struct snd_ctl_elem_value *ucontrol) 575 579 { 576 - struct snd_soc_component *component = 577 - snd_soc_dapm_kcontrol_component(kcontrol); 578 - struct snd_soc_dapm_context *dapm = 579 - snd_soc_dapm_kcontrol_dapm(kcontrol); 580 + struct snd_soc_component *component = snd_soc_dapm_kcontrol_to_component(kcontrol); 581 + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol); 580 582 struct rt715_priv *rt715 = snd_soc_component_get_drvdata(component); 581 583 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; 582 584 unsigned int *item = ucontrol->value.enumerated.item; ··· 746 752 static int rt715_set_bias_level(struct snd_soc_component *component, 747 753 enum snd_soc_bias_level level) 748 754 { 749 - struct snd_soc_dapm_context *dapm = 750 - snd_soc_component_get_dapm(component); 755 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 751 756 struct rt715_priv *rt715 = snd_soc_component_get_drvdata(component); 752 757 753 758 switch (level) { 754 759 case SND_SOC_BIAS_PREPARE: 755 - if (dapm->bias_level == SND_SOC_BIAS_STANDBY) { 760 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_STANDBY) { 756 761 regmap_write(rt715->regmap, 757 762 RT715_SET_AUDIO_POWER_STATE, 758 763 AC_PWRST_D0);