From: Kuninori Morimoto Date: Tue, 11 Nov 2025 00:36:09 +0000 (+0000) Subject: ASoC: soc-core: convert to snd_soc_dapm_xxx() X-Git-Tag: v6.19-rc1~156^2~3^2~43^2~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e758b08d7170ee96e3461cec5c5b33e9aff5a75e;p=thirdparty%2Fkernel%2Flinux.git ASoC: soc-core: 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 Reviewed-by: Charles Keepax Link: https://patch.msgid.link/87h5v1tngm.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown --- diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 9dd84d73046be..4297cc27005c1 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -151,7 +151,7 @@ static void soc_init_component_debugfs(struct snd_soc_component *component) component->card->debugfs_card_root); } - snd_soc_dapm_debugfs_init(snd_soc_component_get_dapm(component), + snd_soc_dapm_debugfs_init(snd_soc_component_to_dapm(component), component->debugfs_root); } @@ -203,7 +203,7 @@ static void soc_init_card_debugfs(struct snd_soc_card *card) debugfs_create_u32("dapm_pop_time", 0644, card->debugfs_card_root, &card->pop_time); - snd_soc_dapm_debugfs_init(&card->dapm, card->debugfs_card_root); + snd_soc_dapm_debugfs_init(snd_soc_card_to_dapm(card), card->debugfs_card_root); } static void soc_cleanup_card_debugfs(struct snd_soc_card *card) @@ -687,7 +687,7 @@ int snd_soc_suspend(struct device *dev) /* Recheck all endpoints too, their state is affected by suspend */ snd_soc_dapm_mark_endpoints_dirty(card); - snd_soc_dapm_sync(&card->dapm); + snd_soc_dapm_sync(snd_soc_card_to_dapm(card)); /* suspend all COMPONENTs */ for_each_card_rtds(card, rtd) { @@ -696,8 +696,7 @@ int snd_soc_suspend(struct device *dev) continue; for_each_rtd_components(rtd, i, component) { - struct snd_soc_dapm_context *dapm = - snd_soc_component_get_dapm(component); + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); /* * ignore if component was already suspended @@ -717,7 +716,7 @@ int snd_soc_suspend(struct device *dev) * means it's doing something, * otherwise fall through. */ - if (!dapm->idle_bias) { + if (!snd_soc_dapm_get_idle_bias(dapm)) { dev_dbg(component->dev, "ASoC: idle_bias_off CODEC on over suspend\n"); break; @@ -784,7 +783,7 @@ static void soc_resume_deferred(struct work_struct *work) /* Recheck all endpoints too, their state is affected by suspend */ snd_soc_dapm_mark_endpoints_dirty(card); - snd_soc_dapm_sync(&card->dapm); + snd_soc_dapm_sync(snd_soc_card_to_dapm(card)); /* userspace can access us now we are back as we were before */ snd_power_change_state(card->snd_card, SNDRV_CTL_POWER_D0); @@ -1590,7 +1589,7 @@ static void soc_remove_component(struct snd_soc_component *component, snd_soc_component_remove(component); list_del_init(&component->card_list); - snd_soc_dapm_free(snd_soc_component_get_dapm(component)); + snd_soc_dapm_free(snd_soc_component_to_dapm(component)); soc_cleanup_component_debugfs(component); component->card = NULL; snd_soc_component_module_put_when_remove(component); @@ -1599,8 +1598,7 @@ static void soc_remove_component(struct snd_soc_component *component, static int soc_probe_component(struct snd_soc_card *card, struct snd_soc_component *component) { - struct snd_soc_dapm_context *dapm = - snd_soc_component_get_dapm(component); + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); struct snd_soc_dai *dai; int probed = 0; int ret; @@ -1652,8 +1650,8 @@ static int soc_probe_component(struct snd_soc_card *card, if (ret < 0) goto err_probe; - WARN(!dapm->idle_bias && - dapm->bias_level != SND_SOC_BIAS_OFF, + WARN(!snd_soc_dapm_get_idle_bias(dapm) && + snd_soc_dapm_get_bias_level(dapm) != SND_SOC_BIAS_OFF, "codec %s can not start from non-off bias with idle_bias_off==1\n", component->name); probed = 1; @@ -2130,7 +2128,7 @@ static void soc_cleanup_card_resources(struct snd_soc_card *card) soc_remove_aux_devices(card); soc_unbind_aux_dev(card); - snd_soc_dapm_free(&card->dapm); + snd_soc_dapm_free(snd_soc_card_to_dapm(card)); soc_cleanup_card_debugfs(card); /* remove the card */ @@ -2156,12 +2154,13 @@ static int snd_soc_bind_card(struct snd_soc_card *card) { struct snd_soc_pcm_runtime *rtd; struct snd_soc_component *component; + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); int ret; snd_soc_card_mutex_lock_root(card); snd_soc_fill_dummy_dai(card); - snd_soc_dapm_init(&card->dapm, card, NULL); + snd_soc_dapm_init(dapm, card, NULL); /* check whether any platform is ignore machine FE and using topology */ soc_check_tplg_fes(card); @@ -2191,12 +2190,12 @@ static int snd_soc_bind_card(struct snd_soc_card *card) soc_resume_init(card); - ret = snd_soc_dapm_new_controls(&card->dapm, card->dapm_widgets, + ret = snd_soc_dapm_new_controls(dapm, card->dapm_widgets, card->num_dapm_widgets); if (ret < 0) goto probe_end; - ret = snd_soc_dapm_new_controls(&card->dapm, card->of_dapm_widgets, + ret = snd_soc_dapm_new_controls(dapm, card->of_dapm_widgets, card->num_of_dapm_widgets); if (ret < 0) goto probe_end; @@ -2246,12 +2245,12 @@ static int snd_soc_bind_card(struct snd_soc_card *card) if (ret < 0) goto probe_end; - ret = snd_soc_dapm_add_routes(&card->dapm, card->dapm_routes, + ret = snd_soc_dapm_add_routes(dapm, card->dapm_routes, card->num_dapm_routes); if (ret < 0) goto probe_end; - ret = snd_soc_dapm_add_routes(&card->dapm, card->of_dapm_routes, + ret = snd_soc_dapm_add_routes(dapm, card->of_dapm_routes, card->num_of_dapm_routes); if (ret < 0) goto probe_end; @@ -2295,7 +2294,7 @@ static int snd_soc_bind_card(struct snd_soc_card *card) card->instantiated = 1; snd_soc_dapm_mark_endpoints_dirty(card); - snd_soc_dapm_sync(&card->dapm); + snd_soc_dapm_sync(dapm); /* deactivate pins to sleep state */ for_each_card_components(card, component)