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

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

authored by

Kuninori Morimoto and committed by
Mark Brown
d6abe1e3 cd0cd7e5

+8 -5
+8 -5
sound/soc/codecs/rt5651.c
··· 1511 1511 static int rt5651_set_bias_level(struct snd_soc_component *component, 1512 1512 enum snd_soc_bias_level level) 1513 1513 { 1514 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1515 + 1514 1516 switch (level) { 1515 1517 case SND_SOC_BIAS_PREPARE: 1516 - if (SND_SOC_BIAS_STANDBY == snd_soc_component_get_bias_level(component)) { 1518 + if (SND_SOC_BIAS_STANDBY == snd_soc_dapm_get_bias_level(dapm)) { 1517 1519 if (snd_soc_component_read(component, RT5651_PLL_MODE_1) & 0x9200) 1518 1520 snd_soc_component_update_bits(component, RT5651_D_MISC, 1519 1521 0xc00, 0xc00); 1520 1522 } 1521 1523 break; 1522 1524 case SND_SOC_BIAS_STANDBY: 1523 - if (SND_SOC_BIAS_OFF == snd_soc_component_get_bias_level(component)) { 1525 + if (SND_SOC_BIAS_OFF == snd_soc_dapm_get_bias_level(dapm)) { 1524 1526 snd_soc_component_update_bits(component, RT5651_PWR_ANLG1, 1525 1527 RT5651_PWR_VREF1 | RT5651_PWR_MB | 1526 1528 RT5651_PWR_BG | RT5651_PWR_VREF2, ··· 1559 1557 1560 1558 static void rt5651_enable_micbias1_for_ovcd(struct snd_soc_component *component) 1561 1559 { 1562 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 1560 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1563 1561 1564 1562 snd_soc_dapm_mutex_lock(dapm); 1565 1563 snd_soc_dapm_force_enable_pin_unlocked(dapm, "LDO"); ··· 1572 1570 1573 1571 static void rt5651_disable_micbias1_for_ovcd(struct snd_soc_component *component) 1574 1572 { 1575 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 1573 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1576 1574 1577 1575 snd_soc_dapm_mutex_lock(dapm); 1578 1576 snd_soc_dapm_disable_pin_unlocked(dapm, "Platform Clock"); ··· 2060 2058 static int rt5651_probe(struct snd_soc_component *component) 2061 2059 { 2062 2060 struct rt5651_priv *rt5651 = snd_soc_component_get_drvdata(component); 2061 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 2063 2062 2064 2063 rt5651->component = component; 2065 2064 2066 2065 snd_soc_component_update_bits(component, RT5651_PWR_ANLG1, 2067 2066 RT5651_PWR_LDO_DVO_MASK, RT5651_PWR_LDO_DVO_1_2V); 2068 2067 2069 - snd_soc_component_force_bias_level(component, SND_SOC_BIAS_OFF); 2068 + snd_soc_dapm_force_bias_level(dapm, SND_SOC_BIAS_OFF); 2070 2069 2071 2070 rt5651_apply_properties(component); 2072 2071