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

index 41b7545581e02af8ceb8e8292e01df3c75638ced..774fff58d51b93d6de2dba33a37c4347e50f170e 100644 (file)
@@ -155,7 +155,7 @@ static int sof_8336_trigger(struct snd_pcm_substream *substream, int cmd)
 static int sof_es8316_speaker_power_event(struct snd_soc_dapm_widget *w,
                                          struct snd_kcontrol *kcontrol, int event)
 {
-       struct snd_soc_card *card = w->dapm->card;
+       struct snd_soc_card *card = snd_soc_dapm_to_card(w->dapm);
        struct sof_es8336_private *priv = snd_soc_card_get_drvdata(card);
 
        if (priv->speaker_en == !SND_SOC_DAPM_EVENT_ON(event))
@@ -231,16 +231,17 @@ static struct snd_soc_jack_pin sof_es8316_jack_pins[] = {
 static int dmic_init(struct snd_soc_pcm_runtime *runtime)
 {
        struct snd_soc_card *card = runtime->card;
+       struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card);
        int ret;
 
-       ret = snd_soc_dapm_new_controls(&card->dapm, dmic_widgets,
+       ret = snd_soc_dapm_new_controls(dapm, dmic_widgets,
                                        ARRAY_SIZE(dmic_widgets));
        if (ret) {
                dev_err(card->dev, "DMic widget addition failed: %d\n", ret);
                return ret;
        }
 
-       ret = snd_soc_dapm_add_routes(&card->dapm, dmic_map,
+       ret = snd_soc_dapm_add_routes(dapm, dmic_map,
                                      ARRAY_SIZE(dmic_map));
        if (ret)
                dev_err(card->dev, "DMic map addition failed: %d\n", ret);
@@ -271,12 +272,13 @@ static int sof_es8316_init(struct snd_soc_pcm_runtime *runtime)
 {
        struct snd_soc_component *codec = snd_soc_rtd_to_codec(runtime, 0)->component;
        struct snd_soc_card *card = runtime->card;
+       struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card);
        struct sof_es8336_private *priv = snd_soc_card_get_drvdata(card);
        const struct snd_soc_dapm_route *custom_map;
        int num_routes;
        int ret;
 
-       card->dapm.idle_bias = false;
+       snd_soc_dapm_set_idle_bias(dapm, false);
 
        if (quirk & SOC_ES8336_HEADSET_MIC1) {
                custom_map = sof_es8316_headset_mic1_map;
@@ -286,7 +288,7 @@ static int sof_es8316_init(struct snd_soc_pcm_runtime *runtime)
                num_routes = ARRAY_SIZE(sof_es8316_headset_mic2_map);
        }
 
-       ret = snd_soc_dapm_add_routes(&card->dapm, custom_map, num_routes);
+       ret = snd_soc_dapm_add_routes(dapm, custom_map, num_routes);
        if (ret)
                return ret;