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

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

authored by

Kuninori Morimoto and committed by
Mark Brown
aa57703f 5d1a88f5

+7 -5
+7 -5
sound/soc/codecs/wm8960.c
··· 488 488 { 489 489 struct wm8960_priv *wm8960 = snd_soc_component_get_drvdata(component); 490 490 struct wm8960_data *pdata = &wm8960->pdata; 491 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 491 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 492 492 struct snd_soc_dapm_widget *w; 493 493 494 494 snd_soc_dapm_new_controls(dapm, wm8960_dapm_widgets, ··· 913 913 enum snd_soc_bias_level level) 914 914 { 915 915 struct wm8960_priv *wm8960 = snd_soc_component_get_drvdata(component); 916 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 916 917 u16 pm2 = snd_soc_component_read(component, WM8960_POWER2); 917 918 int ret; 918 919 ktime_t tout; ··· 923 922 break; 924 923 925 924 case SND_SOC_BIAS_PREPARE: 926 - switch (snd_soc_component_get_bias_level(component)) { 925 + switch (snd_soc_dapm_get_bias_level(dapm)) { 927 926 case SND_SOC_BIAS_STANDBY: 928 927 if (!IS_ERR(wm8960->mclk)) { 929 928 ret = clk_prepare_enable(wm8960->mclk); ··· 962 961 break; 963 962 964 963 case SND_SOC_BIAS_STANDBY: 965 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { 964 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) { 966 965 /* ensure discharge is complete */ 967 966 tout = WM8960_DSCH_TOUT - ktime_ms_delta(ktime_get(), wm8960->dsch_start); 968 967 if (tout > 0) ··· 1010 1009 enum snd_soc_bias_level level) 1011 1010 { 1012 1011 struct wm8960_priv *wm8960 = snd_soc_component_get_drvdata(component); 1012 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1013 1013 u16 pm2 = snd_soc_component_read(component, WM8960_POWER2); 1014 1014 int reg, ret; 1015 1015 ··· 1019 1017 break; 1020 1018 1021 1019 case SND_SOC_BIAS_PREPARE: 1022 - switch (snd_soc_component_get_bias_level(component)) { 1020 + switch (snd_soc_dapm_get_bias_level(dapm)) { 1023 1021 case SND_SOC_BIAS_STANDBY: 1024 1022 /* Enable anti pop mode */ 1025 1023 snd_soc_component_update_bits(component, WM8960_APOP1, ··· 1102 1100 break; 1103 1101 1104 1102 case SND_SOC_BIAS_STANDBY: 1105 - switch (snd_soc_component_get_bias_level(component)) { 1103 + switch (snd_soc_dapm_get_bias_level(dapm)) { 1106 1104 case SND_SOC_BIAS_PREPARE: 1107 1105 /* Disable HP discharge */ 1108 1106 snd_soc_component_update_bits(component, WM8960_APOP2,