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

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

authored by

Kuninori Morimoto and committed by
Mark Brown
c3282ede ab7963a3

+10 -9
+10 -9
sound/soc/codecs/rt5640.c
··· 1935 1935 enum snd_soc_bias_level level) 1936 1936 { 1937 1937 struct rt5640_priv *rt5640 = snd_soc_component_get_drvdata(component); 1938 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1938 1939 int ret; 1939 1940 1940 1941 switch (level) { ··· 1950 1949 * away from ON. Disable the clock in that case, otherwise 1951 1950 * enable it. 1952 1951 */ 1953 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_ON) { 1952 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_ON) { 1954 1953 clk_disable_unprepare(rt5640->mclk); 1955 1954 } else { 1956 1955 ret = clk_prepare_enable(rt5640->mclk); ··· 1960 1959 break; 1961 1960 1962 1961 case SND_SOC_BIAS_STANDBY: 1963 - if (SND_SOC_BIAS_OFF == snd_soc_component_get_bias_level(component)) { 1962 + if (SND_SOC_BIAS_OFF == snd_soc_dapm_get_bias_level(dapm)) { 1964 1963 snd_soc_component_update_bits(component, RT5640_PWR_ANLG1, 1965 1964 RT5640_PWR_VREF1 | RT5640_PWR_MB | 1966 1965 RT5640_PWR_BG | RT5640_PWR_VREF2, ··· 2099 2098 2100 2099 void rt5640_enable_micbias1_for_ovcd(struct snd_soc_component *component) 2101 2100 { 2102 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 2101 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 2103 2102 struct rt5640_priv *rt5640 = snd_soc_component_get_drvdata(component); 2104 2103 2105 2104 snd_soc_dapm_mutex_lock(dapm); ··· 2115 2114 2116 2115 void rt5640_disable_micbias1_for_ovcd(struct snd_soc_component *component) 2117 2116 { 2118 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 2117 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 2119 2118 struct rt5640_priv *rt5640 = snd_soc_component_get_drvdata(component); 2120 2119 2121 2120 snd_soc_dapm_mutex_lock(dapm); ··· 2587 2586 struct snd_soc_component *component, struct snd_soc_jack *jack) 2588 2587 { 2589 2588 struct rt5640_priv *rt5640 = snd_soc_component_get_drvdata(component); 2590 - struct snd_soc_dapm_context *dapm = 2591 - snd_soc_component_get_dapm(component); 2589 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 2592 2590 int ret; 2593 2591 2594 2592 /* Select JD1 for Mic */ ··· 2652 2652 2653 2653 static int rt5640_probe(struct snd_soc_component *component) 2654 2654 { 2655 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 2655 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 2656 2656 struct rt5640_priv *rt5640 = snd_soc_component_get_drvdata(component); 2657 2657 u32 dmic1_data_pin = 0; 2658 2658 u32 dmic2_data_pin = 0; ··· 2666 2666 2667 2667 rt5640->component = component; 2668 2668 2669 - snd_soc_component_force_bias_level(component, SND_SOC_BIAS_OFF); 2669 + snd_soc_dapm_force_bias_level(dapm, SND_SOC_BIAS_OFF); 2670 2670 2671 2671 snd_soc_component_update_bits(component, RT5640_GCTL1, 0x0301, 0x0301); 2672 2672 snd_soc_component_update_bits(component, RT5640_MICBIAS, 0x0030, 0x0030); ··· 2796 2796 static int rt5640_suspend(struct snd_soc_component *component) 2797 2797 { 2798 2798 struct rt5640_priv *rt5640 = snd_soc_component_get_drvdata(component); 2799 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 2799 2800 2800 2801 if (rt5640->jack) { 2801 2802 /* disable jack interrupts during system suspend */ ··· 2805 2804 cancel_delayed_work_sync(&rt5640->bp_work); 2806 2805 } 2807 2806 2808 - snd_soc_component_force_bias_level(component, SND_SOC_BIAS_OFF); 2807 + snd_soc_dapm_force_bias_level(dapm, SND_SOC_BIAS_OFF); 2809 2808 rt5640_reset(component); 2810 2809 regcache_cache_only(rt5640->regmap, true); 2811 2810 regcache_mark_dirty(rt5640->regmap);