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

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

authored by

Kuninori Morimoto and committed by
Mark Brown
10d5d21a 69532b42

+19 -17
+19 -17
sound/soc/codecs/wm8994.c
··· 214 214 215 215 static int configure_clock(struct snd_soc_component *component) 216 216 { 217 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 217 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 218 218 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); 219 219 int change, new; 220 220 ··· 1515 1515 static int wm8994_put_class_w(struct snd_kcontrol *kcontrol, 1516 1516 struct snd_ctl_elem_value *ucontrol) 1517 1517 { 1518 - struct snd_soc_component *component = snd_soc_dapm_kcontrol_component(kcontrol); 1518 + struct snd_soc_component *component = snd_soc_dapm_kcontrol_to_component(kcontrol); 1519 1519 int ret; 1520 1520 1521 1521 ret = snd_soc_dapm_put_volsw(kcontrol, ucontrol); ··· 2615 2615 enum snd_soc_bias_level level) 2616 2616 { 2617 2617 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); 2618 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 2618 2619 struct wm8994 *control = wm8994->wm8994; 2619 2620 2620 2621 wm_hubs_set_bias_level(component, level); ··· 2638 2637 break; 2639 2638 } 2640 2639 2641 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_STANDBY) 2640 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_STANDBY) 2642 2641 active_reference(component); 2643 2642 break; 2644 2643 2645 2644 case SND_SOC_BIAS_STANDBY: 2646 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { 2645 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) { 2647 2646 switch (control->type) { 2648 2647 case WM8958: 2649 2648 if (control->revision == 0) { ··· 2667 2666 WM8994_LINEOUT2_DISCH); 2668 2667 } 2669 2668 2670 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_PREPARE) 2669 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_PREPARE) 2671 2670 active_dereference(component); 2672 2671 2673 2672 /* MICBIAS into bypass mode on newer devices */ ··· 2687 2686 break; 2688 2687 2689 2688 case SND_SOC_BIAS_OFF: 2690 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_STANDBY) 2689 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_STANDBY) 2691 2690 wm8994->cur_fw = NULL; 2692 2691 break; 2693 2692 } ··· 2698 2697 int wm8994_vmid_mode(struct snd_soc_component *component, enum wm8994_vmid_mode mode) 2699 2698 { 2700 2699 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); 2701 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 2700 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 2702 2701 2703 2702 switch (mode) { 2704 2703 case WM8994_VMID_NORMAL: ··· 3300 3299 static int wm8994_component_suspend(struct snd_soc_component *component) 3301 3300 { 3302 3301 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); 3302 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 3303 3303 int i, ret; 3304 3304 3305 3305 for (i = 0; i < ARRAY_SIZE(wm8994->fll); i++) { ··· 3312 3310 i + 1, ret); 3313 3311 } 3314 3312 3315 - snd_soc_component_force_bias_level(component, SND_SOC_BIAS_OFF); 3313 + snd_soc_dapm_force_bias_level(dapm, SND_SOC_BIAS_OFF); 3316 3314 3317 3315 return 0; 3318 3316 } ··· 3505 3503 int wm8994_mic_detect(struct snd_soc_component *component, struct snd_soc_jack *jack, 3506 3504 int micbias) 3507 3505 { 3508 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 3506 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 3509 3507 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); 3510 3508 struct wm8994_micdet *micdet; 3511 3509 struct wm8994 *control = wm8994->wm8994; ··· 3655 3653 /* Should be called with accdet_lock held */ 3656 3654 static void wm1811_micd_stop(struct snd_soc_component *component) 3657 3655 { 3658 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 3656 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 3659 3657 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); 3660 3658 3661 3659 if (!wm8994->jackdet) ··· 3775 3773 mic_work.work); 3776 3774 struct wm8994 *control = wm8994->wm8994; 3777 3775 struct snd_soc_component *component = wm8994->hubs.component; 3778 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 3776 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 3779 3777 3780 3778 pm_runtime_get_sync(component->dev); 3781 3779 ··· 3814 3812 struct wm8994_priv *wm8994 = data; 3815 3813 struct wm8994 *control = wm8994->wm8994; 3816 3814 struct snd_soc_component *component = wm8994->hubs.component; 3817 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 3815 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 3818 3816 int reg, delay; 3819 3817 bool present; 3820 3818 ··· 3930 3928 wm1811_micdet_cb det_cb, void *det_cb_data, 3931 3929 wm1811_mic_id_cb id_cb, void *id_cb_data) 3932 3930 { 3933 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 3931 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 3934 3932 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); 3935 3933 struct wm8994 *control = wm8994->wm8994; 3936 3934 u16 micd_lvl_sel; ··· 3982 3980 snd_soc_component_update_bits(component, WM8958_MIC_DETECT_2, 3983 3981 WM8958_MICD_LVL_SEL_MASK, micd_lvl_sel); 3984 3982 3985 - WARN_ON(snd_soc_component_get_bias_level(component) > SND_SOC_BIAS_STANDBY); 3983 + WARN_ON(snd_soc_dapm_get_bias_level(dapm) > SND_SOC_BIAS_STANDBY); 3986 3984 3987 3985 /* 3988 3986 * If we can use jack detection start off with that, ··· 4150 4148 4151 4149 static int wm8994_component_probe(struct snd_soc_component *component) 4152 4150 { 4153 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 4151 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 4154 4152 struct wm8994 *control = dev_get_drvdata(component->dev->parent); 4155 4153 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); 4156 4154 unsigned int reg; ··· 4185 4183 wm8994->micdet_irq = control->pdata.micdet_irq; 4186 4184 4187 4185 /* By default use idle_bias false, will override for WM8994 */ 4188 - dapm->idle_bias = false; 4186 + snd_soc_dapm_set_idle_bias(dapm, false); 4189 4187 4190 4188 /* Set revision-specific configuration */ 4191 4189 switch (control->type) { ··· 4193 4191 /* Single ended line outputs should have VMID on. */ 4194 4192 if (!control->pdata.lineout1_diff || 4195 4193 !control->pdata.lineout2_diff) 4196 - dapm->idle_bias = true; 4194 + snd_soc_dapm_set_idle_bias(dapm, true); 4197 4195 4198 4196 switch (control->revision) { 4199 4197 case 2: