From 64f90b329ffadae00b187ac797837ba598289707 Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Tue, 11 Nov 2025 00:17:37 +0000 Subject: [PATCH] ASoC: audio_codec: 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/878qgda0da.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown --- drivers/staging/greybus/audio_codec.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/staging/greybus/audio_codec.c b/drivers/staging/greybus/audio_codec.c index 2f05e761fb9ad..444c53b4e08dd 100644 --- a/drivers/staging/greybus/audio_codec.c +++ b/drivers/staging/greybus/audio_codec.c @@ -807,6 +807,7 @@ int gbaudio_register_module(struct gbaudio_module_info *module) { int ret; struct snd_soc_component *comp; + struct snd_soc_dapm_context *dapm; struct gbaudio_jack *jack = NULL; if (!gbcodec) { @@ -815,6 +816,7 @@ int gbaudio_register_module(struct gbaudio_module_info *module) } comp = gbcodec->component; + dapm = snd_soc_component_to_dapm(comp); mutex_lock(&gbcodec->register_mutex); @@ -833,18 +835,18 @@ int gbaudio_register_module(struct gbaudio_module_info *module) } if (module->dapm_widgets) - snd_soc_dapm_new_controls(&comp->dapm, module->dapm_widgets, + snd_soc_dapm_new_controls(dapm, module->dapm_widgets, module->num_dapm_widgets); if (module->controls) snd_soc_add_component_controls(comp, module->controls, module->num_controls); if (module->dapm_routes) - snd_soc_dapm_add_routes(&comp->dapm, module->dapm_routes, + snd_soc_dapm_add_routes(dapm, module->dapm_routes, module->num_dapm_routes); /* card already instantiated, create widgets here only */ if (comp->card->instantiated) { - gbaudio_dapm_link_component_dai_widgets(comp->card, &comp->dapm); + gbaudio_dapm_link_component_dai_widgets(comp->card, dapm); #ifdef CONFIG_SND_JACK /* * register jack devices for this module @@ -966,9 +968,11 @@ void gbaudio_unregister_module(struct gbaudio_module_info *module) #endif if (module->dapm_routes) { + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(comp); + dev_dbg(comp->dev, "Removing %d routes\n", module->num_dapm_routes); - snd_soc_dapm_del_routes(&comp->dapm, module->dapm_routes, + snd_soc_dapm_del_routes(dapm, module->dapm_routes, module->num_dapm_routes); } if (module->controls) { @@ -979,9 +983,11 @@ void gbaudio_unregister_module(struct gbaudio_module_info *module) module->num_controls); } if (module->dapm_widgets) { + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(comp); + dev_dbg(comp->dev, "Removing %d widgets\n", module->num_dapm_widgets); - gbaudio_dapm_free_controls(&comp->dapm, module->dapm_widgets, + gbaudio_dapm_free_controls(dapm, module->dapm_widgets, module->num_dapm_widgets); } -- 2.47.3