]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ASoC: codecs: wm8900: convert to snd_soc_dapm_xxx()
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tue, 11 Nov 2025 00:29:01 +0000 (00:29 +0000)
committerMark Brown <broonie@kernel.org>
Mon, 17 Nov 2025 00:16:52 +0000 (00:16 +0000)
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/87ms4tza2b.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/wm8900.c

index 6fb25588ca81952919ae9f00ddf489e2e22cc20d..fea629541acda5ae274cf2fe299637b70c00d53e 100644 (file)
@@ -1023,6 +1023,7 @@ static struct snd_soc_dai_driver wm8900_dai = {
 static int wm8900_set_bias_level(struct snd_soc_component *component,
                                 enum snd_soc_bias_level level)
 {
+       struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component);
        u16 reg;
 
        switch (level) {
@@ -1041,7 +1042,7 @@ static int wm8900_set_bias_level(struct snd_soc_component *component,
 
        case SND_SOC_BIAS_STANDBY:
                /* Charge capacitors if initial power up */
-               if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) {
+               if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) {
                        /* STARTUP_BIAS_ENA on */
                        snd_soc_component_write(component, WM8900_REG_POWER1,
                                     WM8900_REG_POWER1_STARTUP_BIAS_ENA);
@@ -1115,6 +1116,7 @@ static int wm8900_set_bias_level(struct snd_soc_component *component,
 static int wm8900_suspend(struct snd_soc_component *component)
 {
        struct wm8900_priv *wm8900 = snd_soc_component_get_drvdata(component);
+       struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component);
        int fll_out = wm8900->fll_out;
        int fll_in  = wm8900->fll_in;
        int ret;
@@ -1129,7 +1131,7 @@ static int wm8900_suspend(struct snd_soc_component *component)
        wm8900->fll_out = fll_out;
        wm8900->fll_in = fll_in;
 
-       snd_soc_component_force_bias_level(component, SND_SOC_BIAS_OFF);
+       snd_soc_dapm_force_bias_level(dapm, SND_SOC_BIAS_OFF);
 
        return 0;
 }
@@ -1137,6 +1139,7 @@ static int wm8900_suspend(struct snd_soc_component *component)
 static int wm8900_resume(struct snd_soc_component *component)
 {
        struct wm8900_priv *wm8900 = snd_soc_component_get_drvdata(component);
+       struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component);
        int ret;
 
        wm8900_reset(component);
@@ -1147,7 +1150,7 @@ static int wm8900_resume(struct snd_soc_component *component)
                return ret;
        }
 
-       snd_soc_component_force_bias_level(component, SND_SOC_BIAS_STANDBY);
+       snd_soc_dapm_force_bias_level(dapm, SND_SOC_BIAS_STANDBY);
 
        /* Restart the FLL? */
        if (wm8900->fll_out) {
@@ -1169,6 +1172,7 @@ static int wm8900_resume(struct snd_soc_component *component)
 
 static int wm8900_probe(struct snd_soc_component *component)
 {
+       struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component);
        int reg;
 
        reg = snd_soc_component_read(component, WM8900_REG_ID);
@@ -1180,7 +1184,7 @@ static int wm8900_probe(struct snd_soc_component *component)
        wm8900_reset(component);
 
        /* Turn the chip on */
-       snd_soc_component_force_bias_level(component, SND_SOC_BIAS_STANDBY);
+       snd_soc_dapm_force_bias_level(dapm, SND_SOC_BIAS_STANDBY);
 
        /* Latch the volume update bits */
        snd_soc_component_update_bits(component, WM8900_REG_LINVOL, 0x100, 0x100);