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

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 <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/87h5v1tngm.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Kuninori Morimoto and committed by
Mark Brown
e758b08d 5b54c4ae

+18 -19
+18 -19
sound/soc/soc-core.c
··· 151 151 component->card->debugfs_card_root); 152 152 } 153 153 154 - snd_soc_dapm_debugfs_init(snd_soc_component_get_dapm(component), 154 + snd_soc_dapm_debugfs_init(snd_soc_component_to_dapm(component), 155 155 component->debugfs_root); 156 156 } 157 157 ··· 203 203 debugfs_create_u32("dapm_pop_time", 0644, card->debugfs_card_root, 204 204 &card->pop_time); 205 205 206 - snd_soc_dapm_debugfs_init(&card->dapm, card->debugfs_card_root); 206 + snd_soc_dapm_debugfs_init(snd_soc_card_to_dapm(card), card->debugfs_card_root); 207 207 } 208 208 209 209 static void soc_cleanup_card_debugfs(struct snd_soc_card *card) ··· 687 687 688 688 /* Recheck all endpoints too, their state is affected by suspend */ 689 689 snd_soc_dapm_mark_endpoints_dirty(card); 690 - snd_soc_dapm_sync(&card->dapm); 690 + snd_soc_dapm_sync(snd_soc_card_to_dapm(card)); 691 691 692 692 /* suspend all COMPONENTs */ 693 693 for_each_card_rtds(card, rtd) { ··· 696 696 continue; 697 697 698 698 for_each_rtd_components(rtd, i, component) { 699 - struct snd_soc_dapm_context *dapm = 700 - snd_soc_component_get_dapm(component); 699 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 701 700 702 701 /* 703 702 * ignore if component was already suspended ··· 716 717 * means it's doing something, 717 718 * otherwise fall through. 718 719 */ 719 - if (!dapm->idle_bias) { 720 + if (!snd_soc_dapm_get_idle_bias(dapm)) { 720 721 dev_dbg(component->dev, 721 722 "ASoC: idle_bias_off CODEC on over suspend\n"); 722 723 break; ··· 783 784 784 785 /* Recheck all endpoints too, their state is affected by suspend */ 785 786 snd_soc_dapm_mark_endpoints_dirty(card); 786 - snd_soc_dapm_sync(&card->dapm); 787 + snd_soc_dapm_sync(snd_soc_card_to_dapm(card)); 787 788 788 789 /* userspace can access us now we are back as we were before */ 789 790 snd_power_change_state(card->snd_card, SNDRV_CTL_POWER_D0); ··· 1589 1590 snd_soc_component_remove(component); 1590 1591 1591 1592 list_del_init(&component->card_list); 1592 - snd_soc_dapm_free(snd_soc_component_get_dapm(component)); 1593 + snd_soc_dapm_free(snd_soc_component_to_dapm(component)); 1593 1594 soc_cleanup_component_debugfs(component); 1594 1595 component->card = NULL; 1595 1596 snd_soc_component_module_put_when_remove(component); ··· 1598 1599 static int soc_probe_component(struct snd_soc_card *card, 1599 1600 struct snd_soc_component *component) 1600 1601 { 1601 - struct snd_soc_dapm_context *dapm = 1602 - snd_soc_component_get_dapm(component); 1602 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1603 1603 struct snd_soc_dai *dai; 1604 1604 int probed = 0; 1605 1605 int ret; ··· 1650 1652 if (ret < 0) 1651 1653 goto err_probe; 1652 1654 1653 - WARN(!dapm->idle_bias && 1654 - dapm->bias_level != SND_SOC_BIAS_OFF, 1655 + WARN(!snd_soc_dapm_get_idle_bias(dapm) && 1656 + snd_soc_dapm_get_bias_level(dapm) != SND_SOC_BIAS_OFF, 1655 1657 "codec %s can not start from non-off bias with idle_bias_off==1\n", 1656 1658 component->name); 1657 1659 probed = 1; ··· 2128 2130 soc_remove_aux_devices(card); 2129 2131 soc_unbind_aux_dev(card); 2130 2132 2131 - snd_soc_dapm_free(&card->dapm); 2133 + snd_soc_dapm_free(snd_soc_card_to_dapm(card)); 2132 2134 soc_cleanup_card_debugfs(card); 2133 2135 2134 2136 /* remove the card */ ··· 2154 2156 { 2155 2157 struct snd_soc_pcm_runtime *rtd; 2156 2158 struct snd_soc_component *component; 2159 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 2157 2160 int ret; 2158 2161 2159 2162 snd_soc_card_mutex_lock_root(card); 2160 2163 snd_soc_fill_dummy_dai(card); 2161 2164 2162 - snd_soc_dapm_init(&card->dapm, card, NULL); 2165 + snd_soc_dapm_init(dapm, card, NULL); 2163 2166 2164 2167 /* check whether any platform is ignore machine FE and using topology */ 2165 2168 soc_check_tplg_fes(card); ··· 2190 2191 2191 2192 soc_resume_init(card); 2192 2193 2193 - ret = snd_soc_dapm_new_controls(&card->dapm, card->dapm_widgets, 2194 + ret = snd_soc_dapm_new_controls(dapm, card->dapm_widgets, 2194 2195 card->num_dapm_widgets); 2195 2196 if (ret < 0) 2196 2197 goto probe_end; 2197 2198 2198 - ret = snd_soc_dapm_new_controls(&card->dapm, card->of_dapm_widgets, 2199 + ret = snd_soc_dapm_new_controls(dapm, card->of_dapm_widgets, 2199 2200 card->num_of_dapm_widgets); 2200 2201 if (ret < 0) 2201 2202 goto probe_end; ··· 2245 2246 if (ret < 0) 2246 2247 goto probe_end; 2247 2248 2248 - ret = snd_soc_dapm_add_routes(&card->dapm, card->dapm_routes, 2249 + ret = snd_soc_dapm_add_routes(dapm, card->dapm_routes, 2249 2250 card->num_dapm_routes); 2250 2251 if (ret < 0) 2251 2252 goto probe_end; 2252 2253 2253 - ret = snd_soc_dapm_add_routes(&card->dapm, card->of_dapm_routes, 2254 + ret = snd_soc_dapm_add_routes(dapm, card->of_dapm_routes, 2254 2255 card->num_of_dapm_routes); 2255 2256 if (ret < 0) 2256 2257 goto probe_end; ··· 2294 2295 2295 2296 card->instantiated = 1; 2296 2297 snd_soc_dapm_mark_endpoints_dirty(card); 2297 - snd_soc_dapm_sync(&card->dapm); 2298 + snd_soc_dapm_sync(dapm); 2298 2299 2299 2300 /* deactivate pins to sleep state */ 2300 2301 for_each_card_components(card, component)