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

ASoC: convert to snd_soc_dapm_xxx()

Merge series from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:

This patch-set convert many functions to snd_soc_dapm_xxx().
This is preparation to move struct snd_soc_dapm_context into soc-dapm.c.

For backport easy, this patch-set is added for each drivers.

+1383 -1204
+5 -9
drivers/input/misc/arizona-haptics.c
··· 34 34 struct arizona_haptics, 35 35 work); 36 36 struct arizona *arizona = haptics->arizona; 37 - struct snd_soc_component *component = 38 - snd_soc_dapm_to_component(arizona->dapm); 39 37 int ret; 40 38 41 39 if (!haptics->arizona->dapm) { ··· 63 65 return; 64 66 } 65 67 66 - ret = snd_soc_component_enable_pin(component, "HAPTICS"); 68 + ret = snd_soc_dapm_enable_pin(arizona->dapm, "HAPTICS"); 67 69 if (ret != 0) { 68 70 dev_err(arizona->dev, "Failed to start HAPTICS: %d\n", 69 71 ret); ··· 78 80 } 79 81 } else { 80 82 /* This disable sequence will be a noop if already enabled */ 81 - ret = snd_soc_component_disable_pin(component, "HAPTICS"); 83 + ret = snd_soc_dapm_disable_pin(arizona->dapm, "HAPTICS"); 82 84 if (ret != 0) { 83 85 dev_err(arizona->dev, "Failed to disable HAPTICS: %d\n", 84 86 ret); ··· 137 139 static void arizona_haptics_close(struct input_dev *input) 138 140 { 139 141 struct arizona_haptics *haptics = input_get_drvdata(input); 140 - struct snd_soc_component *component; 142 + struct snd_soc_dapm_context *dapm = haptics->arizona->dapm; 141 143 142 144 cancel_work_sync(&haptics->work); 143 145 144 - if (haptics->arizona->dapm) { 145 - component = snd_soc_dapm_to_component(haptics->arizona->dapm); 146 - snd_soc_component_disable_pin(component, "HAPTICS"); 147 - } 146 + if (dapm) 147 + snd_soc_dapm_disable_pin(dapm, "HAPTICS"); 148 148 } 149 149 150 150 static int arizona_haptics_probe(struct platform_device *pdev)
+2 -6
drivers/regulator/arizona-micsupp.c
··· 48 48 struct arizona_micsupp *micsupp = 49 49 container_of(work, struct arizona_micsupp, check_cp_work); 50 50 struct snd_soc_dapm_context *dapm = *micsupp->dapm; 51 - struct snd_soc_component *component; 52 51 const struct regulator_desc *desc = micsupp->desc; 53 52 unsigned int val; 54 53 int ret; ··· 60 61 } 61 62 62 63 if (dapm) { 63 - component = snd_soc_dapm_to_component(dapm); 64 - 65 64 if ((val & (desc->enable_mask | desc->bypass_mask)) == 66 65 desc->enable_mask) 67 - snd_soc_component_force_enable_pin(component, 68 - "MICSUPP"); 66 + snd_soc_dapm_force_enable_pin(dapm, "MICSUPP"); 69 67 else 70 - snd_soc_component_disable_pin(component, "MICSUPP"); 68 + snd_soc_dapm_disable_pin(dapm, "MICSUPP"); 71 69 72 70 snd_soc_dapm_sync(dapm); 73 71 }
+11 -5
drivers/staging/greybus/audio_codec.c
··· 807 807 { 808 808 int ret; 809 809 struct snd_soc_component *comp; 810 + struct snd_soc_dapm_context *dapm; 810 811 struct gbaudio_jack *jack = NULL; 811 812 812 813 if (!gbcodec) { ··· 816 815 } 817 816 818 817 comp = gbcodec->component; 818 + dapm = snd_soc_component_to_dapm(comp); 819 819 820 820 mutex_lock(&gbcodec->register_mutex); 821 821 ··· 835 833 } 836 834 837 835 if (module->dapm_widgets) 838 - snd_soc_dapm_new_controls(&comp->dapm, module->dapm_widgets, 836 + snd_soc_dapm_new_controls(dapm, module->dapm_widgets, 839 837 module->num_dapm_widgets); 840 838 if (module->controls) 841 839 snd_soc_add_component_controls(comp, module->controls, 842 840 module->num_controls); 843 841 if (module->dapm_routes) 844 - snd_soc_dapm_add_routes(&comp->dapm, module->dapm_routes, 842 + snd_soc_dapm_add_routes(dapm, module->dapm_routes, 845 843 module->num_dapm_routes); 846 844 847 845 /* card already instantiated, create widgets here only */ 848 846 if (comp->card->instantiated) { 849 - gbaudio_dapm_link_component_dai_widgets(comp->card, &comp->dapm); 847 + gbaudio_dapm_link_component_dai_widgets(comp->card, dapm); 850 848 #ifdef CONFIG_SND_JACK 851 849 /* 852 850 * register jack devices for this module ··· 968 966 #endif 969 967 970 968 if (module->dapm_routes) { 969 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(comp); 970 + 971 971 dev_dbg(comp->dev, "Removing %d routes\n", 972 972 module->num_dapm_routes); 973 - snd_soc_dapm_del_routes(&comp->dapm, module->dapm_routes, 973 + snd_soc_dapm_del_routes(dapm, module->dapm_routes, 974 974 module->num_dapm_routes); 975 975 } 976 976 if (module->controls) { ··· 983 979 module->num_controls); 984 980 } 985 981 if (module->dapm_widgets) { 982 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(comp); 983 + 986 984 dev_dbg(comp->dev, "Removing %d widgets\n", 987 985 module->num_dapm_widgets); 988 - gbaudio_dapm_free_controls(&comp->dapm, module->dapm_widgets, 986 + gbaudio_dapm_free_controls(dapm, module->dapm_widgets, 989 987 module->num_dapm_widgets); 990 988 } 991 989
+5 -4
drivers/staging/greybus/audio_helper.c
··· 115 115 { 116 116 int i; 117 117 struct snd_soc_dapm_widget *w, *tmp_w; 118 + struct snd_soc_card *card = snd_soc_dapm_to_card(dapm); 118 119 119 - mutex_lock(&dapm->card->dapm_mutex); 120 + mutex_lock(&card->dapm_mutex); 120 121 for (i = 0; i < num; i++) { 121 122 /* below logic can be optimized to identify widget pointer */ 122 123 w = NULL; 123 - list_for_each_entry(tmp_w, &dapm->card->widgets, list) { 124 + list_for_each_entry(tmp_w, &card->widgets, list) { 124 125 if (tmp_w->dapm == dapm && 125 126 !strcmp(tmp_w->name, widget->name)) { 126 127 w = tmp_w; ··· 129 128 } 130 129 } 131 130 if (!w) { 132 - dev_err(dapm->dev, "%s: widget not found\n", 131 + dev_err(card->dev, "%s: widget not found\n", 133 132 widget->name); 134 133 widget++; 135 134 continue; ··· 137 136 widget++; 138 137 gbaudio_dapm_free_widget(w); 139 138 } 140 - mutex_unlock(&dapm->card->dapm_mutex); 139 + mutex_unlock(&card->dapm_mutex); 141 140 return 0; 142 141 } 143 142
+7 -7
drivers/staging/greybus/audio_topology.c
··· 380 380 struct gbaudio_module_info *module; 381 381 struct snd_soc_dapm_widget_list *wlist = snd_kcontrol_chip(kcontrol); 382 382 struct snd_soc_dapm_widget *widget = wlist->widgets[0]; 383 - struct device *codec_dev = widget->dapm->dev; 383 + struct device *codec_dev = snd_soc_dapm_to_dev(widget->dapm); 384 384 struct gbaudio_codec_info *gb = dev_get_drvdata(codec_dev); 385 385 struct gb_bundle *bundle; 386 386 ··· 393 393 bundle = to_gb_bundle(module->dev); 394 394 395 395 if (data->vcount == 2) 396 - dev_warn(widget->dapm->dev, 396 + dev_warn(codec_dev, 397 397 "GB: Control '%s' is stereo, which is not supported\n", 398 398 kcontrol->id.name); 399 399 ··· 429 429 struct gbaudio_module_info *module; 430 430 struct snd_soc_dapm_widget_list *wlist = snd_kcontrol_chip(kcontrol); 431 431 struct snd_soc_dapm_widget *widget = wlist->widgets[0]; 432 - struct device *codec_dev = widget->dapm->dev; 432 + struct device *codec_dev = snd_soc_dapm_to_dev(widget->dapm); 433 433 struct gbaudio_codec_info *gb = dev_get_drvdata(codec_dev); 434 434 struct gb_bundle *bundle; 435 435 ··· 443 443 bundle = to_gb_bundle(module->dev); 444 444 445 445 if (data->vcount == 2) 446 - dev_warn(widget->dapm->dev, 446 + dev_warn(codec_dev, 447 447 "GB: Control '%s' is stereo, which is not supported\n", 448 448 kcontrol->id.name); 449 449 ··· 712 712 struct snd_soc_dapm_widget *widget = wlist->widgets[0]; 713 713 struct gbaudio_module_info *module; 714 714 struct gb_audio_ctl_elem_value gbvalue; 715 - struct device *codec_dev = widget->dapm->dev; 715 + struct device *codec_dev = snd_soc_dapm_to_dev(widget->dapm); 716 716 struct gbaudio_codec_info *gb = dev_get_drvdata(codec_dev); 717 717 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; 718 718 struct gb_bundle *bundle; ··· 759 759 struct snd_soc_dapm_widget *widget = wlist->widgets[0]; 760 760 struct gb_audio_ctl_elem_value gbvalue; 761 761 struct gbaudio_module_info *module; 762 - struct device *codec_dev = widget->dapm->dev; 762 + struct device *codec_dev = snd_soc_dapm_to_dev(widget->dapm); 763 763 struct gbaudio_codec_info *gb = dev_get_drvdata(codec_dev); 764 764 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; 765 765 struct gb_bundle *bundle; ··· 924 924 { 925 925 int wid; 926 926 int ret; 927 - struct device *codec_dev = w->dapm->dev; 927 + struct device *codec_dev = snd_soc_dapm_to_dev(w->dapm); 928 928 struct gbaudio_codec_info *gbcodec = dev_get_drvdata(codec_dev); 929 929 struct gbaudio_module_info *module; 930 930 struct gb_bundle *bundle;
+4 -4
include/sound/soc.h
··· 1467 1467 1468 1468 static inline void _snd_soc_dapm_mutex_lock_root_d(struct snd_soc_dapm_context *dapm) 1469 1469 { 1470 - _snd_soc_dapm_mutex_lock_root_c(dapm->card); 1470 + _snd_soc_dapm_mutex_lock_root_c(snd_soc_dapm_to_card(dapm)); 1471 1471 } 1472 1472 1473 1473 static inline void _snd_soc_dapm_mutex_lock_d(struct snd_soc_dapm_context *dapm) 1474 1474 { 1475 - _snd_soc_dapm_mutex_lock_c(dapm->card); 1475 + _snd_soc_dapm_mutex_lock_c(snd_soc_dapm_to_card(dapm)); 1476 1476 } 1477 1477 1478 1478 static inline void _snd_soc_dapm_mutex_unlock_d(struct snd_soc_dapm_context *dapm) 1479 1479 { 1480 - _snd_soc_dapm_mutex_unlock_c(dapm->card); 1480 + _snd_soc_dapm_mutex_unlock_c(snd_soc_dapm_to_card(dapm)); 1481 1481 } 1482 1482 1483 1483 static inline void _snd_soc_dapm_mutex_assert_held_d(struct snd_soc_dapm_context *dapm) 1484 1484 { 1485 - _snd_soc_dapm_mutex_assert_held_c(dapm->card); 1485 + _snd_soc_dapm_mutex_assert_held_c(snd_soc_dapm_to_card(dapm)); 1486 1486 } 1487 1487 1488 1488 #define snd_soc_dapm_mutex_lock_root(x) _Generic((x), \
+2 -2
include/trace/events/asoc.h
··· 27 27 TP_ARGS(dapm, val), 28 28 29 29 TP_STRUCT__entry( 30 - __string( card_name, dapm->card->name) 31 - __string( comp_name, dapm->component ? dapm->component->name : "(none)") 30 + __string( card_name, snd_soc_dapm_to_card(dapm)->name) 31 + __string( comp_name, snd_soc_dapm_to_component(dapm) ? snd_soc_dapm_to_component(dapm)->name : "(none)") 32 32 __field( int, val) 33 33 ), 34 34
+23 -17
sound/soc/amd/acp/acp-mach-common.c
··· 116 116 static int acp_card_rt5682_init(struct snd_soc_pcm_runtime *rtd) 117 117 { 118 118 struct snd_soc_card *card = rtd->card; 119 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 119 120 struct acp_card_drvdata *drvdata = card->drvdata; 120 121 struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, 0); 121 122 struct snd_soc_component *component = codec_dai->component; ··· 130 129 drvdata->wclk = clk_get(component->dev, "rt5682-dai-wclk"); 131 130 drvdata->bclk = clk_get(component->dev, "rt5682-dai-bclk"); 132 131 133 - ret = snd_soc_dapm_new_controls(&card->dapm, rt5682_widgets, 132 + ret = snd_soc_dapm_new_controls(dapm, rt5682_widgets, 134 133 ARRAY_SIZE(rt5682_widgets)); 135 134 if (ret) { 136 135 dev_err(rtd->dev, "unable to add widget dapm controls, ret %d\n", ret); ··· 167 166 return ret; 168 167 } 169 168 170 - return snd_soc_dapm_add_routes(&rtd->card->dapm, rt5682_map, ARRAY_SIZE(rt5682_map)); 169 + return snd_soc_dapm_add_routes(dapm, rt5682_map, ARRAY_SIZE(rt5682_map)); 171 170 } 172 171 173 172 static int acp_card_hs_startup(struct snd_pcm_substream *substream) ··· 358 357 static int acp_card_rt5682s_init(struct snd_soc_pcm_runtime *rtd) 359 358 { 360 359 struct snd_soc_card *card = rtd->card; 360 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 361 361 struct acp_card_drvdata *drvdata = card->drvdata; 362 362 struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, 0); 363 363 struct snd_soc_component *component = codec_dai->component; ··· 374 372 drvdata->bclk = clk_get(component->dev, "rt5682-dai-bclk"); 375 373 } 376 374 377 - ret = snd_soc_dapm_new_controls(&card->dapm, rt5682s_widgets, 375 + ret = snd_soc_dapm_new_controls(dapm, rt5682s_widgets, 378 376 ARRAY_SIZE(rt5682s_widgets)); 379 377 if (ret) { 380 378 dev_err(rtd->dev, "unable to add widget dapm controls, ret %d\n", ret); ··· 411 409 return ret; 412 410 } 413 411 414 - return snd_soc_dapm_add_routes(&rtd->card->dapm, rt5682s_map, ARRAY_SIZE(rt5682s_map)); 412 + return snd_soc_dapm_add_routes(dapm, rt5682s_map, ARRAY_SIZE(rt5682s_map)); 415 413 } 416 414 417 415 static int acp_card_rt5682s_hw_params(struct snd_pcm_substream *substream, ··· 583 581 static int acp_card_rt1019_init(struct snd_soc_pcm_runtime *rtd) 584 582 { 585 583 struct snd_soc_card *card = rtd->card; 584 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 586 585 struct acp_card_drvdata *drvdata = card->drvdata; 587 586 int ret; 588 587 589 588 if (drvdata->amp_codec_id != RT1019) 590 589 return -EINVAL; 591 590 592 - ret = snd_soc_dapm_new_controls(&card->dapm, rt1019_widgets, 591 + ret = snd_soc_dapm_new_controls(dapm, rt1019_widgets, 593 592 ARRAY_SIZE(rt1019_widgets)); 594 593 if (ret) { 595 594 dev_err(rtd->dev, "unable to add widget dapm controls, ret %d\n", ret); ··· 604 601 return ret; 605 602 } 606 603 607 - return snd_soc_dapm_add_routes(&rtd->card->dapm, rt1019_map_lr, 604 + return snd_soc_dapm_add_routes(dapm, rt1019_map_lr, 608 605 ARRAY_SIZE(rt1019_map_lr)); 609 606 } 610 607 ··· 749 746 static int acp_card_maxim_init(struct snd_soc_pcm_runtime *rtd) 750 747 { 751 748 struct snd_soc_card *card = rtd->card; 749 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 752 750 struct acp_card_drvdata *drvdata = card->drvdata; 753 751 int ret; 754 752 755 753 if (drvdata->amp_codec_id != MAX98360A) 756 754 return -EINVAL; 757 755 758 - ret = snd_soc_dapm_new_controls(&card->dapm, max98360a_widgets, 756 + ret = snd_soc_dapm_new_controls(dapm, max98360a_widgets, 759 757 ARRAY_SIZE(max98360a_widgets)); 760 758 if (ret) { 761 759 dev_err(rtd->dev, "unable to add widget dapm controls, ret %d\n", ret); ··· 770 766 return ret; 771 767 } 772 768 773 - return snd_soc_dapm_add_routes(&rtd->card->dapm, max98360a_map, 769 + return snd_soc_dapm_add_routes(dapm, max98360a_map, 774 770 ARRAY_SIZE(max98360a_map)); 775 771 } 776 772 ··· 886 882 static int acp_card_max98388_init(struct snd_soc_pcm_runtime *rtd) 887 883 { 888 884 struct snd_soc_card *card = rtd->card; 885 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 889 886 struct acp_card_drvdata *drvdata = card->drvdata; 890 887 int ret; 891 888 892 889 if (drvdata->amp_codec_id != MAX98388) 893 890 return -EINVAL; 894 891 895 - ret = snd_soc_dapm_new_controls(&card->dapm, max98388_widgets, 892 + ret = snd_soc_dapm_new_controls(dapm, max98388_widgets, 896 893 ARRAY_SIZE(max98388_widgets)); 897 894 898 895 if (ret) { ··· 909 904 return ret; 910 905 } 911 906 912 - return snd_soc_dapm_add_routes(&rtd->card->dapm, max98388_map, 907 + return snd_soc_dapm_add_routes(dapm, max98388_map, 913 908 ARRAY_SIZE(max98388_map)); 914 909 } 915 910 ··· 971 966 static int acp_card_nau8825_init(struct snd_soc_pcm_runtime *rtd) 972 967 { 973 968 struct snd_soc_card *card = rtd->card; 969 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 974 970 struct acp_card_drvdata *drvdata = card->drvdata; 975 971 struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, 0); 976 972 struct snd_soc_component *component = codec_dai->component; ··· 982 976 if (drvdata->hs_codec_id != NAU8825) 983 977 return -EINVAL; 984 978 985 - ret = snd_soc_dapm_new_controls(&card->dapm, nau8825_widgets, 979 + ret = snd_soc_dapm_new_controls(dapm, nau8825_widgets, 986 980 ARRAY_SIZE(nau8825_widgets)); 987 981 if (ret) { 988 982 dev_err(rtd->dev, "unable to add widget dapm controls, ret %d\n", ret); ··· 1019 1013 return ret; 1020 1014 } 1021 1015 1022 - return snd_soc_dapm_add_routes(&rtd->card->dapm, nau8825_map, ARRAY_SIZE(nau8825_map)); 1016 + return snd_soc_dapm_add_routes(dapm, nau8825_map, ARRAY_SIZE(nau8825_map)); 1023 1017 } 1024 1018 1025 1019 static int acp_nau8825_hw_params(struct snd_pcm_substream *substream, ··· 1108 1102 static int platform_clock_control(struct snd_soc_dapm_widget *w, 1109 1103 struct snd_kcontrol *k, int event) 1110 1104 { 1111 - struct snd_soc_dapm_context *dapm = w->dapm; 1112 - struct snd_soc_card *card = dapm->card; 1105 + struct snd_soc_card *card = snd_soc_dapm_to_card(w->dapm); 1113 1106 struct snd_soc_dai *codec_dai; 1114 1107 int ret = 0; 1115 1108 ··· 1186 1181 static int acp_8821_init(struct snd_soc_pcm_runtime *rtd) 1187 1182 { 1188 1183 struct snd_soc_card *card = rtd->card; 1184 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 1189 1185 struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, 0); 1190 1186 struct snd_soc_component *component = codec_dai->component; 1191 1187 int ret; 1192 1188 1193 1189 dev_info(rtd->dev, "codec dai name = %s\n", codec_dai->name); 1194 1190 1195 - ret = snd_soc_dapm_new_controls(&card->dapm, nau8821_widgets, 1191 + ret = snd_soc_dapm_new_controls(dapm, nau8821_widgets, 1196 1192 ARRAY_SIZE(nau8821_widgets)); 1197 1193 if (ret) { 1198 1194 dev_err(rtd->dev, "unable to add widget dapm controls, ret %d\n", ret); ··· 1227 1221 1228 1222 nau8821_enable_jack_detect(component, &nau8821_jack); 1229 1223 1230 - return snd_soc_dapm_add_routes(&rtd->card->dapm, nau8821_audio_route, 1224 + return snd_soc_dapm_add_routes(dapm, nau8821_audio_route, 1231 1225 ARRAY_SIZE(nau8821_audio_route)); 1232 1226 } 1233 1227 ··· 1346 1340 struct snd_soc_dapm_context *dapm, 1347 1341 enum snd_soc_bias_level level) 1348 1342 { 1349 - struct snd_soc_component *component = dapm->component; 1343 + struct snd_soc_component *component = snd_soc_dapm_to_component(dapm); 1350 1344 struct acp_card_drvdata *drvdata = card->drvdata; 1351 1345 int ret = 0; 1352 1346
+7 -3
sound/soc/amd/acp/acp3x-es83xx/acp3x-es83xx.c
··· 159 159 static int acp3x_es83xx_headphone_power_event(struct snd_soc_dapm_widget *w, 160 160 struct snd_kcontrol *kcontrol, int event) 161 161 { 162 - struct acp3x_es83xx_private *priv = get_mach_priv(w->dapm->card); 162 + struct snd_soc_card *card = snd_soc_dapm_to_card(w->dapm); 163 + struct acp3x_es83xx_private *priv = get_mach_priv(card); 163 164 164 165 dev_dbg(priv->codec_dev, "headphone power event = %d\n", event); 165 166 if (SND_SOC_DAPM_EVENT_ON(event)) ··· 177 176 static int acp3x_es83xx_speaker_power_event(struct snd_soc_dapm_widget *w, 178 177 struct snd_kcontrol *kcontrol, int event) 179 178 { 180 - struct acp3x_es83xx_private *priv = get_mach_priv(w->dapm->card); 179 + struct snd_soc_card *card = snd_soc_dapm_to_card(w->dapm); 180 + struct acp3x_es83xx_private *priv = get_mach_priv(card); 181 181 182 182 dev_dbg(priv->codec_dev, "speaker power event: %d\n", event); 183 183 if (SND_SOC_DAPM_EVENT_ON(event)) ··· 316 314 317 315 num_routes = acp3x_es83xx_configure_mics(priv); 318 316 if (num_routes > 0) { 319 - ret = snd_soc_dapm_add_routes(&card->dapm, priv->mic_map, num_routes); 317 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 318 + 319 + ret = snd_soc_dapm_add_routes(dapm, priv->mic_map, num_routes); 320 320 if (ret != 0) 321 321 device_remove_software_node(priv->codec_dev); 322 322 }
+1 -2
sound/soc/amd/vangogh/acp5x-mach.c
··· 61 61 static int platform_clock_control(struct snd_soc_dapm_widget *w, 62 62 struct snd_kcontrol *k, int event) 63 63 { 64 - struct snd_soc_dapm_context *dapm = w->dapm; 65 - struct snd_soc_card *card = dapm->card; 64 + struct snd_soc_card *card = snd_soc_dapm_to_card(w->dapm); 66 65 struct snd_soc_dai *dai; 67 66 int ret = 0; 68 67
+1 -1
sound/soc/atmel/sam9g20_wm8731.c
··· 80 80 } 81 81 82 82 #ifndef ENABLE_MIC_INPUT 83 - snd_soc_dapm_nc_pin(&rtd->card->dapm, "Int Mic"); 83 + snd_soc_dapm_disable_pin(snd_soc_card_to_dapm(rtd->card), "Int Mic"); 84 84 #endif 85 85 86 86 return 0;
+16 -16
sound/soc/atmel/tse850-pcm5142.c
··· 58 58 static int tse850_get_mux1(struct snd_kcontrol *kctrl, 59 59 struct snd_ctl_elem_value *ucontrol) 60 60 { 61 - struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_dapm(kctrl); 62 - struct snd_soc_card *card = dapm->card; 61 + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kctrl); 62 + struct snd_soc_card *card = snd_soc_dapm_to_card(dapm); 63 63 struct tse850_priv *tse850 = snd_soc_card_get_drvdata(card); 64 64 65 65 ucontrol->value.enumerated.item[0] = tse850->loop1_cache; ··· 70 70 static int tse850_put_mux1(struct snd_kcontrol *kctrl, 71 71 struct snd_ctl_elem_value *ucontrol) 72 72 { 73 - struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_dapm(kctrl); 74 - struct snd_soc_card *card = dapm->card; 73 + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kctrl); 74 + struct snd_soc_card *card = snd_soc_dapm_to_card(dapm); 75 75 struct tse850_priv *tse850 = snd_soc_card_get_drvdata(card); 76 76 struct soc_enum *e = (struct soc_enum *)kctrl->private_value; 77 77 unsigned int val = ucontrol->value.enumerated.item[0]; ··· 88 88 static int tse850_get_mux2(struct snd_kcontrol *kctrl, 89 89 struct snd_ctl_elem_value *ucontrol) 90 90 { 91 - struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_dapm(kctrl); 92 - struct snd_soc_card *card = dapm->card; 91 + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kctrl); 92 + struct snd_soc_card *card = snd_soc_dapm_to_card(dapm); 93 93 struct tse850_priv *tse850 = snd_soc_card_get_drvdata(card); 94 94 95 95 ucontrol->value.enumerated.item[0] = tse850->loop2_cache; ··· 100 100 static int tse850_put_mux2(struct snd_kcontrol *kctrl, 101 101 struct snd_ctl_elem_value *ucontrol) 102 102 { 103 - struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_dapm(kctrl); 104 - struct snd_soc_card *card = dapm->card; 103 + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kctrl); 104 + struct snd_soc_card *card = snd_soc_dapm_to_card(dapm); 105 105 struct tse850_priv *tse850 = snd_soc_card_get_drvdata(card); 106 106 struct soc_enum *e = (struct soc_enum *)kctrl->private_value; 107 107 unsigned int val = ucontrol->value.enumerated.item[0]; ··· 118 118 static int tse850_get_mix(struct snd_kcontrol *kctrl, 119 119 struct snd_ctl_elem_value *ucontrol) 120 120 { 121 - struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_dapm(kctrl); 122 - struct snd_soc_card *card = dapm->card; 121 + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kctrl); 122 + struct snd_soc_card *card = snd_soc_dapm_to_card(dapm); 123 123 struct tse850_priv *tse850 = snd_soc_card_get_drvdata(card); 124 124 125 125 ucontrol->value.enumerated.item[0] = tse850->add_cache; ··· 130 130 static int tse850_put_mix(struct snd_kcontrol *kctrl, 131 131 struct snd_ctl_elem_value *ucontrol) 132 132 { 133 - struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_dapm(kctrl); 134 - struct snd_soc_card *card = dapm->card; 133 + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kctrl); 134 + struct snd_soc_card *card = snd_soc_dapm_to_card(dapm); 135 135 struct tse850_priv *tse850 = snd_soc_card_get_drvdata(card); 136 136 int connect = !!ucontrol->value.integer.value[0]; 137 137 ··· 152 152 static int tse850_get_ana(struct snd_kcontrol *kctrl, 153 153 struct snd_ctl_elem_value *ucontrol) 154 154 { 155 - struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_dapm(kctrl); 156 - struct snd_soc_card *card = dapm->card; 155 + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kctrl); 156 + struct snd_soc_card *card = snd_soc_dapm_to_card(dapm); 157 157 struct tse850_priv *tse850 = snd_soc_card_get_drvdata(card); 158 158 int ret; 159 159 ··· 185 185 static int tse850_put_ana(struct snd_kcontrol *kctrl, 186 186 struct snd_ctl_elem_value *ucontrol) 187 187 { 188 - struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_dapm(kctrl); 189 - struct snd_soc_card *card = dapm->card; 188 + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kctrl); 189 + struct snd_soc_card *card = snd_soc_dapm_to_card(dapm); 190 190 struct tse850_priv *tse850 = snd_soc_card_get_drvdata(card); 191 191 struct soc_enum *e = (struct soc_enum *)kctrl->private_value; 192 192 unsigned int uV = ucontrol->value.enumerated.item[0];
+2 -1
sound/soc/codecs/88pm860x-codec.c
··· 1106 1106 enum snd_soc_bias_level level) 1107 1107 { 1108 1108 struct pm860x_priv *pm860x = snd_soc_component_get_drvdata(component); 1109 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1109 1110 int data; 1110 1111 1111 1112 switch (level) { ··· 1117 1116 break; 1118 1117 1119 1118 case SND_SOC_BIAS_STANDBY: 1120 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { 1119 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) { 1121 1120 /* Enable Audio PLL & Audio section */ 1122 1121 data = AUDIO_PLL | AUDIO_SECTION_ON; 1123 1122 pm860x_reg_write(pm860x->i2c, REG_MISC2, data);
+3 -3
sound/soc/codecs/ab8500-codec.c
··· 1197 1197 struct snd_ctl_elem_value *ucontrol) 1198 1198 { 1199 1199 struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 1200 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 1200 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1201 1201 struct ab8500_codec_drvdata *drvdata = dev_get_drvdata(component->dev); 1202 1202 struct device *dev = component->dev; 1203 1203 bool apply_fir, apply_iir; ··· 1934 1934 static int ab8500_audio_setup_mics(struct snd_soc_component *component, 1935 1935 struct amic_settings *amics) 1936 1936 { 1937 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 1937 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1938 1938 u8 value8; 1939 1939 unsigned int value; 1940 1940 int status; ··· 2449 2449 2450 2450 static int ab8500_codec_probe(struct snd_soc_component *component) 2451 2451 { 2452 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 2452 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 2453 2453 struct device *dev = component->dev; 2454 2454 struct device_node *np = dev->of_node; 2455 2455 struct ab8500_codec_drvdata *drvdata = dev_get_drvdata(dev);
+1 -1
sound/soc/codecs/ad1836.c
··· 250 250 static int ad1836_probe(struct snd_soc_component *component) 251 251 { 252 252 struct ad1836_priv *ad1836 = snd_soc_component_get_drvdata(component); 253 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 253 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 254 254 int num_dacs, num_adcs; 255 255 int ret = 0; 256 256 int i;
+2 -2
sound/soc/codecs/ad193x.c
··· 282 282 int clk_id, unsigned int freq, int dir) 283 283 { 284 284 struct snd_soc_component *component = codec_dai->component; 285 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 285 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 286 286 struct ad193x_priv *ad193x = snd_soc_component_get_drvdata(component); 287 287 288 288 if (clk_id == AD193X_SYSCLK_MCLK) { ··· 476 476 static int ad193x_component_probe(struct snd_soc_component *component) 477 477 { 478 478 struct ad193x_priv *ad193x = snd_soc_component_get_drvdata(component); 479 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 479 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 480 480 int num, ret; 481 481 482 482 /* default setting for ad193x */
+5 -4
sound/soc/codecs/adau1761.c
··· 621 621 enum snd_soc_bias_level level) 622 622 { 623 623 struct adau *adau = snd_soc_component_get_drvdata(component); 624 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 624 625 625 626 switch (level) { 626 627 case SND_SOC_BIAS_ON: ··· 633 632 regmap_update_bits(adau->regmap, ADAU17X1_CLOCK_CONTROL, 634 633 ADAU17X1_CLOCK_CONTROL_SYSCLK_EN, 635 634 ADAU17X1_CLOCK_CONTROL_SYSCLK_EN); 636 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) 635 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) 637 636 regcache_sync(adau->regmap); 638 637 break; 639 638 case SND_SOC_BIAS_OFF: ··· 659 658 660 659 static int adau1761_setup_digmic_jackdetect(struct snd_soc_component *component) 661 660 { 662 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 661 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 663 662 struct adau1761_platform_data *pdata = component->dev->platform_data; 664 663 struct adau *adau = snd_soc_component_get_drvdata(component); 665 664 enum adau1761_digmic_jackdet_pin_mode mode; ··· 722 721 723 722 static int adau1761_setup_headphone_mode(struct snd_soc_component *component) 724 723 { 725 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 724 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 726 725 struct adau *adau = snd_soc_component_get_drvdata(component); 727 726 struct adau1761_platform_data *pdata = component->dev->platform_data; 728 727 enum adau1761_output_mode mode; ··· 820 819 821 820 static int adau1761_component_probe(struct snd_soc_component *component) 822 821 { 823 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 822 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 824 823 struct adau1761_platform_data *pdata = component->dev->platform_data; 825 824 struct adau *adau = snd_soc_component_get_drvdata(component); 826 825 int ret;
+1 -1
sound/soc/codecs/adau1781.c
··· 381 381 382 382 static int adau1781_component_probe(struct snd_soc_component *component) 383 383 { 384 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 384 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 385 385 struct adau1781_platform_data *pdata = dev_get_platdata(component->dev); 386 386 struct adau *adau = snd_soc_component_get_drvdata(component); 387 387 int ret;
+7 -7
sound/soc/codecs/adau17x1.c
··· 185 185 static int adau17x1_dsp_mux_enum_put(struct snd_kcontrol *kcontrol, 186 186 struct snd_ctl_elem_value *ucontrol) 187 187 { 188 - struct snd_soc_component *component = snd_soc_dapm_kcontrol_component(kcontrol); 189 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 188 + struct snd_soc_component *component = snd_soc_dapm_kcontrol_to_component(kcontrol); 189 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 190 190 struct adau *adau = snd_soc_component_get_drvdata(component); 191 191 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; 192 192 struct snd_soc_dapm_update update = {}; ··· 230 230 static int adau17x1_dsp_mux_enum_get(struct snd_kcontrol *kcontrol, 231 231 struct snd_ctl_elem_value *ucontrol) 232 232 { 233 - struct snd_soc_component *component = snd_soc_dapm_kcontrol_component(kcontrol); 233 + struct snd_soc_component *component = snd_soc_dapm_kcontrol_to_component(kcontrol); 234 234 struct adau *adau = snd_soc_component_get_drvdata(component); 235 235 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; 236 236 unsigned int stream = e->shift_l; ··· 383 383 static int adau17x1_set_dai_sysclk(struct snd_soc_dai *dai, 384 384 int clk_id, unsigned int freq, int dir) 385 385 { 386 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(dai->component); 386 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(dai->component); 387 387 struct adau *adau = snd_soc_component_get_drvdata(dai->component); 388 388 bool is_pll; 389 389 bool was_pll; ··· 881 881 int ret; 882 882 int dspsr, dsp_run; 883 883 struct adau *adau = snd_soc_component_get_drvdata(component); 884 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 884 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 885 885 886 886 /* Check if sample rate is the same as before. If it is there is no 887 887 * point in performing the below steps as the call to ··· 922 922 923 923 int adau17x1_add_widgets(struct snd_soc_component *component) 924 924 { 925 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 925 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 926 926 struct adau *adau = snd_soc_component_get_drvdata(component); 927 927 int ret; 928 928 ··· 958 958 959 959 int adau17x1_add_routes(struct snd_soc_component *component) 960 960 { 961 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 961 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 962 962 struct adau *adau = snd_soc_component_get_drvdata(component); 963 963 int ret; 964 964
+3 -2
sound/soc/codecs/adau1977.c
··· 473 473 enum snd_soc_bias_level level) 474 474 { 475 475 struct adau1977 *adau1977 = snd_soc_component_get_drvdata(component); 476 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 476 477 int ret = 0; 477 478 478 479 switch (level) { ··· 482 481 case SND_SOC_BIAS_PREPARE: 483 482 break; 484 483 case SND_SOC_BIAS_STANDBY: 485 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) 484 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) 486 485 ret = adau1977_power_enable(adau1977); 487 486 break; 488 487 case SND_SOC_BIAS_OFF: ··· 846 845 847 846 static int adau1977_component_probe(struct snd_soc_component *component) 848 847 { 849 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 848 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 850 849 struct adau1977 *adau1977 = snd_soc_component_get_drvdata(component); 851 850 int ret; 852 851
+3 -4
sound/soc/codecs/adau7118.c
··· 335 335 enum snd_soc_bias_level level) 336 336 { 337 337 struct adau7118_data *st = snd_soc_component_get_drvdata(component); 338 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 338 339 int ret = 0; 339 340 340 341 dev_dbg(st->dev, "Set bias level %d\n", level); ··· 346 345 break; 347 346 348 347 case SND_SOC_BIAS_STANDBY: 349 - if (snd_soc_component_get_bias_level(component) == 350 - SND_SOC_BIAS_OFF) { 348 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) { 351 349 /* power on */ 352 350 ret = regulator_enable(st->iovdd); 353 351 if (ret) ··· 393 393 static int adau7118_component_probe(struct snd_soc_component *component) 394 394 { 395 395 struct adau7118_data *st = snd_soc_component_get_drvdata(component); 396 - struct snd_soc_dapm_context *dapm = 397 - snd_soc_component_get_dapm(component); 396 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 398 397 int ret = 0; 399 398 400 399 if (st->hw_mode) {
+3 -3
sound/soc/codecs/adav80x.c
··· 539 539 unsigned int freq, int dir) 540 540 { 541 541 struct adav80x *adav80x = snd_soc_component_get_drvdata(component); 542 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 542 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 543 543 544 544 if (dir == SND_SOC_CLOCK_IN) { 545 545 switch (clk_id) { ··· 622 622 static int adav80x_set_pll(struct snd_soc_component *component, int pll_id, 623 623 int source, unsigned int freq_in, unsigned int freq_out) 624 624 { 625 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 625 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 626 626 struct adav80x *adav80x = snd_soc_component_get_drvdata(component); 627 627 unsigned int pll_ctrl1 = 0; 628 628 unsigned int pll_ctrl2 = 0; ··· 802 802 803 803 static int adav80x_probe(struct snd_soc_component *component) 804 804 { 805 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 805 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 806 806 struct adav80x *adav80x = snd_soc_component_get_drvdata(component); 807 807 808 808 /* Force PLLs on for SYSCLK output */
+2 -1
sound/soc/codecs/ak4641.c
··· 415 415 static int ak4641_set_bias_level(struct snd_soc_component *component, 416 416 enum snd_soc_bias_level level) 417 417 { 418 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 418 419 struct ak4641_priv *ak4641 = snd_soc_component_get_drvdata(component); 419 420 struct ak4641_platform_data *pdata = component->dev->platform_data; 420 421 int ret; ··· 430 429 snd_soc_component_update_bits(component, AK4641_DAC, 0x20, 0x20); 431 430 break; 432 431 case SND_SOC_BIAS_STANDBY: 433 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { 432 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) { 434 433 if (pdata && gpio_is_valid(pdata->gpio_power)) 435 434 gpio_set_value(pdata->gpio_power, 1); 436 435 mdelay(1);
+1 -1
sound/soc/codecs/alc5623.c
··· 888 888 static int alc5623_probe(struct snd_soc_component *component) 889 889 { 890 890 struct alc5623_priv *alc5623 = snd_soc_component_get_drvdata(component); 891 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 891 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 892 892 893 893 alc5623_reset(component); 894 894
+3 -5
sound/soc/codecs/arizona-jack.c
··· 212 212 struct arizona *arizona = info->arizona; 213 213 const char *widget = arizona_extcon_get_micbias(info); 214 214 struct snd_soc_dapm_context *dapm = arizona->dapm; 215 - struct snd_soc_component *component = snd_soc_dapm_to_component(dapm); 216 215 int ret; 217 216 218 - ret = snd_soc_component_force_enable_pin(component, widget); 217 + ret = snd_soc_dapm_force_enable_pin(dapm, widget); 219 218 if (ret) 220 219 dev_warn(arizona->dev, "Failed to enable %s: %d\n", widget, ret); 221 220 222 221 snd_soc_dapm_sync(dapm); 223 222 224 223 if (!arizona->pdata.micd_force_micbias) { 225 - ret = snd_soc_component_disable_pin(component, widget); 224 + ret = snd_soc_dapm_disable_pin(dapm, widget); 226 225 if (ret) 227 226 dev_warn(arizona->dev, "Failed to disable %s: %d\n", widget, ret); 228 227 ··· 286 287 struct arizona *arizona = info->arizona; 287 288 const char *widget = arizona_extcon_get_micbias(info); 288 289 struct snd_soc_dapm_context *dapm = arizona->dapm; 289 - struct snd_soc_component *component = snd_soc_dapm_to_component(dapm); 290 290 bool change = false; 291 291 int ret; 292 292 ··· 295 297 if (ret < 0) 296 298 dev_err(arizona->dev, "Failed to disable micd: %d\n", ret); 297 299 298 - ret = snd_soc_component_disable_pin(component, widget); 300 + ret = snd_soc_dapm_disable_pin(dapm, widget); 299 301 if (ret) 300 302 dev_warn(arizona->dev, "Failed to disable %s: %d\n", widget, ret); 301 303
+1 -1
sound/soc/codecs/audio-iio-aux.c
··· 131 131 static int audio_iio_aux_add_dapms(struct snd_soc_component *component, 132 132 struct audio_iio_aux_chan *chan) 133 133 { 134 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 134 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 135 135 int ret; 136 136 137 137 /* Allocated names are not needed afterwards (duplicated in ASoC internals) */
+1 -1
sound/soc/codecs/aw88261.c
··· 1131 1131 1132 1132 static int aw88261_codec_probe(struct snd_soc_component *component) 1133 1133 { 1134 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 1134 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1135 1135 struct aw88261 *aw88261 = snd_soc_component_get_drvdata(component); 1136 1136 int ret; 1137 1137
+1 -1
sound/soc/codecs/aw88395/aw88395.c
··· 401 401 402 402 static int aw88395_codec_probe(struct snd_soc_component *component) 403 403 { 404 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 404 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 405 405 struct aw88395 *aw88395 = snd_soc_component_get_drvdata(component); 406 406 int ret; 407 407
+9 -12
sound/soc/codecs/cpcap.c
··· 380 380 static int cpcap_output_mux_get_enum(struct snd_kcontrol *kcontrol, 381 381 struct snd_ctl_elem_value *ucontrol) 382 382 { 383 - struct snd_soc_component *component = snd_soc_dapm_kcontrol_component(kcontrol); 383 + struct snd_soc_component *component = snd_soc_dapm_kcontrol_to_component(kcontrol); 384 384 struct cpcap_audio *cpcap = snd_soc_component_get_drvdata(component); 385 385 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; 386 386 unsigned int shift = e->shift_l; ··· 423 423 static int cpcap_output_mux_put_enum(struct snd_kcontrol *kcontrol, 424 424 struct snd_ctl_elem_value *ucontrol) 425 425 { 426 - struct snd_soc_component *component = snd_soc_dapm_kcontrol_component(kcontrol); 426 + struct snd_soc_component *component = snd_soc_dapm_kcontrol_to_component(kcontrol); 427 427 struct cpcap_audio *cpcap = snd_soc_component_get_drvdata(component); 428 - struct snd_soc_dapm_context *dapm = 429 - snd_soc_dapm_kcontrol_dapm(kcontrol); 428 + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol); 430 429 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; 431 430 unsigned int muxval = ucontrol->value.enumerated.item[0]; 432 431 unsigned int mask = BIT(e->shift_l); ··· 467 468 static int cpcap_input_right_mux_get_enum(struct snd_kcontrol *kcontrol, 468 469 struct snd_ctl_elem_value *ucontrol) 469 470 { 470 - struct snd_soc_component *component = snd_soc_dapm_kcontrol_component(kcontrol); 471 + struct snd_soc_component *component = snd_soc_dapm_kcontrol_to_component(kcontrol); 471 472 struct cpcap_audio *cpcap = snd_soc_component_get_drvdata(component); 472 473 int regval, mask; 473 474 int err; ··· 506 507 static int cpcap_input_right_mux_put_enum(struct snd_kcontrol *kcontrol, 507 508 struct snd_ctl_elem_value *ucontrol) 508 509 { 509 - struct snd_soc_component *component = snd_soc_dapm_kcontrol_component(kcontrol); 510 + struct snd_soc_component *component = snd_soc_dapm_kcontrol_to_component(kcontrol); 510 511 struct cpcap_audio *cpcap = snd_soc_component_get_drvdata(component); 511 - struct snd_soc_dapm_context *dapm = 512 - snd_soc_dapm_kcontrol_dapm(kcontrol); 512 + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol); 513 513 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; 514 514 unsigned int muxval = ucontrol->value.enumerated.item[0]; 515 515 int regval = 0, mask; ··· 550 552 static int cpcap_input_left_mux_get_enum(struct snd_kcontrol *kcontrol, 551 553 struct snd_ctl_elem_value *ucontrol) 552 554 { 553 - struct snd_soc_component *component = snd_soc_dapm_kcontrol_component(kcontrol); 555 + struct snd_soc_component *component = snd_soc_dapm_kcontrol_to_component(kcontrol); 554 556 struct cpcap_audio *cpcap = snd_soc_component_get_drvdata(component); 555 557 int regval, mask; 556 558 int err; ··· 581 583 static int cpcap_input_left_mux_put_enum(struct snd_kcontrol *kcontrol, 582 584 struct snd_ctl_elem_value *ucontrol) 583 585 { 584 - struct snd_soc_component *component = snd_soc_dapm_kcontrol_component(kcontrol); 586 + struct snd_soc_component *component = snd_soc_dapm_kcontrol_to_component(kcontrol); 585 587 struct cpcap_audio *cpcap = snd_soc_component_get_drvdata(component); 586 - struct snd_soc_dapm_context *dapm = 587 - snd_soc_dapm_kcontrol_dapm(kcontrol); 588 + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol); 588 589 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; 589 590 unsigned int muxval = ucontrol->value.enumerated.item[0]; 590 591 int regval = 0, mask;
+2 -2
sound/soc/codecs/cs35l33.c
··· 547 547 unsigned int rx_mask, int slots, int slot_width) 548 548 { 549 549 struct snd_soc_component *component = dai->component; 550 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 550 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 551 551 struct cs35l33_private *priv = snd_soc_component_get_drvdata(component); 552 552 unsigned int reg, bit_pos, i; 553 553 int slot, slot_num; ··· 695 695 struct cs35l33_pdata *pdata) 696 696 { 697 697 struct cs35l33_hg *hg_config = &pdata->hg_config; 698 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 698 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 699 699 struct cs35l33_private *priv = snd_soc_component_get_drvdata(component); 700 700 701 701 if (hg_config->enable_hg_algo) {
+1 -1
sound/soc/codecs/cs35l41.c
··· 928 928 static int cs35l41_component_probe(struct snd_soc_component *component) 929 929 { 930 930 struct cs35l41_private *cs35l41 = snd_soc_component_get_drvdata(component); 931 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 931 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 932 932 int ret; 933 933 934 934 if (cs35l41->hw_cfg.bst_type == CS35L41_EXT_BOOST) {
+3 -3
sound/soc/codecs/cs35l45.c
··· 214 214 struct cs35l45_private *cs35l45 = 215 215 snd_soc_component_get_drvdata(component); 216 216 struct snd_soc_dapm_context *dapm = 217 - snd_soc_component_get_dapm(component); 217 + snd_soc_component_to_dapm(component); 218 218 unsigned int amp_state; 219 219 int ret; 220 220 ··· 233 233 234 234 regmap_clear_bits(cs35l45->regmap, CS35L45_BLOCK_ENABLES, 235 235 CS35L45_AMP_EN_MASK); 236 - snd_soc_component_disable_pin_unlocked(component, "SPK"); 236 + snd_soc_dapm_disable_pin_unlocked(dapm, "SPK"); 237 237 snd_soc_dapm_sync_unlocked(dapm); 238 238 239 239 if (ucontrol->value.integer.value[0] == AMP_MODE_SPK) { ··· 287 287 regmap_set_bits(cs35l45->regmap, CS35L45_BLOCK_ENABLES, 288 288 CS35L45_AMP_EN_MASK); 289 289 290 - snd_soc_component_enable_pin_unlocked(component, "SPK"); 290 + snd_soc_dapm_enable_pin_unlocked(dapm, "SPK"); 291 291 snd_soc_dapm_sync_unlocked(dapm); 292 292 snd_soc_dapm_mutex_unlock(dapm); 293 293
+8 -6
sound/soc/codecs/cs35l56.c
··· 896 896 897 897 static struct snd_soc_dapm_context *cs35l56_power_up_for_cal(struct cs35l56_private *cs35l56) 898 898 { 899 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(cs35l56->component); 899 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(cs35l56->component); 900 900 int ret; 901 901 902 - ret = snd_soc_component_enable_pin(cs35l56->component, "Calibrate"); 902 + ret = snd_soc_dapm_enable_pin(dapm, "Calibrate"); 903 903 if (ret) 904 904 return ERR_PTR(ret); 905 905 ··· 910 910 911 911 static void cs35l56_power_down_after_cal(struct cs35l56_private *cs35l56) 912 912 { 913 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(cs35l56->component); 913 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(cs35l56->component); 914 914 915 - snd_soc_component_disable_pin(cs35l56->component, "Calibrate"); 915 + snd_soc_dapm_disable_pin(dapm, "Calibrate"); 916 916 snd_soc_dapm_sync(dapm); 917 917 } 918 918 ··· 1131 1131 1132 1132 static int cs35l56_component_probe(struct snd_soc_component *component) 1133 1133 { 1134 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1134 1135 struct cs35l56_private *cs35l56 = snd_soc_component_get_drvdata(component); 1135 1136 struct dentry *debugfs_root = component->debugfs_root; 1136 1137 unsigned short vendor, device; ··· 1205 1204 if (ret) 1206 1205 return dev_err_probe(cs35l56->base.dev, ret, "unable to add controls\n"); 1207 1206 1208 - ret = snd_soc_component_disable_pin(component, "Calibrate"); 1207 + ret = snd_soc_dapm_disable_pin(dapm, "Calibrate"); 1209 1208 if (ret) 1210 1209 return ret; 1211 1210 ··· 1243 1242 enum snd_soc_bias_level level) 1244 1243 { 1245 1244 struct cs35l56_private *cs35l56 = snd_soc_component_get_drvdata(component); 1245 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1246 1246 1247 1247 switch (level) { 1248 1248 case SND_SOC_BIAS_STANDBY: ··· 1251 1249 * Wait for patching to complete when transitioning from 1252 1250 * BIAS_OFF to BIAS_STANDBY 1253 1251 */ 1254 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) 1252 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) 1255 1253 cs35l56_wait_dsp_ready(cs35l56); 1256 1254 1257 1255 break;
+3 -2
sound/soc/codecs/cs4234.c
··· 87 87 { 88 88 struct snd_soc_component *component = snd_kcontrol_chip(kctrl); 89 89 struct cs4234 *cs4234 = snd_soc_component_get_drvdata(component); 90 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 90 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 91 91 unsigned int val = 0; 92 92 int ret = 0; 93 93 ··· 126 126 enum snd_soc_bias_level level) 127 127 { 128 128 struct cs4234 *cs4234 = snd_soc_component_get_drvdata(component); 129 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 129 130 130 131 switch (level) { 131 132 case SND_SOC_BIAS_PREPARE: 132 - switch (snd_soc_component_get_bias_level(component)) { 133 + switch (snd_soc_dapm_get_bias_level(dapm)) { 133 134 case SND_SOC_BIAS_STANDBY: 134 135 wait_for_completion(&cs4234->vq_ramp_complete); 135 136 break;
+4 -4
sound/soc/codecs/cs42l43-jack.c
··· 502 502 503 503 dev_dbg(priv->dev, "Start load detect\n"); 504 504 505 - snd_soc_dapm_mutex_lock(snd_soc_component_get_dapm(priv->component)); 505 + snd_soc_dapm_mutex_lock(snd_soc_component_to_dapm(priv->component)); 506 506 507 507 priv->load_detect_running = true; 508 508 ··· 539 539 CS42L43_HPLOAD_DET_EN_MASK, 540 540 CS42L43_HPLOAD_DET_EN_MASK); 541 541 542 - snd_soc_dapm_mutex_unlock(snd_soc_component_get_dapm(priv->component)); 542 + snd_soc_dapm_mutex_unlock(snd_soc_component_to_dapm(priv->component)); 543 543 } 544 544 545 545 static void cs42l43_stop_load_detect(struct cs42l43_codec *priv) ··· 548 548 549 549 dev_dbg(priv->dev, "Stop load detect\n"); 550 550 551 - snd_soc_dapm_mutex_lock(snd_soc_component_get_dapm(priv->component)); 551 + snd_soc_dapm_mutex_lock(snd_soc_component_to_dapm(priv->component)); 552 552 553 553 regmap_update_bits(cs42l43->regmap, CS42L43_LOADDETENA, 554 554 CS42L43_HPLOAD_DET_EN_MASK, 0); ··· 587 587 588 588 priv->load_detect_running = false; 589 589 590 - snd_soc_dapm_mutex_unlock(snd_soc_component_get_dapm(priv->component)); 590 + snd_soc_dapm_mutex_unlock(snd_soc_component_to_dapm(priv->component)); 591 591 } 592 592 593 593 static int cs42l43_run_load_detect(struct cs42l43_codec *priv, bool mic)
+8 -8
sound/soc/codecs/cs42l43.c
··· 154 154 { 155 155 struct cs42l43_codec *priv = container_of(work, struct cs42l43_codec, 156 156 hp_ilimit_clear_work.work); 157 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(priv->component); 157 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(priv->component); 158 158 159 159 snd_soc_dapm_mutex_lock(dapm); 160 160 ··· 170 170 static irqreturn_t cs42l43_hp_ilimit(int irq, void *data) 171 171 { 172 172 struct cs42l43_codec *priv = data; 173 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(priv->component); 173 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(priv->component); 174 174 struct cs42l43 *cs42l43 = priv->core; 175 175 176 176 dev_dbg(priv->dev, "headphone ilimit IRQ\n"); ··· 451 451 static int cs42l43_asp_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) 452 452 { 453 453 struct snd_soc_component *component = dai->component; 454 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 454 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 455 455 struct cs42l43_codec *priv = snd_soc_component_get_drvdata(component); 456 456 struct cs42l43 *cs42l43 = priv->core; 457 457 int provider = regmap_test_bits(cs42l43->regmap, CS42L43_ASP_CLK_CONFIG2, ··· 950 950 struct snd_ctl_elem_value *ucontrol) 951 951 { 952 952 struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 953 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 953 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 954 954 int ret; 955 955 956 956 snd_soc_dapm_mutex_lock(dapm); ··· 964 964 struct snd_ctl_elem_value *ucontrol) 965 965 { 966 966 struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 967 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 967 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 968 968 int ret; 969 969 970 970 snd_soc_dapm_mutex_lock(dapm); ··· 978 978 struct snd_ctl_elem_value *ucontrol) 979 979 { 980 980 struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 981 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 981 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 982 982 int ret; 983 983 984 984 snd_soc_dapm_mutex_lock(dapm); ··· 992 992 struct snd_ctl_elem_value *ucontrol) 993 993 { 994 994 struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 995 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 995 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 996 996 int ret; 997 997 998 998 snd_soc_dapm_mutex_lock(dapm); ··· 1017 1017 struct snd_ctl_elem_value *ucontrol) 1018 1018 { 1019 1019 struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 1020 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 1020 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1021 1021 struct cs42l43_codec *priv = snd_soc_component_get_drvdata(component); 1022 1022 1023 1023 snd_soc_dapm_mutex_lock(dapm);
+1 -1
sound/soc/codecs/cs42l51.c
··· 567 567 struct cs42l51_private *cs42l51; 568 568 569 569 cs42l51 = snd_soc_component_get_drvdata(component); 570 - dapm = snd_soc_component_get_dapm(component); 570 + dapm = snd_soc_component_to_dapm(component); 571 571 572 572 if (cs42l51->mclk_handle) 573 573 snd_soc_dapm_new_controls(dapm, cs42l51_dapm_mclk_widgets, 1);
+3 -2
sound/soc/codecs/cs42l52.c
··· 851 851 enum snd_soc_bias_level level) 852 852 { 853 853 struct cs42l52_private *cs42l52 = snd_soc_component_get_drvdata(component); 854 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 854 855 855 856 switch (level) { 856 857 case SND_SOC_BIAS_ON: ··· 861 860 CS42L52_PWRCTL1_PDN_CODEC, 0); 862 861 break; 863 862 case SND_SOC_BIAS_STANDBY: 864 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { 863 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) { 865 864 regcache_cache_only(cs42l52->regmap, false); 866 865 regcache_sync(cs42l52->regmap); 867 866 } ··· 920 919 struct cs42l52_private *cs42l52 = 921 920 container_of(work, struct cs42l52_private, beep_work); 922 921 struct snd_soc_component *component = cs42l52->component; 923 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 922 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 924 923 int i; 925 924 int val = 0; 926 925 int best = 0;
+3 -2
sound/soc/codecs/cs42l56.c
··· 911 911 enum snd_soc_bias_level level) 912 912 { 913 913 struct cs42l56_private *cs42l56 = snd_soc_component_get_drvdata(component); 914 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 914 915 int ret; 915 916 916 917 switch (level) { ··· 924 923 CS42L56_PDN_ALL_MASK, 0); 925 924 break; 926 925 case SND_SOC_BIAS_STANDBY: 927 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { 926 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) { 928 927 regcache_cache_only(cs42l56->regmap, false); 929 928 regcache_sync(cs42l56->regmap); 930 929 ret = regulator_bulk_enable(ARRAY_SIZE(cs42l56->supplies), ··· 997 996 struct cs42l56_private *cs42l56 = 998 997 container_of(work, struct cs42l56_private, beep_work); 999 998 struct snd_soc_component *component = cs42l56->component; 1000 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 999 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1001 1000 int i; 1002 1001 int val = 0; 1003 1002 int best = 0;
+2 -1
sound/soc/codecs/cs42l73.c
··· 1101 1101 enum snd_soc_bias_level level) 1102 1102 { 1103 1103 struct cs42l73_private *cs42l73 = snd_soc_component_get_drvdata(component); 1104 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1104 1105 1105 1106 switch (level) { 1106 1107 case SND_SOC_BIAS_ON: ··· 1113 1112 break; 1114 1113 1115 1114 case SND_SOC_BIAS_STANDBY: 1116 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { 1115 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) { 1117 1116 regcache_cache_only(cs42l73->regmap, false); 1118 1117 regcache_sync(cs42l73->regmap); 1119 1118 }
+1 -1
sound/soc/codecs/cs42xx8.c
··· 465 465 static int cs42xx8_component_probe(struct snd_soc_component *component) 466 466 { 467 467 struct cs42xx8_priv *cs42xx8 = snd_soc_component_get_drvdata(component); 468 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 468 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 469 469 470 470 switch (cs42xx8->drvdata->num_adcs) { 471 471 case 3:
+3 -2
sound/soc/codecs/cs47l15.c
··· 1278 1278 1279 1279 static int cs47l15_component_probe(struct snd_soc_component *component) 1280 1280 { 1281 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1281 1282 struct cs47l15 *cs47l15 = snd_soc_component_get_drvdata(component); 1282 1283 struct madera *madera = cs47l15->core.madera; 1283 1284 int ret; ··· 1286 1285 snd_soc_component_init_regmap(component, madera->regmap); 1287 1286 1288 1287 mutex_lock(&madera->dapm_ptr_lock); 1289 - madera->dapm = snd_soc_component_get_dapm(component); 1288 + madera->dapm = snd_soc_component_to_dapm(component); 1290 1289 mutex_unlock(&madera->dapm_ptr_lock); 1291 1290 1292 1291 ret = madera_init_inputs(component); ··· 1299 1298 if (ret) 1300 1299 return ret; 1301 1300 1302 - snd_soc_component_disable_pin(component, "HAPTICS"); 1301 + snd_soc_dapm_disable_pin(dapm, "HAPTICS"); 1303 1302 1304 1303 ret = snd_soc_add_component_controls(component, 1305 1304 madera_adsp_rate_controls,
+2 -2
sound/soc/codecs/cs47l24.c
··· 1124 1124 1125 1125 static int cs47l24_component_probe(struct snd_soc_component *component) 1126 1126 { 1127 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 1127 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1128 1128 struct cs47l24_priv *priv = snd_soc_component_get_drvdata(component); 1129 1129 struct arizona *arizona = priv->core.arizona; 1130 1130 int ret; ··· 1153 1153 if (ret) 1154 1154 goto err_adsp2_codec_probe; 1155 1155 1156 - snd_soc_component_disable_pin(component, "HAPTICS"); 1156 + snd_soc_dapm_disable_pin(dapm, "HAPTICS"); 1157 1157 1158 1158 return 0; 1159 1159
+3 -2
sound/soc/codecs/cs47l35.c
··· 1559 1559 1560 1560 static int cs47l35_component_probe(struct snd_soc_component *component) 1561 1561 { 1562 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1562 1563 struct cs47l35 *cs47l35 = snd_soc_component_get_drvdata(component); 1563 1564 struct madera *madera = cs47l35->core.madera; 1564 1565 int i, ret; ··· 1567 1566 snd_soc_component_init_regmap(component, madera->regmap); 1568 1567 1569 1568 mutex_lock(&madera->dapm_ptr_lock); 1570 - madera->dapm = snd_soc_component_get_dapm(component); 1569 + madera->dapm = snd_soc_component_to_dapm(component); 1571 1570 mutex_unlock(&madera->dapm_ptr_lock); 1572 1571 1573 1572 ret = madera_init_inputs(component); ··· 1580 1579 if (ret) 1581 1580 return ret; 1582 1581 1583 - snd_soc_component_disable_pin(component, "HAPTICS"); 1582 + snd_soc_dapm_disable_pin(dapm, "HAPTICS"); 1584 1583 1585 1584 ret = snd_soc_add_component_controls(component, 1586 1585 madera_adsp_rate_controls,
+3 -2
sound/soc/codecs/cs47l85.c
··· 2497 2497 2498 2498 static int cs47l85_component_probe(struct snd_soc_component *component) 2499 2499 { 2500 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 2500 2501 struct cs47l85 *cs47l85 = snd_soc_component_get_drvdata(component); 2501 2502 struct madera *madera = cs47l85->core.madera; 2502 2503 int i, ret; ··· 2505 2504 snd_soc_component_init_regmap(component, madera->regmap); 2506 2505 2507 2506 mutex_lock(&madera->dapm_ptr_lock); 2508 - madera->dapm = snd_soc_component_get_dapm(component); 2507 + madera->dapm = snd_soc_component_to_dapm(component); 2509 2508 mutex_unlock(&madera->dapm_ptr_lock); 2510 2509 2511 2510 ret = madera_init_inputs(component); ··· 2517 2516 if (ret) 2518 2517 return ret; 2519 2518 2520 - snd_soc_component_disable_pin(component, "HAPTICS"); 2519 + snd_soc_dapm_disable_pin(dapm, "HAPTICS"); 2521 2520 2522 2521 ret = snd_soc_add_component_controls(component, 2523 2522 madera_adsp_rate_controls,
+3 -2
sound/soc/codecs/cs47l90.c
··· 2416 2416 2417 2417 static int cs47l90_component_probe(struct snd_soc_component *component) 2418 2418 { 2419 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 2419 2420 struct cs47l90 *cs47l90 = snd_soc_component_get_drvdata(component); 2420 2421 struct madera *madera = cs47l90->core.madera; 2421 2422 int ret, i; ··· 2424 2423 snd_soc_component_init_regmap(component, madera->regmap); 2425 2424 2426 2425 mutex_lock(&madera->dapm_ptr_lock); 2427 - madera->dapm = snd_soc_component_get_dapm(component); 2426 + madera->dapm = snd_soc_component_to_dapm(component); 2428 2427 mutex_unlock(&madera->dapm_ptr_lock); 2429 2428 2430 2429 ret = madera_init_inputs(component); ··· 2436 2435 if (ret) 2437 2436 return ret; 2438 2437 2439 - snd_soc_component_disable_pin(component, "HAPTICS"); 2438 + snd_soc_dapm_disable_pin(dapm, "HAPTICS"); 2440 2439 2441 2440 ret = snd_soc_add_component_controls(component, 2442 2441 madera_adsp_rate_controls,
+5 -6
sound/soc/codecs/cs47l92.c
··· 52 52 static int cs47l92_put_demux(struct snd_kcontrol *kcontrol, 53 53 struct snd_ctl_elem_value *ucontrol) 54 54 { 55 - struct snd_soc_component *component = 56 - snd_soc_dapm_kcontrol_component(kcontrol); 57 - struct snd_soc_dapm_context *dapm = 58 - snd_soc_component_get_dapm(component); 55 + struct snd_soc_component *component = snd_soc_dapm_kcontrol_to_component(kcontrol); 56 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 59 57 struct cs47l92 *cs47l92 = snd_soc_component_get_drvdata(component); 60 58 struct madera_priv *priv = &cs47l92->core; 61 59 struct madera *madera = priv->madera; ··· 1885 1887 1886 1888 static int cs47l92_component_probe(struct snd_soc_component *component) 1887 1889 { 1890 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1888 1891 struct cs47l92 *cs47l92 = snd_soc_component_get_drvdata(component); 1889 1892 struct madera *madera = cs47l92->core.madera; 1890 1893 int ret; ··· 1893 1894 snd_soc_component_init_regmap(component, madera->regmap); 1894 1895 1895 1896 mutex_lock(&madera->dapm_ptr_lock); 1896 - madera->dapm = snd_soc_component_get_dapm(component); 1897 + madera->dapm = snd_soc_component_to_dapm(component); 1897 1898 mutex_unlock(&madera->dapm_ptr_lock); 1898 1899 1899 1900 ret = madera_init_inputs(component); ··· 1906 1907 if (ret) 1907 1908 return ret; 1908 1909 1909 - snd_soc_component_disable_pin(component, "HAPTICS"); 1910 + snd_soc_dapm_disable_pin(dapm, "HAPTICS"); 1910 1911 1911 1912 ret = snd_soc_add_component_controls(component, 1912 1913 madera_adsp_rate_controls,
+9 -9
sound/soc/codecs/cs48l32.c
··· 320 320 static int cs48l32_inmux_put(struct snd_kcontrol *kcontrol, 321 321 struct snd_ctl_elem_value *ucontrol) 322 322 { 323 - struct snd_soc_component *component = snd_soc_dapm_kcontrol_component(kcontrol); 324 - struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_dapm(kcontrol); 323 + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol); 324 + struct snd_soc_component *component = snd_soc_dapm_to_component(dapm); 325 325 struct cs48l32_codec *cs48l32_codec = snd_soc_component_get_drvdata(component); 326 326 struct soc_enum *e = (struct soc_enum *) kcontrol->private_value; 327 327 unsigned int mux, src_val, in_type; ··· 347 347 if (in_type == CS48L32_IN_TYPE_SE) 348 348 src_val |= 1 << CS48L32_INx_SRC_SHIFT; 349 349 350 - ret = snd_soc_component_update_bits(dapm->component, 350 + ret = snd_soc_component_update_bits(component, 351 351 e->reg, 352 352 CS48L32_INx_SRC_MASK, 353 353 src_val); ··· 385 385 static int cs48l32_dmode_put(struct snd_kcontrol *kcontrol, 386 386 struct snd_ctl_elem_value *ucontrol) 387 387 { 388 - struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_dapm(kcontrol); 388 + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol); 389 389 struct snd_soc_component *component = snd_soc_dapm_to_component(dapm); 390 390 struct soc_enum *e = (struct soc_enum *) kcontrol->private_value; 391 391 unsigned int mode; ··· 705 705 struct snd_ctl_elem_value *ucontrol) 706 706 { 707 707 struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 708 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 708 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 709 709 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; 710 710 int ret; 711 711 ··· 756 756 { 757 757 struct soc_mixer_control *mc = (struct soc_mixer_control *)kcontrol->private_value; 758 758 struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 759 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 759 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 760 760 int ret; 761 761 762 762 snd_soc_dapm_mutex_lock(dapm); ··· 962 962 struct snd_ctl_elem_value *ucontrol) 963 963 { 964 964 struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 965 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 965 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 966 966 struct cs48l32_codec *cs48l32_codec = snd_soc_component_get_drvdata(component); 967 967 struct soc_enum *e = (struct soc_enum *) kcontrol->private_value; 968 968 unsigned int *item = ucontrol->value.enumerated.item; ··· 1026 1026 struct snd_ctl_elem_value *ucontrol) 1027 1027 { 1028 1028 struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 1029 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 1029 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1030 1030 struct cs48l32_codec *cs48l32_codec = snd_soc_component_get_drvdata(component); 1031 1031 struct cs48l32_eq_control *params = (void *)kcontrol->private_value; 1032 1032 __be16 *coeffs; ··· 1083 1083 struct snd_ctl_elem_value *ucontrol) 1084 1084 { 1085 1085 struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 1086 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 1086 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1087 1087 struct cs48l32_codec *cs48l32_codec = snd_soc_component_get_drvdata(component); 1088 1088 struct soc_enum *e = (struct soc_enum *) kcontrol->private_value; 1089 1089 const unsigned int rate_num = e->mask;
+6 -6
sound/soc/codecs/cs530x.c
··· 131 131 struct snd_ctl_elem_value *ucontrol) 132 132 { 133 133 struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 134 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 134 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 135 135 struct cs530x_priv *cs530x = snd_soc_component_get_drvdata(component); 136 136 struct regmap *regmap = cs530x->regmap; 137 137 int ret; ··· 522 522 523 523 static void cs530x_add_12_adc_widgets(struct snd_soc_component *component) 524 524 { 525 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 525 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 526 526 527 527 snd_soc_add_component_controls(component, 528 528 cs530x_in_1_to_2_controls, ··· 537 537 538 538 static void cs530x_add_34_adc_widgets(struct snd_soc_component *component) 539 539 { 540 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 540 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 541 541 542 542 snd_soc_add_component_controls(component, 543 543 cs530x_in_3_to_4_controls, ··· 669 669 670 670 static void cs530x_add_12_dac_widgets(struct snd_soc_component *component) 671 671 { 672 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 672 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 673 673 674 674 snd_soc_add_component_controls(component, 675 675 cs530x_out_1_to_2_controls, ··· 684 684 685 685 static void cs530x_add_34_dac_widgets(struct snd_soc_component *component) 686 686 { 687 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 687 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 688 688 689 689 snd_soc_add_component_controls(component, 690 690 cs530x_out_3_to_4_controls, ··· 1007 1007 static int cs530x_component_probe(struct snd_soc_component *component) 1008 1008 { 1009 1009 struct cs530x_priv *cs530x = snd_soc_component_get_drvdata(component); 1010 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 1010 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1011 1011 int num_widgets; 1012 1012 1013 1013 snd_soc_dapm_new_controls(dapm, cs530x_gen_dapm_widgets,
+5 -4
sound/soc/codecs/cs53l30.c
··· 649 649 static int cs53l30_set_bias_level(struct snd_soc_component *component, 650 650 enum snd_soc_bias_level level) 651 651 { 652 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 652 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 653 653 struct cs53l30_private *priv = snd_soc_component_get_drvdata(component); 654 + enum snd_soc_bias_level bias_level = snd_soc_dapm_get_bias_level(dapm); 654 655 unsigned int reg; 655 656 int i, inter_max_check, ret; 656 657 ··· 659 658 case SND_SOC_BIAS_ON: 660 659 break; 661 660 case SND_SOC_BIAS_PREPARE: 662 - if (dapm->bias_level == SND_SOC_BIAS_STANDBY) 661 + if (bias_level == SND_SOC_BIAS_STANDBY) 663 662 regmap_update_bits(priv->regmap, CS53L30_PWRCTL, 664 663 CS53L30_PDN_LP_MASK, 0); 665 664 break; 666 665 case SND_SOC_BIAS_STANDBY: 667 - if (dapm->bias_level == SND_SOC_BIAS_OFF) { 666 + if (bias_level == SND_SOC_BIAS_OFF) { 668 667 ret = clk_prepare_enable(priv->mclk); 669 668 if (ret) { 670 669 dev_err(component->dev, ··· 858 857 static int cs53l30_component_probe(struct snd_soc_component *component) 859 858 { 860 859 struct cs53l30_private *priv = snd_soc_component_get_drvdata(component); 861 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 860 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 862 861 863 862 if (priv->use_sdout2) 864 863 snd_soc_dapm_add_routes(dapm, cs53l30_dapm_routes_sdout2,
+3 -2
sound/soc/codecs/cx20442.c
··· 315 315 enum snd_soc_bias_level level) 316 316 { 317 317 struct cx20442_priv *cx20442 = snd_soc_component_get_drvdata(component); 318 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 318 319 int err = 0; 319 320 320 321 switch (level) { 321 322 case SND_SOC_BIAS_PREPARE: 322 - if (snd_soc_component_get_bias_level(component) != SND_SOC_BIAS_STANDBY) 323 + if (snd_soc_dapm_get_bias_level(dapm) != SND_SOC_BIAS_STANDBY) 323 324 break; 324 325 if (IS_ERR(cx20442->por)) 325 326 err = PTR_ERR(cx20442->por); ··· 328 327 err = regulator_enable(cx20442->por); 329 328 break; 330 329 case SND_SOC_BIAS_STANDBY: 331 - if (snd_soc_component_get_bias_level(component) != SND_SOC_BIAS_PREPARE) 330 + if (snd_soc_dapm_get_bias_level(dapm) != SND_SOC_BIAS_PREPARE) 332 331 break; 333 332 if (IS_ERR(cx20442->por)) 334 333 err = PTR_ERR(cx20442->por);
+3 -3
sound/soc/codecs/cx2072x.c
··· 1341 1341 enum snd_soc_bias_level level) 1342 1342 { 1343 1343 struct cx2072x_priv *cx2072x = snd_soc_component_get_drvdata(codec); 1344 - const enum snd_soc_bias_level old_level = 1345 - snd_soc_component_get_bias_level(codec); 1344 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(codec); 1345 + const enum snd_soc_bias_level old_level = snd_soc_dapm_get_bias_level(dapm); 1346 1346 1347 1347 if (level == SND_SOC_BIAS_STANDBY && old_level == SND_SOC_BIAS_OFF) 1348 1348 regmap_write(cx2072x->regmap, CX2072X_AFG_POWER_STATE, 0); ··· 1363 1363 static void cx2072x_enable_jack_detect(struct snd_soc_component *codec) 1364 1364 { 1365 1365 struct cx2072x_priv *cx2072x = snd_soc_component_get_drvdata(codec); 1366 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(codec); 1366 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(codec); 1367 1367 1368 1368 /* No-sticky input type */ 1369 1369 regmap_write(cx2072x->regmap, CX2072X_GPIO_STICKY_MASK, 0x1f);
+3 -2
sound/soc/codecs/da7213.c
··· 1816 1816 enum snd_soc_bias_level level) 1817 1817 { 1818 1818 struct da7213_priv *da7213 = snd_soc_component_get_drvdata(component); 1819 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1819 1820 int ret; 1820 1821 1821 1822 switch (level) { ··· 1824 1823 break; 1825 1824 case SND_SOC_BIAS_PREPARE: 1826 1825 /* Enable MCLK for transition to ON state */ 1827 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_STANDBY) { 1826 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_STANDBY) { 1828 1827 if (da7213->mclk) { 1829 1828 ret = clk_prepare_enable(da7213->mclk); 1830 1829 if (ret) { ··· 1838 1837 } 1839 1838 break; 1840 1839 case SND_SOC_BIAS_STANDBY: 1841 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { 1840 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) { 1842 1841 /* Enable VMID reference & master bias */ 1843 1842 snd_soc_component_update_bits(component, DA7213_REFERENCES, 1844 1843 DA7213_VMID_EN | DA7213_BIAS_EN,
+3 -2
sound/soc/codecs/da7218.c
··· 2562 2562 enum snd_soc_bias_level level) 2563 2563 { 2564 2564 struct da7218_priv *da7218 = snd_soc_component_get_drvdata(component); 2565 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 2565 2566 int ret; 2566 2567 2567 2568 switch (level) { ··· 2570 2569 break; 2571 2570 case SND_SOC_BIAS_PREPARE: 2572 2571 /* Enable MCLK for transition to ON state */ 2573 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_STANDBY) { 2572 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_STANDBY) { 2574 2573 if (da7218->mclk) { 2575 2574 ret = clk_prepare_enable(da7218->mclk); 2576 2575 if (ret) { ··· 2582 2581 2583 2582 break; 2584 2583 case SND_SOC_BIAS_STANDBY: 2585 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { 2584 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) { 2586 2585 /* Master bias */ 2587 2586 snd_soc_component_update_bits(component, DA7218_REFERENCES, 2588 2587 DA7218_BIAS_EN_MASK,
+5 -5
sound/soc/codecs/da7219-aad.c
··· 53 53 struct da7219_aad_priv *da7219_aad = 54 54 container_of(work, struct da7219_aad_priv, btn_det_work); 55 55 struct snd_soc_component *component = da7219_aad->component; 56 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 56 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 57 57 struct da7219_priv *da7219 = snd_soc_component_get_drvdata(component); 58 58 u8 statusa, micbias_ctrl; 59 59 bool micbias_up = false; ··· 109 109 struct da7219_aad_priv *da7219_aad = 110 110 container_of(work, struct da7219_aad_priv, hptest_work); 111 111 struct snd_soc_component *component = da7219_aad->component; 112 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 112 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 113 113 struct da7219_priv *da7219 = snd_soc_component_get_drvdata(component); 114 114 115 115 __le16 tonegen_freq_hptest; ··· 351 351 { 352 352 struct da7219_aad_priv *da7219_aad = data; 353 353 struct snd_soc_component *component = da7219_aad->component; 354 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 354 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 355 355 struct da7219_priv *da7219 = snd_soc_component_get_drvdata(component); 356 356 u8 events[DA7219_AAD_IRQ_REG_MAX]; 357 357 u8 statusa; ··· 928 928 { 929 929 struct da7219_priv *da7219 = snd_soc_component_get_drvdata(component); 930 930 struct da7219_aad_priv *da7219_aad = da7219->aad; 931 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 931 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 932 932 u8 micbias_ctrl; 933 933 934 934 disable_irq(da7219_aad->irq); ··· 962 962 { 963 963 struct da7219_priv *da7219 = snd_soc_component_get_drvdata(component); 964 964 struct da7219_aad_priv *da7219_aad = da7219->aad; 965 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 965 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 966 966 967 967 if (da7219_aad->jack) { 968 968 /* Re-enable micbias if previously enabled for 4-pole jack */
+8 -5
sound/soc/codecs/da7219.c
··· 1807 1807 enum snd_soc_bias_level level) 1808 1808 { 1809 1809 struct da7219_priv *da7219 = snd_soc_component_get_drvdata(component); 1810 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1810 1811 int ret; 1811 1812 1812 1813 switch (level) { ··· 1815 1814 break; 1816 1815 case SND_SOC_BIAS_PREPARE: 1817 1816 /* Enable MCLK for transition to ON state */ 1818 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_STANDBY) { 1817 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_STANDBY) { 1819 1818 if (da7219->mclk) { 1820 1819 ret = clk_prepare_enable(da7219->mclk); 1821 1820 if (ret) { ··· 1828 1827 1829 1828 break; 1830 1829 case SND_SOC_BIAS_STANDBY: 1831 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) 1830 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) 1832 1831 /* Master bias */ 1833 1832 snd_soc_component_update_bits(component, DA7219_REFERENCES, 1834 1833 DA7219_BIAS_EN_MASK, 1835 1834 DA7219_BIAS_EN_MASK); 1836 1835 1837 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_PREPARE) { 1836 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_PREPARE) { 1838 1837 /* Remove MCLK */ 1839 1838 if (da7219->mclk) 1840 1839 clk_disable_unprepare(da7219->mclk); ··· 2614 2613 static int da7219_suspend(struct snd_soc_component *component) 2615 2614 { 2616 2615 struct da7219_priv *da7219 = snd_soc_component_get_drvdata(component); 2616 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 2617 2617 2618 2618 /* Suspend AAD if we're not a wake-up source */ 2619 2619 if (!da7219->wakeup_source) 2620 2620 da7219_aad_suspend(component); 2621 2621 2622 - snd_soc_component_force_bias_level(component, SND_SOC_BIAS_OFF); 2622 + snd_soc_dapm_force_bias_level(dapm, SND_SOC_BIAS_OFF); 2623 2623 2624 2624 return 0; 2625 2625 } ··· 2628 2626 static int da7219_resume(struct snd_soc_component *component) 2629 2627 { 2630 2628 struct da7219_priv *da7219 = snd_soc_component_get_drvdata(component); 2629 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 2631 2630 2632 - snd_soc_component_force_bias_level(component, SND_SOC_BIAS_STANDBY); 2631 + snd_soc_dapm_force_bias_level(dapm, SND_SOC_BIAS_STANDBY); 2633 2632 2634 2633 /* Resume AAD if previously suspended */ 2635 2634 if (!da7219->wakeup_source)
+2 -1
sound/soc/codecs/da732x.c
··· 1408 1408 enum snd_soc_bias_level level) 1409 1409 { 1410 1410 struct da732x_priv *da732x = snd_soc_component_get_drvdata(component); 1411 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1411 1412 1412 1413 switch (level) { 1413 1414 case SND_SOC_BIAS_ON: ··· 1419 1418 case SND_SOC_BIAS_PREPARE: 1420 1419 break; 1421 1420 case SND_SOC_BIAS_STANDBY: 1422 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { 1421 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) { 1423 1422 /* Init Codec */ 1424 1423 snd_soc_component_write(component, DA732X_REG_REF1, 1425 1424 DA732X_VMID_FASTCHG);
+3 -1
sound/soc/codecs/da9055.c
··· 1352 1352 static int da9055_set_bias_level(struct snd_soc_component *component, 1353 1353 enum snd_soc_bias_level level) 1354 1354 { 1355 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1356 + 1355 1357 switch (level) { 1356 1358 case SND_SOC_BIAS_ON: 1357 1359 case SND_SOC_BIAS_PREPARE: 1358 1360 break; 1359 1361 case SND_SOC_BIAS_STANDBY: 1360 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { 1362 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) { 1361 1363 /* Enable VMID reference & master bias */ 1362 1364 snd_soc_component_update_bits(component, DA9055_REFERENCES, 1363 1365 DA9055_VMID_EN | DA9055_BIAS_EN,
+1 -1
sound/soc/codecs/es7134.c
··· 104 104 105 105 static int es7134_component_probe(struct snd_soc_component *c) 106 106 { 107 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(c); 107 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(c); 108 108 struct es7134_data *priv = snd_soc_component_get_drvdata(c); 109 109 const struct es7134_chip *chip = priv->chip; 110 110 int ret;
+2 -1
sound/soc/codecs/es8311.c
··· 760 760 enum snd_soc_bias_level level) 761 761 { 762 762 struct es8311_priv *es8311 = snd_soc_component_get_drvdata(component); 763 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 763 764 764 765 switch (level) { 765 766 case SND_SOC_BIAS_ON: ··· 768 767 case SND_SOC_BIAS_PREPARE: 769 768 break; 770 769 case SND_SOC_BIAS_STANDBY: 771 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { 770 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) { 772 771 int ret = clk_prepare_enable(es8311->mclk); 773 772 if (ret) { 774 773 dev_err(component->dev,
+2 -2
sound/soc/codecs/es8316.c
··· 590 590 static void es8316_enable_micbias_for_mic_gnd_short_detect( 591 591 struct snd_soc_component *component) 592 592 { 593 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 593 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 594 594 595 595 snd_soc_dapm_mutex_lock(dapm); 596 596 snd_soc_dapm_force_enable_pin_unlocked(dapm, "Bias"); ··· 605 605 static void es8316_disable_micbias_for_mic_gnd_short_detect( 606 606 struct snd_soc_component *component) 607 607 { 608 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 608 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 609 609 610 610 snd_soc_dapm_mutex_lock(dapm); 611 611 snd_soc_dapm_disable_pin_unlocked(dapm, "Mic Bias");
+2 -2
sound/soc/codecs/es8326.c
··· 737 737 738 738 static void es8326_enable_micbias(struct snd_soc_component *component) 739 739 { 740 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 740 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 741 741 742 742 snd_soc_dapm_mutex_lock(dapm); 743 743 snd_soc_dapm_force_enable_pin_unlocked(dapm, "MICBIAS1"); ··· 748 748 749 749 static void es8326_disable_micbias(struct snd_soc_component *component) 750 750 { 751 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 751 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 752 752 753 753 snd_soc_dapm_mutex_lock(dapm); 754 754 snd_soc_dapm_disable_pin_unlocked(dapm, "MICBIAS1");
+3 -1
sound/soc/codecs/es8328.c
··· 643 643 static int es8328_set_bias_level(struct snd_soc_component *component, 644 644 enum snd_soc_bias_level level) 645 645 { 646 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 647 + 646 648 switch (level) { 647 649 case SND_SOC_BIAS_ON: 648 650 break; ··· 660 658 break; 661 659 662 660 case SND_SOC_BIAS_STANDBY: 663 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { 661 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) { 664 662 snd_soc_component_update_bits(component, ES8328_CONTROL1, 665 663 ES8328_CONTROL1_VMIDSEL_MASK | 666 664 ES8328_CONTROL1_ENREF,
+2 -2
sound/soc/codecs/es8389.c
··· 57 57 static int es8389_dmic_set(struct snd_kcontrol *kcontrol, 58 58 struct snd_ctl_elem_value *ucontrol) 59 59 { 60 - struct snd_soc_component *component = snd_soc_dapm_kcontrol_component(kcontrol); 61 - struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_dapm(kcontrol); 60 + struct snd_soc_component *component = snd_soc_dapm_kcontrol_to_component(kcontrol); 61 + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol); 62 62 struct es8389_private *es8389 = snd_soc_component_get_drvdata(component); 63 63 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; 64 64 unsigned int val;
+1 -1
sound/soc/codecs/hda.c
··· 96 96 if (ret < 0) 97 97 return ret; 98 98 99 - dapm = snd_soc_component_get_dapm(component); 99 + dapm = snd_soc_component_to_dapm(component); 100 100 101 101 list_for_each_entry(pcm, &codec->pcm_list_head, list) { 102 102 struct snd_soc_dai *dai;
+1 -3
sound/soc/codecs/hdac_hda.c
··· 405 405 { 406 406 struct hdac_hda_priv *hda_pvt = 407 407 snd_soc_component_get_drvdata(component); 408 - struct snd_soc_dapm_context *dapm = 409 - snd_soc_component_get_dapm(component); 410 408 struct hdac_device *hdev = &hda_pvt->codec->core; 411 409 struct hda_codec *hcodec = hda_pvt->codec; 412 410 struct hda_codec_driver *driver = hda_codec_to_driver(hcodec); ··· 468 470 */ 469 471 pm_runtime_get_noresume(&hdev->dev); 470 472 471 - hcodec->bus->card = dapm->card->snd_card; 473 + hcodec->bus->card = component->card->snd_card; 472 474 473 475 ret = snd_hda_codec_set_name(hcodec, hcodec->preset->name); 474 476 if (ret < 0) {
+20 -15
sound/soc/codecs/hdac_hdmi.c
··· 769 769 struct snd_kcontrol *kc, int event) 770 770 { 771 771 struct hdac_hdmi_port *port = w->priv; 772 - struct hdac_device *hdev = dev_to_hdac_dev(w->dapm->dev); 772 + struct device *dev = snd_soc_dapm_to_dev(w->dapm); 773 + struct hdac_device *hdev = dev_to_hdac_dev(dev); 773 774 struct hdac_hdmi_pcm *pcm; 774 775 775 776 dev_dbg(&hdev->dev, "%s: widget: %s event: %x\n", ··· 815 814 struct snd_kcontrol *kc, int event) 816 815 { 817 816 struct hdac_hdmi_cvt *cvt = w->priv; 818 - struct hdac_device *hdev = dev_to_hdac_dev(w->dapm->dev); 817 + struct device *dev = snd_soc_dapm_to_dev(w->dapm); 818 + struct hdac_device *hdev = dev_to_hdac_dev(dev); 819 819 struct hdac_hdmi_priv *hdmi = hdev_to_hdmi_priv(hdev); 820 820 struct hdac_hdmi_pcm *pcm; 821 821 ··· 871 869 struct snd_kcontrol *kc, int event) 872 870 { 873 871 struct hdac_hdmi_port *port = w->priv; 874 - struct hdac_device *hdev = dev_to_hdac_dev(w->dapm->dev); 872 + struct device *dev = snd_soc_dapm_to_dev(w->dapm); 873 + struct hdac_device *hdev = dev_to_hdac_dev(dev); 875 874 int mux_idx; 876 875 877 876 dev_dbg(&hdev->dev, "%s: widget: %s event: %x\n", ··· 881 878 if (!kc) 882 879 kc = w->kcontrols[0]; 883 880 884 - mux_idx = dapm_kcontrol_get_value(kc); 881 + mux_idx = snd_soc_dapm_kcontrol_get_value(kc); 885 882 886 883 /* set the device if pin is mst_capable */ 887 884 if (hdac_hdmi_port_select_set(hdev, port) < 0) ··· 904 901 int ret; 905 902 struct hdac_hdmi_port *p, *p_next; 906 903 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; 907 - struct snd_soc_dapm_widget *w = snd_soc_dapm_kcontrol_widget(kcontrol); 904 + struct snd_soc_dapm_widget *w = snd_soc_dapm_kcontrol_to_widget(kcontrol); 908 905 struct snd_soc_dapm_context *dapm = w->dapm; 906 + struct device *dev = snd_soc_dapm_to_dev(dapm); 909 907 struct hdac_hdmi_port *port = w->priv; 910 - struct hdac_device *hdev = dev_to_hdac_dev(dapm->dev); 908 + struct hdac_device *hdev = dev_to_hdac_dev(dev); 911 909 struct hdac_hdmi_priv *hdmi = hdev_to_hdmi_priv(hdev); 912 910 struct hdac_hdmi_pcm *pcm; 913 911 const char *cvt_name = e->texts[ucontrol->value.enumerated.item[0]]; ··· 1074 1070 */ 1075 1071 static int create_fill_widget_route_map(struct snd_soc_dapm_context *dapm) 1076 1072 { 1073 + struct device *dev = snd_soc_dapm_to_dev(dapm); 1074 + struct snd_soc_card *card = snd_soc_dapm_to_card(dapm); 1077 1075 struct snd_soc_dapm_widget *widgets; 1078 1076 struct snd_soc_dapm_route *route; 1079 - struct hdac_device *hdev = dev_to_hdac_dev(dapm->dev); 1077 + struct hdac_device *hdev = dev_to_hdac_dev(dev); 1080 1078 struct hdac_hdmi_priv *hdmi = hdev_to_hdmi_priv(hdev); 1081 1079 struct snd_soc_dai_driver *dai_drv = hdmi->dai_drv; 1082 1080 char widget_name[NAME_SIZE]; ··· 1089 1083 if (list_empty(&hdmi->cvt_list) || list_empty(&hdmi->pin_list)) 1090 1084 return -EINVAL; 1091 1085 1092 - widgets = devm_kzalloc(dapm->dev, (sizeof(*widgets) * 1086 + widgets = devm_kzalloc(dev, (sizeof(*widgets) * 1093 1087 ((2 * hdmi->num_ports) + hdmi->num_cvt)), 1094 1088 GFP_KERNEL); 1095 1089 ··· 1099 1093 /* DAPM widgets to represent each converter widget */ 1100 1094 list_for_each_entry(cvt, &hdmi->cvt_list, head) { 1101 1095 sprintf(widget_name, "Converter %d", cvt->nid); 1102 - ret = hdac_hdmi_fill_widget_info(dapm->dev, &widgets[i], 1096 + ret = hdac_hdmi_fill_widget_info(dev, &widgets[i], 1103 1097 snd_soc_dapm_aif_in, cvt, 1104 1098 widget_name, dai_drv[i].playback.stream_name, NULL, 0, 1105 1099 hdac_hdmi_cvt_output_widget_event, ··· 1113 1107 for (j = 0; j < pin->num_ports; j++) { 1114 1108 sprintf(widget_name, "hif%d-%d Output", 1115 1109 pin->nid, pin->ports[j].id); 1116 - ret = hdac_hdmi_fill_widget_info(dapm->dev, &widgets[i], 1110 + ret = hdac_hdmi_fill_widget_info(dev, &widgets[i], 1117 1111 snd_soc_dapm_output, &pin->ports[j], 1118 1112 widget_name, NULL, NULL, 0, 1119 1113 hdac_hdmi_pin_output_widget_event, ··· 1146 1140 } 1147 1141 } 1148 1142 1149 - route = devm_kzalloc(dapm->dev, (sizeof(*route) * num_routes), 1143 + route = devm_kzalloc(dev, (sizeof(*route) * num_routes), 1150 1144 GFP_KERNEL); 1151 1145 if (!route) 1152 1146 return -ENOMEM; ··· 1172 1166 ((2 * hdmi->num_ports) + hdmi->num_cvt)); 1173 1167 1174 1168 snd_soc_dapm_add_routes(dapm, route, num_routes); 1175 - snd_soc_dapm_new_widgets(dapm->card); 1169 + snd_soc_dapm_new_widgets(card); 1176 1170 1177 1171 return 0; 1178 1172 ··· 1672 1666 { 1673 1667 struct hdac_hdmi_priv *hdmi = snd_soc_component_get_drvdata(component); 1674 1668 struct hdac_device *hdev = hdmi->hdev; 1675 - struct snd_soc_dapm_context *dapm = 1676 - snd_soc_component_get_dapm(component); 1669 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1677 1670 struct hdac_ext_link *hlink; 1678 1671 int ret; 1679 1672 ··· 1703 1698 1704 1699 hdac_hdmi_present_sense_all_pins(hdev, hdmi, true); 1705 1700 /* Imp: Store the card pointer in hda_codec */ 1706 - hdmi->card = dapm->card->snd_card; 1701 + hdmi->card = component->card->snd_card; 1707 1702 1708 1703 /* 1709 1704 * Setup a device_link between card device and HDMI codec device.
+1 -1
sound/soc/codecs/hdmi-codec.c
··· 908 908 }; 909 909 int ret, i; 910 910 911 - dapm = snd_soc_component_get_dapm(dai->component); 911 + dapm = snd_soc_component_to_dapm(dai->component); 912 912 913 913 /* One of the directions might be omitted for unidirectional DAIs */ 914 914 for (i = 0; i < ARRAY_SIZE(route); i++) {
+2 -1
sound/soc/codecs/jz4740.c
··· 231 231 static int jz4740_codec_set_bias_level(struct snd_soc_component *component, 232 232 enum snd_soc_bias_level level) 233 233 { 234 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 234 235 struct jz4740_codec *jz4740_codec = snd_soc_component_get_drvdata(component); 235 236 struct regmap *regmap = jz4740_codec->regmap; 236 237 unsigned int mask; ··· 248 247 break; 249 248 case SND_SOC_BIAS_STANDBY: 250 249 /* The only way to clear the suspend flag is to reset the codec */ 251 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) 250 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) 252 251 jz4740_codec_wakeup(regmap); 253 252 254 253 mask = JZ4740_CODEC_1_VREF_DISABLE |
+4 -3
sound/soc/codecs/jz4760.c
··· 197 197 struct snd_soc_dai *dai) 198 198 { 199 199 struct snd_soc_component *codec = dai->component; 200 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(codec); 200 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(codec); 201 201 int ret = 0; 202 202 203 203 /* ··· 214 214 struct snd_soc_dai *dai) 215 215 { 216 216 struct snd_soc_component *codec = dai->component; 217 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(codec); 217 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(codec); 218 218 219 219 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) 220 220 snd_soc_dapm_disable_pin(dapm, "SYSCLK"); ··· 225 225 int cmd, struct snd_soc_dai *dai) 226 226 { 227 227 struct snd_soc_component *codec = dai->component; 228 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(codec); 228 229 int ret = 0; 229 230 230 231 switch (cmd) { ··· 233 232 case SNDRV_PCM_TRIGGER_RESUME: 234 233 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: 235 234 if (substream->stream != SNDRV_PCM_STREAM_PLAYBACK) 236 - snd_soc_component_force_bias_level(codec, SND_SOC_BIAS_ON); 235 + snd_soc_dapm_force_bias_level(dapm, SND_SOC_BIAS_ON); 237 236 break; 238 237 case SNDRV_PCM_TRIGGER_STOP: 239 238 case SNDRV_PCM_TRIGGER_SUSPEND:
+4 -4
sound/soc/codecs/jz4770.c
··· 217 217 struct snd_soc_dai *dai) 218 218 { 219 219 struct snd_soc_component *codec = dai->component; 220 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(codec); 220 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(codec); 221 221 222 222 /* 223 223 * SYSCLK output from the codec to the AIC is required to keep the ··· 234 234 struct snd_soc_dai *dai) 235 235 { 236 236 struct snd_soc_component *codec = dai->component; 237 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(codec); 237 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(codec); 238 238 239 239 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) 240 240 snd_soc_dapm_disable_pin(dapm, "SYSCLK"); ··· 245 245 int cmd, struct snd_soc_dai *dai) 246 246 { 247 247 struct snd_soc_component *codec = dai->component; 248 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(codec); 248 249 int ret = 0; 249 250 250 251 switch (cmd) { ··· 253 252 case SNDRV_PCM_TRIGGER_RESUME: 254 253 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: 255 254 if (substream->stream != SNDRV_PCM_STREAM_PLAYBACK) 256 - snd_soc_component_force_bias_level(codec, 257 - SND_SOC_BIAS_ON); 255 + snd_soc_dapm_force_bias_level(dapm, SND_SOC_BIAS_ON); 258 256 break; 259 257 case SNDRV_PCM_TRIGGER_STOP: 260 258 case SNDRV_PCM_TRIGGER_SUSPEND:
+2 -1
sound/soc/codecs/lm49453.c
··· 1255 1255 enum snd_soc_bias_level level) 1256 1256 { 1257 1257 struct lm49453_priv *lm49453 = snd_soc_component_get_drvdata(component); 1258 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1258 1259 1259 1260 switch (level) { 1260 1261 case SND_SOC_BIAS_ON: ··· 1263 1262 break; 1264 1263 1265 1264 case SND_SOC_BIAS_STANDBY: 1266 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) 1265 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) 1267 1266 regcache_sync(lm49453->regmap); 1268 1267 1269 1268 snd_soc_component_update_bits(component, LM49453_P0_PMC_SETUP_REG,
+4 -4
sound/soc/codecs/lpass-rx-macro.c
··· 1682 1682 static int rx_macro_int_dem_inp_mux_put(struct snd_kcontrol *kcontrol, 1683 1683 struct snd_ctl_elem_value *ucontrol) 1684 1684 { 1685 - struct snd_soc_dapm_widget *widget = snd_soc_dapm_kcontrol_widget(kcontrol); 1685 + struct snd_soc_dapm_widget *widget = snd_soc_dapm_kcontrol_to_widget(kcontrol); 1686 1686 struct snd_soc_component *component = snd_soc_dapm_to_component(widget->dapm); 1687 1687 struct rx_macro *rx = snd_soc_component_get_drvdata(component); 1688 1688 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; ··· 2458 2458 static int rx_macro_mux_get(struct snd_kcontrol *kcontrol, 2459 2459 struct snd_ctl_elem_value *ucontrol) 2460 2460 { 2461 - struct snd_soc_dapm_widget *widget = snd_soc_dapm_kcontrol_widget(kcontrol); 2461 + struct snd_soc_dapm_widget *widget = snd_soc_dapm_kcontrol_to_widget(kcontrol); 2462 2462 struct snd_soc_component *component = snd_soc_dapm_to_component(widget->dapm); 2463 2463 struct rx_macro *rx = snd_soc_component_get_drvdata(component); 2464 2464 ··· 2470 2470 static int rx_macro_mux_put(struct snd_kcontrol *kcontrol, 2471 2471 struct snd_ctl_elem_value *ucontrol) 2472 2472 { 2473 - struct snd_soc_dapm_widget *widget = snd_soc_dapm_kcontrol_widget(kcontrol); 2473 + struct snd_soc_dapm_widget *widget = snd_soc_dapm_kcontrol_to_widget(kcontrol); 2474 2474 struct snd_soc_component *component = snd_soc_dapm_to_component(widget->dapm); 2475 2475 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; 2476 2476 struct snd_soc_dapm_update *update = NULL; ··· 3609 3609 3610 3610 static int rx_macro_component_probe(struct snd_soc_component *component) 3611 3611 { 3612 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 3612 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 3613 3613 struct rx_macro *rx = snd_soc_component_get_drvdata(component); 3614 3614 const struct snd_soc_dapm_widget *widgets; 3615 3615 const struct snd_kcontrol_new *controls;
+4 -4
sound/soc/codecs/lpass-tx-macro.c
··· 800 800 static int tx_macro_put_dec_enum(struct snd_kcontrol *kcontrol, 801 801 struct snd_ctl_elem_value *ucontrol) 802 802 { 803 - struct snd_soc_dapm_widget *widget = snd_soc_dapm_kcontrol_widget(kcontrol); 803 + struct snd_soc_dapm_widget *widget = snd_soc_dapm_kcontrol_to_widget(kcontrol); 804 804 struct snd_soc_component *component = snd_soc_dapm_to_component(widget->dapm); 805 805 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; 806 806 struct tx_macro *tx = snd_soc_component_get_drvdata(component); ··· 859 859 static int tx_macro_tx_mixer_get(struct snd_kcontrol *kcontrol, 860 860 struct snd_ctl_elem_value *ucontrol) 861 861 { 862 - struct snd_soc_dapm_widget *widget = snd_soc_dapm_kcontrol_widget(kcontrol); 862 + struct snd_soc_dapm_widget *widget = snd_soc_dapm_kcontrol_to_widget(kcontrol); 863 863 struct snd_soc_component *component = snd_soc_dapm_to_component(widget->dapm); 864 864 struct soc_mixer_control *mc = (struct soc_mixer_control *)kcontrol->private_value; 865 865 u32 dai_id = widget->shift; ··· 877 877 static int tx_macro_tx_mixer_put(struct snd_kcontrol *kcontrol, 878 878 struct snd_ctl_elem_value *ucontrol) 879 879 { 880 - struct snd_soc_dapm_widget *widget = snd_soc_dapm_kcontrol_widget(kcontrol); 880 + struct snd_soc_dapm_widget *widget = snd_soc_dapm_kcontrol_to_widget(kcontrol); 881 881 struct snd_soc_component *component = snd_soc_dapm_to_component(widget->dapm); 882 882 struct snd_soc_dapm_update *update = NULL; 883 883 struct soc_mixer_control *mc = (struct soc_mixer_control *)kcontrol->private_value; ··· 2081 2081 2082 2082 static int tx_macro_component_extend(struct snd_soc_component *comp) 2083 2083 { 2084 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(comp); 2084 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(comp); 2085 2085 struct tx_macro *tx = snd_soc_component_get_drvdata(comp); 2086 2086 int ret; 2087 2087
+3 -6
sound/soc/codecs/lpass-va-macro.c
··· 524 524 static int va_macro_put_dec_enum(struct snd_kcontrol *kcontrol, 525 525 struct snd_ctl_elem_value *ucontrol) 526 526 { 527 - struct snd_soc_dapm_widget *widget = 528 - snd_soc_dapm_kcontrol_widget(kcontrol); 527 + struct snd_soc_dapm_widget *widget = snd_soc_dapm_kcontrol_to_widget(kcontrol); 529 528 struct snd_soc_component *component = 530 529 snd_soc_dapm_to_component(widget->dapm); 531 530 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; ··· 563 564 static int va_macro_tx_mixer_get(struct snd_kcontrol *kcontrol, 564 565 struct snd_ctl_elem_value *ucontrol) 565 566 { 566 - struct snd_soc_dapm_widget *widget = 567 - snd_soc_dapm_kcontrol_widget(kcontrol); 567 + struct snd_soc_dapm_widget *widget = snd_soc_dapm_kcontrol_to_widget(kcontrol); 568 568 struct snd_soc_component *component = 569 569 snd_soc_dapm_to_component(widget->dapm); 570 570 struct soc_mixer_control *mc = ··· 583 585 static int va_macro_tx_mixer_put(struct snd_kcontrol *kcontrol, 584 586 struct snd_ctl_elem_value *ucontrol) 585 587 { 586 - struct snd_soc_dapm_widget *widget = 587 - snd_soc_dapm_kcontrol_widget(kcontrol); 588 + struct snd_soc_dapm_widget *widget = snd_soc_dapm_kcontrol_to_widget(kcontrol); 588 589 struct snd_soc_component *component = 589 590 snd_soc_dapm_to_component(widget->dapm); 590 591 struct snd_soc_dapm_update *update = NULL;
+5 -7
sound/soc/codecs/lpass-wsa-macro.c
··· 2186 2186 static int wsa_macro_rx_mux_get(struct snd_kcontrol *kcontrol, 2187 2187 struct snd_ctl_elem_value *ucontrol) 2188 2188 { 2189 - struct snd_soc_dapm_widget *widget = 2190 - snd_soc_dapm_kcontrol_widget(kcontrol); 2189 + struct snd_soc_dapm_widget *widget = snd_soc_dapm_kcontrol_to_widget(kcontrol); 2191 2190 struct snd_soc_component *component = 2192 2191 snd_soc_dapm_to_component(widget->dapm); 2193 2192 struct wsa_macro *wsa = snd_soc_component_get_drvdata(component); ··· 2199 2200 static int wsa_macro_rx_mux_put(struct snd_kcontrol *kcontrol, 2200 2201 struct snd_ctl_elem_value *ucontrol) 2201 2202 { 2202 - struct snd_soc_dapm_widget *widget = 2203 - snd_soc_dapm_kcontrol_widget(kcontrol); 2203 + struct snd_soc_dapm_widget *widget = snd_soc_dapm_kcontrol_to_widget(kcontrol); 2204 2204 struct snd_soc_component *component = 2205 2205 snd_soc_dapm_to_component(widget->dapm); 2206 2206 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; ··· 2329 2331 static int wsa_macro_vi_feed_mixer_get(struct snd_kcontrol *kcontrol, 2330 2332 struct snd_ctl_elem_value *ucontrol) 2331 2333 { 2332 - struct snd_soc_dapm_widget *widget = snd_soc_dapm_kcontrol_widget(kcontrol); 2334 + struct snd_soc_dapm_widget *widget = snd_soc_dapm_kcontrol_to_widget(kcontrol); 2333 2335 struct snd_soc_component *component = snd_soc_dapm_to_component(widget->dapm); 2334 2336 struct soc_mixer_control *mixer = (struct soc_mixer_control *)kcontrol->private_value; 2335 2337 struct wsa_macro *wsa = snd_soc_component_get_drvdata(component); ··· 2347 2349 static int wsa_macro_vi_feed_mixer_put(struct snd_kcontrol *kcontrol, 2348 2350 struct snd_ctl_elem_value *ucontrol) 2349 2351 { 2350 - struct snd_soc_dapm_widget *widget = snd_soc_dapm_kcontrol_widget(kcontrol); 2352 + struct snd_soc_dapm_widget *widget = snd_soc_dapm_kcontrol_to_widget(kcontrol); 2351 2353 struct snd_soc_component *component = snd_soc_dapm_to_component(widget->dapm); 2352 2354 struct soc_mixer_control *mixer = (struct soc_mixer_control *)kcontrol->private_value; 2353 2355 struct wsa_macro *wsa = snd_soc_component_get_drvdata(component); ··· 2663 2665 2664 2666 static int wsa_macro_component_probe(struct snd_soc_component *comp) 2665 2667 { 2666 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(comp); 2668 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(comp); 2667 2669 struct wsa_macro *wsa = snd_soc_component_get_drvdata(comp); 2668 2670 const struct snd_soc_dapm_widget *widgets; 2669 2671 unsigned int num_widgets;
+9 -18
sound/soc/codecs/madera.c
··· 541 541 int madera_out1_demux_put(struct snd_kcontrol *kcontrol, 542 542 struct snd_ctl_elem_value *ucontrol) 543 543 { 544 - struct snd_soc_component *component = 545 - snd_soc_dapm_kcontrol_component(kcontrol); 546 - struct snd_soc_dapm_context *dapm = 547 - snd_soc_dapm_kcontrol_dapm(kcontrol); 544 + struct snd_soc_component *component = snd_soc_dapm_kcontrol_to_component(kcontrol); 545 + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol); 548 546 struct madera_priv *priv = snd_soc_component_get_drvdata(component); 549 547 struct madera *madera = priv->madera; 550 548 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; ··· 630 632 int madera_out1_demux_get(struct snd_kcontrol *kcontrol, 631 633 struct snd_ctl_elem_value *ucontrol) 632 634 { 633 - struct snd_soc_component *component = 634 - snd_soc_dapm_kcontrol_component(kcontrol); 635 + struct snd_soc_component *component = snd_soc_dapm_kcontrol_to_component(kcontrol); 635 636 unsigned int val; 636 637 637 638 val = snd_soc_component_read(component, MADERA_OUTPUT_ENABLES_1); ··· 645 648 static int madera_inmux_put(struct snd_kcontrol *kcontrol, 646 649 struct snd_ctl_elem_value *ucontrol) 647 650 { 648 - struct snd_soc_component *component = 649 - snd_soc_dapm_kcontrol_component(kcontrol); 650 - struct snd_soc_dapm_context *dapm = 651 - snd_soc_dapm_kcontrol_dapm(kcontrol); 651 + struct snd_soc_component *component = snd_soc_dapm_kcontrol_to_component(kcontrol); 652 + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol); 652 653 struct madera_priv *priv = snd_soc_component_get_drvdata(component); 653 654 struct madera *madera = priv->madera; 654 655 struct regmap *regmap = madera->regmap; ··· 1206 1211 const struct snd_soc_dapm_route *routes, 1207 1212 int n_mono_routes, int n_real) 1208 1213 { 1209 - struct snd_soc_dapm_context *dapm = 1210 - snd_soc_component_get_dapm(component); 1214 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1211 1215 struct madera_priv *priv = snd_soc_component_get_drvdata(component); 1212 1216 struct madera *madera = priv->madera; 1213 1217 const struct madera_codec_pdata *pdata = &madera->pdata.codec; ··· 2155 2161 struct snd_ctl_elem_value *ucontrol) 2156 2162 { 2157 2163 struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 2158 - struct snd_soc_dapm_context *dapm = 2159 - snd_soc_component_get_dapm(component); 2164 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 2160 2165 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; 2161 2166 unsigned int reg = e->reg; 2162 2167 unsigned int val; ··· 2186 2193 struct soc_mixer_control *mc = 2187 2194 (struct soc_mixer_control *)kcontrol->private_value; 2188 2195 struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 2189 - struct snd_soc_dapm_context *dapm = 2190 - snd_soc_component_get_dapm(component); 2196 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 2191 2197 unsigned int val, mask; 2192 2198 int ret; 2193 2199 ··· 3228 3236 int clk_id, unsigned int freq, int dir) 3229 3237 { 3230 3238 struct snd_soc_component *component = dai->component; 3231 - struct snd_soc_dapm_context *dapm = 3232 - snd_soc_component_get_dapm(component); 3239 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 3233 3240 struct madera_priv *priv = snd_soc_component_get_drvdata(component); 3234 3241 struct madera_dai_priv *dai_priv = &priv->dai[dai->id - 1]; 3235 3242 struct snd_soc_dapm_route routes[2];
+3 -3
sound/soc/codecs/max98088.c
··· 1296 1296 enum snd_soc_bias_level level) 1297 1297 { 1298 1298 struct max98088_priv *max98088 = snd_soc_component_get_drvdata(component); 1299 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1299 1300 int ret; 1300 1301 1301 1302 switch (level) { ··· 1312 1311 * enable it. 1313 1312 */ 1314 1313 if (!IS_ERR(max98088->mclk)) { 1315 - if (snd_soc_component_get_bias_level(component) == 1316 - SND_SOC_BIAS_ON) { 1314 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_ON) { 1317 1315 clk_disable_unprepare(max98088->mclk); 1318 1316 } else { 1319 1317 ret = clk_prepare_enable(max98088->mclk); ··· 1323 1323 break; 1324 1324 1325 1325 case SND_SOC_BIAS_STANDBY: 1326 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) 1326 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) 1327 1327 regcache_sync(max98088->regmap); 1328 1328 1329 1329 snd_soc_component_update_bits(component, M98088_REG_4C_PWR_EN_IN,
+4 -3
sound/soc/codecs/max98090.c
··· 1469 1469 static int max98090_add_widgets(struct snd_soc_component *component) 1470 1470 { 1471 1471 struct max98090_priv *max98090 = snd_soc_component_get_drvdata(component); 1472 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 1472 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1473 1473 1474 1474 snd_soc_add_component_controls(component, max98090_snd_controls, 1475 1475 ARRAY_SIZE(max98090_snd_controls)); ··· 1751 1751 enum snd_soc_bias_level level) 1752 1752 { 1753 1753 struct max98090_priv *max98090 = snd_soc_component_get_drvdata(component); 1754 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1754 1755 int ret; 1755 1756 1756 1757 switch (level) { ··· 1769 1768 if (IS_ERR(max98090->mclk)) 1770 1769 break; 1771 1770 1772 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_ON) { 1771 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_ON) { 1773 1772 clk_disable_unprepare(max98090->mclk); 1774 1773 } else { 1775 1774 ret = clk_prepare_enable(max98090->mclk); ··· 1779 1778 break; 1780 1779 1781 1780 case SND_SOC_BIAS_STANDBY: 1782 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { 1781 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) { 1783 1782 ret = regcache_sync(max98090->regmap); 1784 1783 if (ret != 0) { 1785 1784 dev_err(component->dev,
+7 -4
sound/soc/codecs/max98095.c
··· 1359 1359 enum snd_soc_bias_level level) 1360 1360 { 1361 1361 struct max98095_priv *max98095 = snd_soc_component_get_drvdata(component); 1362 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1362 1363 int ret; 1363 1364 1364 1365 switch (level) { ··· 1377 1376 if (IS_ERR(max98095->mclk)) 1378 1377 break; 1379 1378 1380 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_ON) { 1379 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_ON) { 1381 1380 clk_disable_unprepare(max98095->mclk); 1382 1381 } else { 1383 1382 ret = clk_prepare_enable(max98095->mclk); ··· 1387 1386 break; 1388 1387 1389 1388 case SND_SOC_BIAS_STANDBY: 1390 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { 1389 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) { 1391 1390 ret = regcache_sync(max98095->regmap); 1392 1391 1393 1392 if (ret != 0) { ··· 1918 1917 static int max98095_suspend(struct snd_soc_component *component) 1919 1918 { 1920 1919 struct max98095_priv *max98095 = snd_soc_component_get_drvdata(component); 1920 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1921 1921 1922 1922 if (max98095->headphone_jack || max98095->mic_jack) 1923 1923 max98095_jack_detect_disable(component); 1924 1924 1925 - snd_soc_component_force_bias_level(component, SND_SOC_BIAS_OFF); 1925 + snd_soc_dapm_force_bias_level(dapm, SND_SOC_BIAS_OFF); 1926 1926 1927 1927 return 0; 1928 1928 } ··· 1932 1930 { 1933 1931 struct max98095_priv *max98095 = snd_soc_component_get_drvdata(component); 1934 1932 struct i2c_client *client = to_i2c_client(component->dev); 1933 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1935 1934 1936 - snd_soc_component_force_bias_level(component, SND_SOC_BIAS_STANDBY); 1935 + snd_soc_dapm_force_bias_level(dapm, SND_SOC_BIAS_STANDBY); 1937 1936 1938 1937 if (max98095->headphone_jack || max98095->mic_jack) { 1939 1938 max98095_jack_detect_enable(component);
+2 -1
sound/soc/codecs/max98373.c
··· 174 174 struct snd_ctl_elem_value *ucontrol) 175 175 { 176 176 struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 177 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 177 178 struct soc_mixer_control *mc = 178 179 (struct soc_mixer_control *)kcontrol->private_value; 179 180 struct max98373_priv *max98373 = snd_soc_component_get_drvdata(component); 180 181 int i; 181 182 182 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { 183 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) { 183 184 /* 184 185 * Register values will be cached before suspend. The cached value 185 186 * will be a valid value and userspace will happy with that.
+1 -1
sound/soc/codecs/max98390.c
··· 628 628 { 629 629 struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 630 630 struct max98390_priv *max98390 = snd_soc_component_get_drvdata(component); 631 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 631 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 632 632 unsigned int rdc, rdc_cal_result, rdc_integer, rdc_factor, temp, val; 633 633 634 634 snd_soc_dapm_mutex_lock(dapm);
+5 -6
sound/soc/codecs/max98396.c
··· 953 953 static int max98396_mux_get(struct snd_kcontrol *kcontrol, 954 954 struct snd_ctl_elem_value *ucontrol) 955 955 { 956 - struct snd_soc_component *component = 957 - snd_soc_dapm_kcontrol_component(kcontrol); 956 + struct snd_soc_component *component = snd_soc_dapm_kcontrol_to_component(kcontrol); 958 957 struct max98396_priv *max98396 = snd_soc_component_get_drvdata(component); 959 958 int reg, val; 960 959 ··· 972 973 static int max98396_mux_put(struct snd_kcontrol *kcontrol, 973 974 struct snd_ctl_elem_value *ucontrol) 974 975 { 975 - struct snd_soc_component *component = 976 - snd_soc_dapm_kcontrol_component(kcontrol); 977 - struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_dapm(kcontrol); 976 + struct snd_soc_component *component = snd_soc_dapm_kcontrol_to_component(kcontrol); 977 + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol); 978 978 struct max98396_priv *max98396 = snd_soc_component_get_drvdata(component); 979 979 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; 980 980 unsigned int *item = ucontrol->value.enumerated.item; ··· 1105 1107 struct snd_ctl_elem_value *ucontrol) 1106 1108 { 1107 1109 struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 1110 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1108 1111 struct soc_mixer_control *mc = 1109 1112 (struct soc_mixer_control *)kcontrol->private_value; 1110 1113 struct max98396_priv *max98396 = snd_soc_component_get_drvdata(component); ··· 1114 1115 int reg = mc->reg; 1115 1116 1116 1117 /* ADC value is not available if the device is powered down */ 1117 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) 1118 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) 1118 1119 goto exit; 1119 1120 1120 1121 if (max98396->device_id == CODEC_TYPE_MAX98397) {
+2 -1
sound/soc/codecs/max9850.c
··· 225 225 enum snd_soc_bias_level level) 226 226 { 227 227 struct max9850_priv *max9850 = snd_soc_component_get_drvdata(component); 228 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 228 229 int ret; 229 230 230 231 switch (level) { ··· 234 233 case SND_SOC_BIAS_PREPARE: 235 234 break; 236 235 case SND_SOC_BIAS_STANDBY: 237 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { 236 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) { 238 237 ret = regcache_sync(max9850->regmap); 239 238 if (ret) { 240 239 dev_err(component->dev,
+8 -3
sound/soc/codecs/max9867.c
··· 556 556 #ifdef CONFIG_PM 557 557 static int max9867_suspend(struct snd_soc_component *component) 558 558 { 559 - snd_soc_component_force_bias_level(component, SND_SOC_BIAS_OFF); 559 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 560 + 561 + snd_soc_dapm_force_bias_level(dapm, SND_SOC_BIAS_OFF); 560 562 561 563 return 0; 562 564 } 563 565 564 566 static int max9867_resume(struct snd_soc_component *component) 565 567 { 566 - snd_soc_component_force_bias_level(component, SND_SOC_BIAS_STANDBY); 568 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 569 + 570 + snd_soc_dapm_force_bias_level(dapm, SND_SOC_BIAS_STANDBY); 567 571 568 572 return 0; 569 573 } ··· 581 577 { 582 578 int err; 583 579 struct max9867_priv *max9867 = snd_soc_component_get_drvdata(component); 580 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 584 581 585 582 switch (level) { 586 583 case SND_SOC_BIAS_ON: ··· 590 585 return err; 591 586 break; 592 587 case SND_SOC_BIAS_STANDBY: 593 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { 588 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) { 594 589 err = regcache_sync(max9867->regmap); 595 590 if (err) 596 591 return err;
+2 -1
sound/soc/codecs/ml26124.c
··· 459 459 enum snd_soc_bias_level level) 460 460 { 461 461 struct ml26124_priv *priv = snd_soc_component_get_drvdata(component); 462 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 462 463 463 464 switch (level) { 464 465 case SND_SOC_BIAS_ON: ··· 474 473 break; 475 474 case SND_SOC_BIAS_STANDBY: 476 475 /* VMID ON */ 477 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { 476 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) { 478 477 snd_soc_component_update_bits(component, ML26124_PW_REF_PW_MNG, 479 478 ML26124_VMID, ML26124_VMID); 480 479 msleep(500);
+1 -1
sound/soc/codecs/mt6357.c
··· 597 597 { 598 598 struct snd_soc_component *cmpnt = snd_soc_dapm_to_component(w->dapm); 599 599 struct mt6357_priv *priv = snd_soc_component_get_drvdata(cmpnt); 600 - unsigned int mic_type = dapm_kcontrol_get_value(w->kcontrols[0]); 600 + unsigned int mic_type = snd_soc_dapm_kcontrol_get_value(w->kcontrols[0]); 601 601 602 602 switch (event) { 603 603 case SND_SOC_DAPM_PRE_PMU:
+7 -7
sound/soc/codecs/mt6358.c
··· 1287 1287 { 1288 1288 struct snd_soc_component *cmpnt = snd_soc_dapm_to_component(w->dapm); 1289 1289 struct mt6358_priv *priv = snd_soc_component_get_drvdata(cmpnt); 1290 - unsigned int mux = dapm_kcontrol_get_value(w->kcontrols[0]); 1290 + unsigned int mux = snd_soc_dapm_kcontrol_get_value(w->kcontrols[0]); 1291 1291 int device = DEVICE_HP; 1292 1292 1293 1293 dev_info(priv->dev, "%s(), event 0x%x, dev_counter[DEV_HP] %d, mux %u\n", ··· 1349 1349 dev_info(priv->dev, "%s(), event 0x%x, mux %u\n", 1350 1350 __func__, 1351 1351 event, 1352 - dapm_kcontrol_get_value(w->kcontrols[0])); 1352 + snd_soc_dapm_kcontrol_get_value(w->kcontrols[0])); 1353 1353 1354 1354 switch (event) { 1355 1355 case SND_SOC_DAPM_PRE_PMU: ··· 1828 1828 { 1829 1829 struct snd_soc_component *cmpnt = snd_soc_dapm_to_component(w->dapm); 1830 1830 struct mt6358_priv *priv = snd_soc_component_get_drvdata(cmpnt); 1831 - unsigned int mux = dapm_kcontrol_get_value(w->kcontrols[0]); 1831 + unsigned int mux = snd_soc_dapm_kcontrol_get_value(w->kcontrols[0]); 1832 1832 1833 1833 dev_dbg(priv->dev, "%s(), event 0x%x, mux %u\n", 1834 1834 __func__, event, mux); ··· 1874 1874 { 1875 1875 struct snd_soc_component *cmpnt = snd_soc_dapm_to_component(w->dapm); 1876 1876 struct mt6358_priv *priv = snd_soc_component_get_drvdata(cmpnt); 1877 - unsigned int mux = dapm_kcontrol_get_value(w->kcontrols[0]); 1877 + unsigned int mux = snd_soc_dapm_kcontrol_get_value(w->kcontrols[0]); 1878 1878 1879 1879 dev_dbg(priv->dev, "%s(), event = 0x%x, mux %u\n", 1880 1880 __func__, event, mux); ··· 1890 1890 { 1891 1891 struct snd_soc_component *cmpnt = snd_soc_dapm_to_component(w->dapm); 1892 1892 struct mt6358_priv *priv = snd_soc_component_get_drvdata(cmpnt); 1893 - unsigned int mux = dapm_kcontrol_get_value(w->kcontrols[0]); 1893 + unsigned int mux = snd_soc_dapm_kcontrol_get_value(w->kcontrols[0]); 1894 1894 1895 1895 dev_dbg(priv->dev, "%s(), event = 0x%x, mux %u\n", 1896 1896 __func__, event, mux); ··· 1906 1906 { 1907 1907 struct snd_soc_component *cmpnt = snd_soc_dapm_to_component(w->dapm); 1908 1908 struct mt6358_priv *priv = snd_soc_component_get_drvdata(cmpnt); 1909 - unsigned int mux = dapm_kcontrol_get_value(w->kcontrols[0]); 1909 + unsigned int mux = snd_soc_dapm_kcontrol_get_value(w->kcontrols[0]); 1910 1910 1911 1911 dev_dbg(priv->dev, "%s(), event = 0x%x, mux %u\n", 1912 1912 __func__, event, mux); ··· 1922 1922 { 1923 1923 struct snd_soc_component *cmpnt = snd_soc_dapm_to_component(w->dapm); 1924 1924 struct mt6358_priv *priv = snd_soc_component_get_drvdata(cmpnt); 1925 - unsigned int mux = dapm_kcontrol_get_value(w->kcontrols[0]); 1925 + unsigned int mux = snd_soc_dapm_kcontrol_get_value(w->kcontrols[0]); 1926 1926 1927 1927 dev_dbg(priv->dev, "%s(), event = 0x%x, mux %u\n", 1928 1928 __func__, event, mux);
+6 -6
sound/soc/codecs/mt6359.c
··· 1043 1043 { 1044 1044 struct snd_soc_component *cmpnt = snd_soc_dapm_to_component(w->dapm); 1045 1045 struct mt6359_priv *priv = snd_soc_component_get_drvdata(cmpnt); 1046 - unsigned int mux = dapm_kcontrol_get_value(w->kcontrols[0]); 1046 + unsigned int mux = snd_soc_dapm_kcontrol_get_value(w->kcontrols[0]); 1047 1047 int device = DEVICE_HP; 1048 1048 1049 1049 dev_dbg(priv->dev, "%s(), event 0x%x, dev_counter[DEV_HP] %d, mux %u\n", ··· 1075 1075 struct mt6359_priv *priv = snd_soc_component_get_drvdata(cmpnt); 1076 1076 1077 1077 dev_dbg(priv->dev, "%s(), event 0x%x, mux %u\n", 1078 - __func__, event, dapm_kcontrol_get_value(w->kcontrols[0])); 1078 + __func__, event, snd_soc_dapm_kcontrol_get_value(w->kcontrols[0])); 1079 1079 1080 1080 switch (event) { 1081 1081 case SND_SOC_DAPM_PRE_PMU: ··· 1157 1157 { 1158 1158 struct snd_soc_component *cmpnt = snd_soc_dapm_to_component(w->dapm); 1159 1159 struct mt6359_priv *priv = snd_soc_component_get_drvdata(cmpnt); 1160 - unsigned int mux = dapm_kcontrol_get_value(w->kcontrols[0]); 1160 + unsigned int mux = snd_soc_dapm_kcontrol_get_value(w->kcontrols[0]); 1161 1161 1162 1162 dev_dbg(priv->dev, "%s(), event 0x%x, mux %u\n", 1163 1163 __func__, event, mux); ··· 1637 1637 { 1638 1638 struct snd_soc_component *cmpnt = snd_soc_dapm_to_component(w->dapm); 1639 1639 struct mt6359_priv *priv = snd_soc_component_get_drvdata(cmpnt); 1640 - unsigned int mux = dapm_kcontrol_get_value(w->kcontrols[0]); 1640 + unsigned int mux = snd_soc_dapm_kcontrol_get_value(w->kcontrols[0]); 1641 1641 1642 1642 dev_dbg(priv->dev, "%s(), mux %d\n", __func__, mux); 1643 1643 priv->mux_select[MUX_PGA_L] = mux >> RG_AUDPREAMPLINPUTSEL_SFT; ··· 1650 1650 { 1651 1651 struct snd_soc_component *cmpnt = snd_soc_dapm_to_component(w->dapm); 1652 1652 struct mt6359_priv *priv = snd_soc_component_get_drvdata(cmpnt); 1653 - unsigned int mux = dapm_kcontrol_get_value(w->kcontrols[0]); 1653 + unsigned int mux = snd_soc_dapm_kcontrol_get_value(w->kcontrols[0]); 1654 1654 1655 1655 dev_dbg(priv->dev, "%s(), mux %d\n", __func__, mux); 1656 1656 priv->mux_select[MUX_PGA_R] = mux >> RG_AUDPREAMPRINPUTSEL_SFT; ··· 1663 1663 { 1664 1664 struct snd_soc_component *cmpnt = snd_soc_dapm_to_component(w->dapm); 1665 1665 struct mt6359_priv *priv = snd_soc_component_get_drvdata(cmpnt); 1666 - unsigned int mux = dapm_kcontrol_get_value(w->kcontrols[0]); 1666 + unsigned int mux = snd_soc_dapm_kcontrol_get_value(w->kcontrols[0]); 1667 1667 1668 1668 dev_dbg(priv->dev, "%s(), mux %d\n", __func__, mux); 1669 1669 priv->mux_select[MUX_PGA_3] = mux >> RG_AUDPREAMP3INPUTSEL_SFT;
+2 -1
sound/soc/codecs/nau8810.c
··· 775 775 static int nau8810_set_bias_level(struct snd_soc_component *component, 776 776 enum snd_soc_bias_level level) 777 777 { 778 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 778 779 struct nau8810 *nau8810 = snd_soc_component_get_drvdata(component); 779 780 struct regmap *map = nau8810->regmap; 780 781 ··· 791 790 NAU8810_IOBUF_EN | NAU8810_ABIAS_EN, 792 791 NAU8810_IOBUF_EN | NAU8810_ABIAS_EN); 793 792 794 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { 793 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) { 795 794 regcache_sync(map); 796 795 regmap_update_bits(map, NAU8810_REG_POWER1, 797 796 NAU8810_REFIMP_MASK, NAU8810_REFIMP_3K);
+11 -17
sound/soc/codecs/nau8821.c
··· 1047 1047 { 1048 1048 struct snd_soc_dapm_context *dapm = nau8821->dapm; 1049 1049 struct regmap *regmap = nau8821->regmap; 1050 - struct snd_soc_component *component = snd_soc_dapm_to_component(dapm); 1051 1050 1052 1051 /* Detach 2kOhm Resistors from MICBIAS to MICGND */ 1053 1052 regmap_update_bits(regmap, NAU8821_R74_MIC_BIAS, ··· 1054 1055 /* HPL/HPR short to ground */ 1055 1056 regmap_update_bits(regmap, NAU8821_R0D_JACK_DET_CTRL, 1056 1057 NAU8821_SPKR_DWN1R | NAU8821_SPKR_DWN1L, 0); 1057 - snd_soc_component_disable_pin(component, "MICBIAS"); 1058 + snd_soc_dapm_disable_pin(dapm, "MICBIAS"); 1058 1059 snd_soc_dapm_sync(dapm); 1059 1060 1060 1061 /* Disable & mask both insertion & ejection IRQs */ ··· 1079 1080 NAU8821_JACK_DET_DB_BYPASS, NAU8821_JACK_DET_DB_BYPASS); 1080 1081 1081 1082 /* Close clock for jack type detection at manual mode */ 1082 - if (dapm->bias_level < SND_SOC_BIAS_PREPARE) 1083 + if (snd_soc_dapm_get_bias_level(dapm) < SND_SOC_BIAS_PREPARE) 1083 1084 nau8821_configure_sysclk(nau8821, NAU8821_CLK_DIS, 0); 1084 1085 1085 1086 /* Recover to normal channel input */ ··· 1105 1106 struct nau8821 *nau8821 = 1106 1107 container_of(work, struct nau8821, jdet_work.work); 1107 1108 struct snd_soc_dapm_context *dapm = nau8821->dapm; 1108 - struct snd_soc_component *component = snd_soc_dapm_to_component(dapm); 1109 1109 struct regmap *regmap = nau8821->regmap; 1110 1110 int jack_status_reg, mic_detected, event = 0, event_mask = 0; 1111 1111 ··· 1131 1133 NAU8821_IRQ_KEY_RELEASE_DIS | 1132 1134 NAU8821_IRQ_KEY_PRESS_DIS, 0); 1133 1135 } else { 1134 - snd_soc_component_disable_pin(component, "MICBIAS"); 1135 - snd_soc_dapm_sync(nau8821->dapm); 1136 + snd_soc_dapm_disable_pin(dapm, "MICBIAS"); 1137 + snd_soc_dapm_sync(dapm); 1136 1138 } 1137 1139 } else { 1138 1140 dev_dbg(nau8821->dev, "Headphone connected\n"); 1139 1141 event |= SND_JACK_HEADPHONE; 1140 - snd_soc_component_disable_pin(component, "MICBIAS"); 1142 + snd_soc_dapm_disable_pin(dapm, "MICBIAS"); 1141 1143 snd_soc_dapm_sync(dapm); 1142 1144 } 1143 1145 ··· 1160 1162 nau8821_irq_status_clear(regmap, NAU8821_JACK_INSERT_DETECTED); 1161 1163 1162 1164 /* Enable internal VCO needed for interruptions */ 1163 - if (nau8821->dapm->bias_level < SND_SOC_BIAS_PREPARE) 1165 + if (snd_soc_dapm_get_bias_level(nau8821->dapm) < SND_SOC_BIAS_PREPARE) 1164 1166 nau8821_configure_sysclk(nau8821, NAU8821_CLK_INTERNAL, 0); 1165 1167 1166 1168 /* Chip needs one FSCLK cycle in order to generate interruptions, ··· 1189 1191 { 1190 1192 struct nau8821 *nau8821 = (struct nau8821 *)data; 1191 1193 struct regmap *regmap = nau8821->regmap; 1192 - struct snd_soc_component *component; 1193 1194 int active_irq, event = 0, event_mask = 0; 1194 1195 1195 1196 if (regmap_read(regmap, NAU8821_R10_IRQ_STATUS, &active_irq)) { ··· 1219 1222 NAU8821_MICDET_MASK, NAU8821_MICDET_EN); 1220 1223 if (nau8821_is_jack_inserted(regmap)) { 1221 1224 /* Detect microphone and jack type */ 1222 - component = snd_soc_dapm_to_component(nau8821->dapm); 1223 - snd_soc_component_force_enable_pin(component, "MICBIAS"); 1225 + snd_soc_dapm_force_enable_pin(nau8821->dapm, "MICBIAS"); 1224 1226 snd_soc_dapm_sync(nau8821->dapm); 1225 1227 schedule_delayed_work(&nau8821->jdet_work, msecs_to_jiffies(20)); 1226 1228 /* Turn off insertion interruption at manual mode */ ··· 1257 1261 static int nau8821_component_probe(struct snd_soc_component *component) 1258 1262 { 1259 1263 struct nau8821 *nau8821 = snd_soc_component_get_drvdata(component); 1260 - struct snd_soc_dapm_context *dapm = 1261 - snd_soc_component_get_dapm(component); 1264 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1262 1265 1263 1266 nau8821->dapm = dapm; 1264 1267 ··· 1559 1564 1560 1565 case SND_SOC_BIAS_STANDBY: 1561 1566 /* Setup codec configuration after resume */ 1562 - if (snd_soc_component_get_bias_level(component) == 1563 - SND_SOC_BIAS_OFF) 1567 + if (snd_soc_dapm_get_bias_level(nau8821->dapm) == SND_SOC_BIAS_OFF) 1564 1568 nau8821_resume_setup(nau8821); 1565 1569 break; 1566 1570 ··· 1597 1603 1598 1604 if (nau8821->irq) 1599 1605 disable_irq(nau8821->irq); 1600 - snd_soc_component_force_bias_level(component, SND_SOC_BIAS_OFF); 1606 + snd_soc_dapm_force_bias_level(nau8821->dapm, SND_SOC_BIAS_OFF); 1601 1607 /* Power down codec power; don't support button wakeup */ 1602 - snd_soc_component_disable_pin(component, "MICBIAS"); 1608 + snd_soc_dapm_disable_pin(nau8821->dapm, "MICBIAS"); 1603 1609 snd_soc_dapm_sync(nau8821->dapm); 1604 1610 regcache_cache_only(nau8821->regmap, true); 1605 1611 regcache_mark_dirty(nau8821->regmap);
+8 -6
sound/soc/codecs/nau8822.c
··· 957 957 enum snd_soc_bias_level level) 958 958 { 959 959 struct nau8822 *nau8822 = snd_soc_component_get_drvdata(component); 960 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 960 961 961 962 switch (level) { 962 963 case SND_SOC_BIAS_ON: ··· 965 964 966 965 case SND_SOC_BIAS_PREPARE: 967 966 if (nau8822->mclk && 968 - snd_soc_component_get_bias_level(component) != SND_SOC_BIAS_ON) { 967 + snd_soc_dapm_get_bias_level(dapm) != SND_SOC_BIAS_ON) { 969 968 int ret = clk_prepare_enable(nau8822->mclk); 970 969 971 970 if (ret) { ··· 982 981 983 982 case SND_SOC_BIAS_STANDBY: 984 983 if (nau8822->mclk && 985 - snd_soc_component_get_bias_level(component) != SND_SOC_BIAS_OFF) 984 + snd_soc_dapm_get_bias_level(dapm) != SND_SOC_BIAS_OFF) 986 985 clk_disable_unprepare(nau8822->mclk); 987 986 988 987 snd_soc_component_update_bits(component, ··· 990 989 NAU8822_IOBUF_EN | NAU8822_ABIAS_EN, 991 990 NAU8822_IOBUF_EN | NAU8822_ABIAS_EN); 992 991 993 - if (snd_soc_component_get_bias_level(component) == 994 - SND_SOC_BIAS_OFF) { 992 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) { 995 993 snd_soc_component_update_bits(component, 996 994 NAU8822_REG_POWER_MANAGEMENT_1, 997 995 NAU8822_REFIMP_MASK, NAU8822_REFIMP_3K); ··· 1053 1053 static int nau8822_suspend(struct snd_soc_component *component) 1054 1054 { 1055 1055 struct nau8822 *nau8822 = snd_soc_component_get_drvdata(component); 1056 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1056 1057 1057 - snd_soc_component_force_bias_level(component, SND_SOC_BIAS_OFF); 1058 + snd_soc_dapm_force_bias_level(dapm, SND_SOC_BIAS_OFF); 1058 1059 1059 1060 regcache_mark_dirty(nau8822->regmap); 1060 1061 ··· 1065 1064 static int nau8822_resume(struct snd_soc_component *component) 1066 1065 { 1067 1066 struct nau8822 *nau8822 = snd_soc_component_get_drvdata(component); 1067 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1068 1068 1069 1069 regcache_sync(nau8822->regmap); 1070 1070 1071 - snd_soc_component_force_bias_level(component, SND_SOC_BIAS_STANDBY); 1071 + snd_soc_dapm_force_bias_level(dapm, SND_SOC_BIAS_STANDBY); 1072 1072 1073 1073 return 0; 1074 1074 }
+5 -5
sound/soc/codecs/nau8824.c
··· 876 876 NAU8824_JD_SLEEP_MODE, NAU8824_JD_SLEEP_MODE); 877 877 878 878 /* Close clock for jack type detection at manual mode */ 879 - if (dapm->bias_level < SND_SOC_BIAS_PREPARE) 879 + if (snd_soc_dapm_get_bias_level(dapm) < SND_SOC_BIAS_PREPARE) 880 880 nau8824_config_sysclk(nau8824, NAU8824_CLK_DIS, 0); 881 881 } 882 882 ··· 931 931 regmap_update_bits(regmap, NAU8824_REG_INTERRUPT_SETTING, 932 932 NAU8824_IRQ_EJECT_DIS, 0); 933 933 /* Enable internal VCO needed for interruptions */ 934 - if (nau8824->dapm->bias_level < SND_SOC_BIAS_PREPARE) 934 + if (snd_soc_dapm_get_bias_level(nau8824->dapm) < SND_SOC_BIAS_PREPARE) 935 935 nau8824_config_sysclk(nau8824, NAU8824_CLK_INTERNAL, 0); 936 936 regmap_update_bits(regmap, NAU8824_REG_ENA_CTRL, 937 937 NAU8824_JD_SLEEP_MODE, 0); ··· 1498 1498 break; 1499 1499 1500 1500 case SND_SOC_BIAS_STANDBY: 1501 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { 1501 + if (snd_soc_dapm_get_bias_level(nau8824->dapm) == SND_SOC_BIAS_OFF) { 1502 1502 /* Setup codec configuration after resume */ 1503 1503 nau8824_resume_setup(nau8824); 1504 1504 } ··· 1519 1519 static int nau8824_component_probe(struct snd_soc_component *component) 1520 1520 { 1521 1521 struct nau8824 *nau8824 = snd_soc_component_get_drvdata(component); 1522 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 1522 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1523 1523 1524 1524 nau8824->dapm = dapm; 1525 1525 ··· 1532 1532 1533 1533 if (nau8824->irq) { 1534 1534 disable_irq(nau8824->irq); 1535 - snd_soc_component_force_bias_level(component, SND_SOC_BIAS_OFF); 1535 + snd_soc_dapm_force_bias_level(nau8824->dapm, SND_SOC_BIAS_OFF); 1536 1536 } 1537 1537 regcache_cache_only(nau8824->regmap, true); 1538 1538 regcache_mark_dirty(nau8824->regmap);
+3 -3
sound/soc/codecs/nau8825.c
··· 2226 2226 static int nau8825_component_probe(struct snd_soc_component *component) 2227 2227 { 2228 2228 struct nau8825 *nau8825 = snd_soc_component_get_drvdata(component); 2229 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 2229 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 2230 2230 2231 2231 nau8825->dapm = dapm; 2232 2232 ··· 2630 2630 break; 2631 2631 2632 2632 case SND_SOC_BIAS_STANDBY: 2633 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { 2633 + if (snd_soc_dapm_get_bias_level(nau8825->dapm) == SND_SOC_BIAS_OFF) { 2634 2634 if (nau8825->mclk_freq) { 2635 2635 ret = clk_prepare_enable(nau8825->mclk); 2636 2636 if (ret) { ··· 2673 2673 struct nau8825 *nau8825 = snd_soc_component_get_drvdata(component); 2674 2674 2675 2675 disable_irq(nau8825->irq); 2676 - snd_soc_component_force_bias_level(component, SND_SOC_BIAS_OFF); 2676 + snd_soc_dapm_force_bias_level(nau8825->dapm, SND_SOC_BIAS_OFF); 2677 2677 /* Power down codec power; don't suppoet button wakeup */ 2678 2678 snd_soc_dapm_disable_pin(nau8825->dapm, "SAR"); 2679 2679 snd_soc_dapm_disable_pin(nau8825->dapm, "MICBIAS");
+4 -2
sound/soc/codecs/pcm186x.c
··· 546 546 static int pcm186x_set_bias_level(struct snd_soc_component *component, 547 547 enum snd_soc_bias_level level) 548 548 { 549 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 550 + 549 551 dev_dbg(component->dev, "## %s: %d -> %d\n", __func__, 550 - snd_soc_component_get_bias_level(component), level); 552 + snd_soc_dapm_get_bias_level(dapm), level); 551 553 552 554 switch (level) { 553 555 case SND_SOC_BIAS_ON: ··· 557 555 case SND_SOC_BIAS_PREPARE: 558 556 break; 559 557 case SND_SOC_BIAS_STANDBY: 560 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) 558 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) 561 559 pcm186x_power_on(component); 562 560 break; 563 561 case SND_SOC_BIAS_OFF:
+6 -3
sound/soc/codecs/pcm512x.c
··· 235 235 struct snd_ctl_elem_value *ucontrol) 236 236 { 237 237 struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 238 + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol); 238 239 struct pcm512x_priv *pcm512x = snd_soc_component_get_drvdata(component); 239 240 240 - switch (snd_soc_component_get_bias_level(component)) { 241 + switch (snd_soc_dapm_get_bias_level(dapm)) { 241 242 case SND_SOC_BIAS_OFF: 242 243 case SND_SOC_BIAS_STANDBY: 243 244 break; ··· 264 263 struct snd_ctl_elem_value *ucontrol) 265 264 { 266 265 struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 266 + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol); 267 267 struct pcm512x_priv *pcm512x = snd_soc_component_get_drvdata(component); 268 268 269 - switch (snd_soc_component_get_bias_level(component)) { 269 + switch (snd_soc_dapm_get_bias_level(dapm)) { 270 270 case SND_SOC_BIAS_OFF: 271 271 case SND_SOC_BIAS_STANDBY: 272 272 break; ··· 293 291 struct snd_ctl_elem_value *ucontrol) 294 292 { 295 293 struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 294 + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol); 296 295 struct pcm512x_priv *pcm512x = snd_soc_component_get_drvdata(component); 297 296 298 - switch (snd_soc_component_get_bias_level(component)) { 297 + switch (snd_soc_dapm_get_bias_level(dapm)) { 299 298 case SND_SOC_BIAS_OFF: 300 299 case SND_SOC_BIAS_STANDBY: 301 300 break;
+2 -1
sound/soc/codecs/rk3308_codec.c
··· 786 786 enum snd_soc_bias_level level) 787 787 { 788 788 struct rk3308_codec_priv *rk3308 = snd_soc_component_get_drvdata(component); 789 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 789 790 790 791 switch (level) { 791 792 case SND_SOC_BIAS_ON: ··· 794 793 case SND_SOC_BIAS_PREPARE: 795 794 break; 796 795 case SND_SOC_BIAS_STANDBY: 797 - if (snd_soc_component_get_bias_level(component) != SND_SOC_BIAS_OFF) 796 + if (snd_soc_dapm_get_bias_level(dapm) != SND_SOC_BIAS_OFF) 798 797 break; 799 798 800 799 /* Sequence from TRM Section 8.6.3 "Power Up" */
+9 -9
sound/soc/codecs/rt1011.c
··· 1047 1047 struct snd_ctl_elem_value *ucontrol) 1048 1048 { 1049 1049 struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 1050 + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol); 1050 1051 struct rt1011_priv *rt1011 = 1051 1052 snd_soc_component_get_drvdata(component); 1052 1053 1053 1054 if (ucontrol->value.integer.value[0] == rt1011->recv_spk_mode) 1054 1055 return 0; 1055 1056 1056 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { 1057 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) { 1057 1058 rt1011->recv_spk_mode = ucontrol->value.integer.value[0]; 1058 1059 1059 1060 if (rt1011->recv_spk_mode) { ··· 1221 1220 struct snd_ctl_elem_value *ucontrol) 1222 1221 { 1223 1222 struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 1223 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1224 1224 struct rt1011_priv *rt1011 = snd_soc_component_get_drvdata(component); 1225 1225 1226 1226 rt1011->cali_done = 0; 1227 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF && 1227 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF && 1228 1228 ucontrol->value.integer.value[0]) 1229 1229 rt1011_calibrate(rt1011, 1); 1230 1230 ··· 1262 1260 struct snd_ctl_elem_value *ucontrol) 1263 1261 { 1264 1262 struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 1263 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1265 1264 struct rt1011_priv *rt1011 = snd_soc_component_get_drvdata(component); 1266 1265 struct device *dev; 1267 1266 unsigned int r0_integer, r0_factor, format; ··· 1274 1271 return -EINVAL; 1275 1272 1276 1273 dev = regmap_get_device(rt1011->regmap); 1277 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { 1274 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) { 1278 1275 rt1011->r0_reg = ucontrol->value.integer.value[0]; 1279 1276 1280 1277 format = 2147483648U; /* 2^24 * 128 */ ··· 1661 1658 static int rt1011_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt) 1662 1659 { 1663 1660 struct snd_soc_component *component = dai->component; 1664 - struct snd_soc_dapm_context *dapm = 1665 - snd_soc_component_get_dapm(component); 1661 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1666 1662 unsigned int reg_val = 0, reg_bclk_inv = 0; 1667 1663 int ret = 0; 1668 1664 ··· 1841 1839 unsigned int tx_mask, unsigned int rx_mask, int slots, int slot_width) 1842 1840 { 1843 1841 struct snd_soc_component *component = dai->component; 1844 - struct snd_soc_dapm_context *dapm = 1845 - snd_soc_component_get_dapm(component); 1842 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1846 1843 unsigned int val = 0, tdm_en = 0, rx_slotnum, tx_slotnum; 1847 1844 int ret = 0, first_bit, last_bit; 1848 1845 ··· 2213 2212 unsigned int dc_offset; 2214 2213 unsigned int r0_integer, r0_factor, format; 2215 2214 struct device *dev = regmap_get_device(rt1011->regmap); 2216 - struct snd_soc_dapm_context *dapm = 2217 - snd_soc_component_get_dapm(rt1011->component); 2215 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(rt1011->component); 2218 2216 int ret = 0; 2219 2217 2220 2218 snd_soc_dapm_mutex_lock(dapm);
+3 -2
sound/soc/codecs/rt1015.c
··· 491 491 static void rt1015_calibrate(struct rt1015_priv *rt1015) 492 492 { 493 493 struct snd_soc_component *component = rt1015->component; 494 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 494 495 struct regmap *regmap = rt1015->regmap; 495 496 496 - snd_soc_dapm_mutex_lock(&component->dapm); 497 + snd_soc_dapm_mutex_lock(dapm); 497 498 regcache_cache_bypass(regmap, true); 498 499 499 500 regmap_write(regmap, RT1015_CLK_DET, 0x0000); ··· 516 515 regcache_cache_bypass(regmap, false); 517 516 regcache_mark_dirty(regmap); 518 517 regcache_sync(regmap); 519 - snd_soc_dapm_mutex_unlock(&component->dapm); 518 + snd_soc_dapm_mutex_unlock(dapm); 520 519 } 521 520 522 521 static int rt1015_bypass_boost_put(struct snd_kcontrol *kcontrol,
+3 -2
sound/soc/codecs/rt274.c
··· 925 925 static int rt274_set_bias_level(struct snd_soc_component *component, 926 926 enum snd_soc_bias_level level) 927 927 { 928 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 929 + 928 930 switch (level) { 929 931 case SND_SOC_BIAS_PREPARE: 930 - if (SND_SOC_BIAS_STANDBY == 931 - snd_soc_component_get_bias_level(component)) { 932 + if (SND_SOC_BIAS_STANDBY == snd_soc_dapm_get_bias_level(dapm)) { 932 933 snd_soc_component_write(component, 933 934 RT274_SET_AUDIO_POWER, AC_PWRST_D0); 934 935 }
+5 -3
sound/soc/codecs/rt286.c
··· 223 223 if (!rt286->component) 224 224 return -EINVAL; 225 225 226 - dapm = snd_soc_component_get_dapm(rt286->component); 226 + dapm = snd_soc_component_to_dapm(rt286->component); 227 227 228 228 if (rt286->pdata.cbj_en) { 229 229 regmap_read(rt286->regmap, RT286_GET_HP_SENSE, &buf); ··· 314 314 static int rt286_mic_detect(struct snd_soc_component *component, 315 315 struct snd_soc_jack *jack, void *data) 316 316 { 317 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 317 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 318 318 struct rt286_priv *rt286 = snd_soc_component_get_drvdata(component); 319 319 320 320 rt286->jack = jack; ··· 887 887 static int rt286_set_bias_level(struct snd_soc_component *component, 888 888 enum snd_soc_bias_level level) 889 889 { 890 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 891 + 890 892 switch (level) { 891 893 case SND_SOC_BIAS_PREPARE: 892 - if (SND_SOC_BIAS_STANDBY == snd_soc_component_get_bias_level(component)) { 894 + if (SND_SOC_BIAS_STANDBY == snd_soc_dapm_get_bias_level(dapm)) { 893 895 snd_soc_component_write(component, 894 896 RT286_SET_AUDIO_POWER, AC_PWRST_D0); 895 897 snd_soc_component_update_bits(component,
+5 -4
sound/soc/codecs/rt298.c
··· 227 227 if (!rt298->component) 228 228 return -EINVAL; 229 229 230 - dapm = snd_soc_component_get_dapm(rt298->component); 230 + dapm = snd_soc_component_to_dapm(rt298->component); 231 231 232 232 if (rt298->pdata.cbj_en) { 233 233 regmap_read(rt298->regmap, RT298_GET_HP_SENSE, &buf); ··· 329 329 static int rt298_mic_detect(struct snd_soc_component *component, 330 330 struct snd_soc_jack *jack, void *data) 331 331 { 332 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 332 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 333 333 struct rt298_priv *rt298 = snd_soc_component_get_drvdata(component); 334 334 335 335 rt298->jack = jack; ··· 949 949 static int rt298_set_bias_level(struct snd_soc_component *component, 950 950 enum snd_soc_bias_level level) 951 951 { 952 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 953 + 952 954 switch (level) { 953 955 case SND_SOC_BIAS_PREPARE: 954 - if (SND_SOC_BIAS_STANDBY == 955 - snd_soc_component_get_bias_level(component)) { 956 + if (SND_SOC_BIAS_STANDBY == snd_soc_dapm_get_bias_level(dapm)) { 956 957 snd_soc_component_write(component, 957 958 RT298_SET_AUDIO_POWER, AC_PWRST_D0); 958 959 snd_soc_component_update_bits(component, 0x0d, 0x200, 0x200);
+5 -3
sound/soc/codecs/rt5514.c
··· 325 325 struct snd_ctl_elem_value *ucontrol) 326 326 { 327 327 struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 328 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 328 329 struct rt5514_priv *rt5514 = snd_soc_component_get_drvdata(component); 329 330 const struct firmware *fw = NULL; 330 331 u8 buf[8]; ··· 333 332 if (ucontrol->value.integer.value[0] == rt5514->dsp_enabled) 334 333 return 0; 335 334 336 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { 335 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) { 337 336 rt5514->dsp_enabled = ucontrol->value.integer.value[0]; 338 337 339 338 if (rt5514->dsp_enabled) { ··· 1051 1050 enum snd_soc_bias_level level) 1052 1051 { 1053 1052 struct rt5514_priv *rt5514 = snd_soc_component_get_drvdata(component); 1053 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1054 1054 int ret; 1055 1055 1056 1056 switch (level) { 1057 1057 case SND_SOC_BIAS_PREPARE: 1058 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_ON) { 1058 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_ON) { 1059 1059 clk_disable_unprepare(rt5514->mclk); 1060 1060 } else { 1061 1061 ret = clk_prepare_enable(rt5514->mclk); ··· 1066 1064 break; 1067 1065 1068 1066 case SND_SOC_BIAS_STANDBY: 1069 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { 1067 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) { 1070 1068 /* 1071 1069 * If the DSP is enabled in start of recording, the DSP 1072 1070 * should be disabled, and sync back to normal recording
+3 -2
sound/soc/codecs/rt5616.c
··· 1159 1159 enum snd_soc_bias_level level) 1160 1160 { 1161 1161 struct rt5616_priv *rt5616 = snd_soc_component_get_drvdata(component); 1162 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1162 1163 int ret; 1163 1164 1164 1165 switch (level) { ··· 1175 1174 * away from ON. Disable the clock in that case, otherwise 1176 1175 * enable it. 1177 1176 */ 1178 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_ON) { 1177 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_ON) { 1179 1178 clk_disable_unprepare(rt5616->mclk); 1180 1179 } else { 1181 1180 ret = clk_prepare_enable(rt5616->mclk); ··· 1185 1184 break; 1186 1185 1187 1186 case SND_SOC_BIAS_STANDBY: 1188 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { 1187 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) { 1189 1188 snd_soc_component_update_bits(component, RT5616_PWR_ANLG1, 1190 1189 RT5616_PWR_VREF1 | RT5616_PWR_MB | 1191 1190 RT5616_PWR_BG | RT5616_PWR_VREF2,
+4 -2
sound/soc/codecs/rt5631.c
··· 1535 1535 enum snd_soc_bias_level level) 1536 1536 { 1537 1537 struct rt5631_priv *rt5631 = snd_soc_component_get_drvdata(component); 1538 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1538 1539 1539 1540 switch (level) { 1540 1541 case SND_SOC_BIAS_ON: ··· 1546 1545 break; 1547 1546 1548 1547 case SND_SOC_BIAS_STANDBY: 1549 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { 1548 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) { 1550 1549 snd_soc_component_update_bits(component, RT5631_PWR_MANAG_ADD3, 1551 1550 RT5631_PWR_VREF | RT5631_PWR_MAIN_BIAS, 1552 1551 RT5631_PWR_VREF | RT5631_PWR_MAIN_BIAS); ··· 1576 1575 static int rt5631_probe(struct snd_soc_component *component) 1577 1576 { 1578 1577 struct rt5631_priv *rt5631 = snd_soc_component_get_drvdata(component); 1578 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1579 1579 unsigned int val; 1580 1580 1581 1581 val = rt5631_read_index(component, RT5631_ADDA_MIXER_INTL_REG3); ··· 1615 1613 RT5631_DMIC_R_CH_LATCH_RISING); 1616 1614 } 1617 1615 1618 - snd_soc_component_init_bias_level(component, SND_SOC_BIAS_STANDBY); 1616 + snd_soc_dapm_init_bias_level(dapm, SND_SOC_BIAS_STANDBY); 1619 1617 1620 1618 return 0; 1621 1619 }
+10 -9
sound/soc/codecs/rt5640.c
··· 1935 1935 enum snd_soc_bias_level level) 1936 1936 { 1937 1937 struct rt5640_priv *rt5640 = snd_soc_component_get_drvdata(component); 1938 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1938 1939 int ret; 1939 1940 1940 1941 switch (level) { ··· 1950 1949 * away from ON. Disable the clock in that case, otherwise 1951 1950 * enable it. 1952 1951 */ 1953 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_ON) { 1952 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_ON) { 1954 1953 clk_disable_unprepare(rt5640->mclk); 1955 1954 } else { 1956 1955 ret = clk_prepare_enable(rt5640->mclk); ··· 1960 1959 break; 1961 1960 1962 1961 case SND_SOC_BIAS_STANDBY: 1963 - if (SND_SOC_BIAS_OFF == snd_soc_component_get_bias_level(component)) { 1962 + if (SND_SOC_BIAS_OFF == snd_soc_dapm_get_bias_level(dapm)) { 1964 1963 snd_soc_component_update_bits(component, RT5640_PWR_ANLG1, 1965 1964 RT5640_PWR_VREF1 | RT5640_PWR_MB | 1966 1965 RT5640_PWR_BG | RT5640_PWR_VREF2, ··· 2099 2098 2100 2099 void rt5640_enable_micbias1_for_ovcd(struct snd_soc_component *component) 2101 2100 { 2102 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 2101 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 2103 2102 struct rt5640_priv *rt5640 = snd_soc_component_get_drvdata(component); 2104 2103 2105 2104 snd_soc_dapm_mutex_lock(dapm); ··· 2115 2114 2116 2115 void rt5640_disable_micbias1_for_ovcd(struct snd_soc_component *component) 2117 2116 { 2118 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 2117 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 2119 2118 struct rt5640_priv *rt5640 = snd_soc_component_get_drvdata(component); 2120 2119 2121 2120 snd_soc_dapm_mutex_lock(dapm); ··· 2587 2586 struct snd_soc_component *component, struct snd_soc_jack *jack) 2588 2587 { 2589 2588 struct rt5640_priv *rt5640 = snd_soc_component_get_drvdata(component); 2590 - struct snd_soc_dapm_context *dapm = 2591 - snd_soc_component_get_dapm(component); 2589 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 2592 2590 int ret; 2593 2591 2594 2592 /* Select JD1 for Mic */ ··· 2652 2652 2653 2653 static int rt5640_probe(struct snd_soc_component *component) 2654 2654 { 2655 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 2655 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 2656 2656 struct rt5640_priv *rt5640 = snd_soc_component_get_drvdata(component); 2657 2657 u32 dmic1_data_pin = 0; 2658 2658 u32 dmic2_data_pin = 0; ··· 2666 2666 2667 2667 rt5640->component = component; 2668 2668 2669 - snd_soc_component_force_bias_level(component, SND_SOC_BIAS_OFF); 2669 + snd_soc_dapm_force_bias_level(dapm, SND_SOC_BIAS_OFF); 2670 2670 2671 2671 snd_soc_component_update_bits(component, RT5640_GCTL1, 0x0301, 0x0301); 2672 2672 snd_soc_component_update_bits(component, RT5640_MICBIAS, 0x0030, 0x0030); ··· 2796 2796 static int rt5640_suspend(struct snd_soc_component *component) 2797 2797 { 2798 2798 struct rt5640_priv *rt5640 = snd_soc_component_get_drvdata(component); 2799 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 2799 2800 2800 2801 if (rt5640->jack) { 2801 2802 /* disable jack interrupts during system suspend */ ··· 2805 2804 cancel_delayed_work_sync(&rt5640->bp_work); 2806 2805 } 2807 2806 2808 - snd_soc_component_force_bias_level(component, SND_SOC_BIAS_OFF); 2807 + snd_soc_dapm_force_bias_level(dapm, SND_SOC_BIAS_OFF); 2809 2808 rt5640_reset(component); 2810 2809 regcache_cache_only(rt5640->regmap, true); 2811 2810 regcache_mark_dirty(rt5640->regmap);
+8 -7
sound/soc/codecs/rt5645.c
··· 3071 3071 enum snd_soc_bias_level level) 3072 3072 { 3073 3073 struct rt5645_priv *rt5645 = snd_soc_component_get_drvdata(component); 3074 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 3074 3075 3075 3076 switch (level) { 3076 3077 case SND_SOC_BIAS_PREPARE: 3077 - if (SND_SOC_BIAS_STANDBY == snd_soc_component_get_bias_level(component)) { 3078 + if (SND_SOC_BIAS_STANDBY == snd_soc_dapm_get_bias_level(dapm)) { 3078 3079 snd_soc_component_update_bits(component, RT5645_PWR_ANLG1, 3079 3080 RT5645_PWR_VREF1 | RT5645_PWR_MB | 3080 3081 RT5645_PWR_BG | RT5645_PWR_VREF2, ··· 3100 3099 snd_soc_component_update_bits(component, RT5645_PWR_ANLG1, 3101 3100 RT5645_PWR_FV1 | RT5645_PWR_FV2, 3102 3101 RT5645_PWR_FV1 | RT5645_PWR_FV2); 3103 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { 3102 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) { 3104 3103 snd_soc_component_write(component, RT5645_DEPOP_M2, 0x1140); 3105 3104 msleep(40); 3106 3105 if (rt5645->en_button_func) ··· 3131 3130 static void rt5645_enable_push_button_irq(struct snd_soc_component *component, 3132 3131 bool enable) 3133 3132 { 3134 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 3133 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 3135 3134 int ret; 3136 3135 3137 3136 if (enable) { ··· 3170 3169 3171 3170 static int rt5645_jack_detect(struct snd_soc_component *component, int jack_insert) 3172 3171 { 3173 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 3172 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 3174 3173 struct rt5645_priv *rt5645 = snd_soc_component_get_drvdata(component); 3175 3174 unsigned int val; 3176 3175 ··· 3181 3180 snd_soc_dapm_force_enable_pin(dapm, "LDO2"); 3182 3181 snd_soc_dapm_force_enable_pin(dapm, "Mic Det Power"); 3183 3182 snd_soc_dapm_sync(dapm); 3184 - if (!snd_soc_card_is_instantiated(dapm->card)) { 3183 + if (!snd_soc_card_is_instantiated(component->card)) { 3185 3184 /* Power up necessary bits for JD if dapm is 3186 3185 not ready yet */ 3187 3186 regmap_update_bits(rt5645->regmap, RT5645_PWR_ANLG1, ··· 3450 3449 3451 3450 static int rt5645_probe(struct snd_soc_component *component) 3452 3451 { 3453 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 3452 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 3454 3453 struct rt5645_priv *rt5645 = snd_soc_component_get_drvdata(component); 3455 3454 3456 3455 rt5645->component = component; ··· 3479 3478 break; 3480 3479 } 3481 3480 3482 - snd_soc_component_force_bias_level(component, SND_SOC_BIAS_OFF); 3481 + snd_soc_dapm_force_bias_level(dapm, SND_SOC_BIAS_OFF); 3483 3482 3484 3483 /* for JD function */ 3485 3484 if (rt5645->pdata.jd_mode) {
+8 -5
sound/soc/codecs/rt5651.c
··· 1511 1511 static int rt5651_set_bias_level(struct snd_soc_component *component, 1512 1512 enum snd_soc_bias_level level) 1513 1513 { 1514 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1515 + 1514 1516 switch (level) { 1515 1517 case SND_SOC_BIAS_PREPARE: 1516 - if (SND_SOC_BIAS_STANDBY == snd_soc_component_get_bias_level(component)) { 1518 + if (SND_SOC_BIAS_STANDBY == snd_soc_dapm_get_bias_level(dapm)) { 1517 1519 if (snd_soc_component_read(component, RT5651_PLL_MODE_1) & 0x9200) 1518 1520 snd_soc_component_update_bits(component, RT5651_D_MISC, 1519 1521 0xc00, 0xc00); 1520 1522 } 1521 1523 break; 1522 1524 case SND_SOC_BIAS_STANDBY: 1523 - if (SND_SOC_BIAS_OFF == snd_soc_component_get_bias_level(component)) { 1525 + if (SND_SOC_BIAS_OFF == snd_soc_dapm_get_bias_level(dapm)) { 1524 1526 snd_soc_component_update_bits(component, RT5651_PWR_ANLG1, 1525 1527 RT5651_PWR_VREF1 | RT5651_PWR_MB | 1526 1528 RT5651_PWR_BG | RT5651_PWR_VREF2, ··· 1559 1557 1560 1558 static void rt5651_enable_micbias1_for_ovcd(struct snd_soc_component *component) 1561 1559 { 1562 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 1560 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1563 1561 1564 1562 snd_soc_dapm_mutex_lock(dapm); 1565 1563 snd_soc_dapm_force_enable_pin_unlocked(dapm, "LDO"); ··· 1572 1570 1573 1571 static void rt5651_disable_micbias1_for_ovcd(struct snd_soc_component *component) 1574 1572 { 1575 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 1573 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1576 1574 1577 1575 snd_soc_dapm_mutex_lock(dapm); 1578 1576 snd_soc_dapm_disable_pin_unlocked(dapm, "Platform Clock"); ··· 2060 2058 static int rt5651_probe(struct snd_soc_component *component) 2061 2059 { 2062 2060 struct rt5651_priv *rt5651 = snd_soc_component_get_drvdata(component); 2061 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 2063 2062 2064 2063 rt5651->component = component; 2065 2064 2066 2065 snd_soc_component_update_bits(component, RT5651_PWR_ANLG1, 2067 2066 RT5651_PWR_LDO_DVO_MASK, RT5651_PWR_LDO_DVO_1_2V); 2068 2067 2069 - snd_soc_component_force_bias_level(component, SND_SOC_BIAS_OFF); 2068 + snd_soc_dapm_force_bias_level(dapm, SND_SOC_BIAS_OFF); 2070 2069 2071 2070 rt5651_apply_properties(component); 2072 2071
+5 -6
sound/soc/codecs/rt5659.c
··· 1213 1213 static void rt5659_enable_push_button_irq(struct snd_soc_component *component, 1214 1214 bool enable) 1215 1215 { 1216 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 1216 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1217 1217 1218 1218 if (enable) { 1219 1219 snd_soc_component_write(component, RT5659_4BTN_IL_CMD_1, 0x000b); ··· 1257 1257 1258 1258 static int rt5659_headset_detect(struct snd_soc_component *component, int jack_insert) 1259 1259 { 1260 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 1260 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1261 1261 int val, i = 0, sleep_time[5] = {300, 150, 100, 50, 30}; 1262 1262 int reg_63; 1263 1263 ··· 3611 3611 static int rt5659_set_bias_level(struct snd_soc_component *component, 3612 3612 enum snd_soc_bias_level level) 3613 3613 { 3614 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 3614 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 3615 3615 struct rt5659_priv *rt5659 = snd_soc_component_get_drvdata(component); 3616 3616 int ret; 3617 3617 ··· 3631 3631 break; 3632 3632 3633 3633 case SND_SOC_BIAS_STANDBY: 3634 - if (dapm->bias_level == SND_SOC_BIAS_OFF) { 3634 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) { 3635 3635 ret = clk_prepare_enable(rt5659->mclk); 3636 3636 if (ret) { 3637 3637 dev_err(component->dev, ··· 3662 3662 3663 3663 static int rt5659_probe(struct snd_soc_component *component) 3664 3664 { 3665 - struct snd_soc_dapm_context *dapm = 3666 - snd_soc_component_get_dapm(component); 3665 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 3667 3666 struct rt5659_priv *rt5659 = snd_soc_component_get_drvdata(component); 3668 3667 3669 3668 rt5659->component = component;
+3 -2
sound/soc/codecs/rt5660.c
··· 1069 1069 enum snd_soc_bias_level level) 1070 1070 { 1071 1071 struct rt5660_priv *rt5660 = snd_soc_component_get_drvdata(component); 1072 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1072 1073 int ret; 1073 1074 1074 1075 switch (level) { ··· 1080 1079 snd_soc_component_update_bits(component, RT5660_GEN_CTRL1, 1081 1080 RT5660_DIG_GATE_CTRL, RT5660_DIG_GATE_CTRL); 1082 1081 1083 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_ON) { 1082 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_ON) { 1084 1083 clk_disable_unprepare(rt5660->mclk); 1085 1084 } else { 1086 1085 ret = clk_prepare_enable(rt5660->mclk); ··· 1090 1089 break; 1091 1090 1092 1091 case SND_SOC_BIAS_STANDBY: 1093 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { 1092 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) { 1094 1093 snd_soc_component_update_bits(component, RT5660_PWR_ANLG1, 1095 1094 RT5660_PWR_VREF1 | RT5660_PWR_MB | 1096 1095 RT5660_PWR_BG | RT5660_PWR_VREF2,
+2 -2
sound/soc/codecs/rt5663.c
··· 1463 1463 1464 1464 static int rt5663_v2_jack_detect(struct snd_soc_component *component, int jack_insert) 1465 1465 { 1466 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 1466 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1467 1467 struct rt5663_priv *rt5663 = snd_soc_component_get_drvdata(component); 1468 1468 int val, i = 0, sleep_time[5] = {300, 150, 100, 50, 30}; 1469 1469 ··· 3140 3140 3141 3141 static int rt5663_probe(struct snd_soc_component *component) 3142 3142 { 3143 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 3143 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 3144 3144 struct rt5663_priv *rt5663 = snd_soc_component_get_drvdata(component); 3145 3145 3146 3146 rt5663->component = component;
+1 -1
sound/soc/codecs/rt5665.c
··· 1067 1067 static int rt5665_headset_detect(struct snd_soc_component *component, int jack_insert) 1068 1068 { 1069 1069 struct rt5665_priv *rt5665 = snd_soc_component_get_drvdata(component); 1070 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 1070 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1071 1071 unsigned int sar_hs_type, val; 1072 1072 1073 1073 if (jack_insert) {
+1 -2
sound/soc/codecs/rt5668.c
··· 853 853 int jack_insert) 854 854 { 855 855 struct rt5668_priv *rt5668 = snd_soc_component_get_drvdata(component); 856 - struct snd_soc_dapm_context *dapm = 857 - snd_soc_component_get_dapm(component); 856 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 858 857 unsigned int val, count; 859 858 860 859 if (jack_insert) {
+5 -4
sound/soc/codecs/rt5670.c
··· 431 431 static int rt5670_headset_detect(struct snd_soc_component *component, int jack_insert) 432 432 { 433 433 int val; 434 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 434 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 435 435 struct rt5670_priv *rt5670 = snd_soc_component_get_drvdata(component); 436 436 437 437 if (jack_insert) { ··· 966 966 struct snd_ctl_elem_value *ucontrol) 967 967 { 968 968 struct soc_mixer_control *mc = (struct soc_mixer_control *)kcontrol->private_value; 969 - struct snd_soc_component *component = snd_soc_dapm_kcontrol_component(kcontrol); 969 + struct snd_soc_component *component = snd_soc_dapm_kcontrol_to_component(kcontrol); 970 970 struct rt5670_priv *rt5670 = snd_soc_component_get_drvdata(component); 971 971 int ret; 972 972 ··· 2670 2670 enum snd_soc_bias_level level) 2671 2671 { 2672 2672 struct rt5670_priv *rt5670 = snd_soc_component_get_drvdata(component); 2673 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 2673 2674 2674 2675 switch (level) { 2675 2676 case SND_SOC_BIAS_PREPARE: 2676 - if (SND_SOC_BIAS_STANDBY == snd_soc_component_get_bias_level(component)) { 2677 + if (SND_SOC_BIAS_STANDBY == snd_soc_dapm_get_bias_level(dapm)) { 2677 2678 snd_soc_component_update_bits(component, RT5670_PWR_ANLG1, 2678 2679 RT5670_PWR_VREF1 | RT5670_PWR_MB | 2679 2680 RT5670_PWR_BG | RT5670_PWR_VREF2, ··· 2724 2723 2725 2724 static int rt5670_probe(struct snd_soc_component *component) 2726 2725 { 2727 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 2726 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 2728 2727 struct rt5670_priv *rt5670 = snd_soc_component_get_drvdata(component); 2729 2728 2730 2729 switch (snd_soc_component_read(component, RT5670_RESET) & RT5670_ID_MASK) {
+7 -7
sound/soc/codecs/rt5677.c
··· 706 706 707 707 static unsigned int rt5677_set_vad_source(struct rt5677_priv *rt5677) 708 708 { 709 - struct snd_soc_dapm_context *dapm = 710 - snd_soc_component_get_dapm(rt5677->component); 709 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(rt5677->component); 711 710 /* Force dapm to sync before we enable the 712 711 * DSP to prevent write corruption 713 712 */ ··· 2732 2733 struct snd_kcontrol *kcontrol, int event) 2733 2734 { 2734 2735 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); 2736 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 2735 2737 struct rt5677_priv *rt5677 = snd_soc_component_get_drvdata(component); 2736 2738 2737 2739 switch (event) { 2738 2740 case SND_SOC_DAPM_POST_PMU: 2739 - if (snd_soc_component_get_bias_level(component) != SND_SOC_BIAS_ON && 2741 + if (snd_soc_dapm_get_bias_level(dapm) != SND_SOC_BIAS_ON && 2740 2742 !rt5677->is_vref_slow) { 2741 2743 mdelay(20); 2742 2744 regmap_update_bits(rt5677->regmap, RT5677_PWR_ANLG1, ··· 4643 4643 enum snd_soc_bias_level level) 4644 4644 { 4645 4645 struct rt5677_priv *rt5677 = snd_soc_component_get_drvdata(component); 4646 - enum snd_soc_bias_level prev_bias = 4647 - snd_soc_component_get_bias_level(component); 4646 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 4647 + enum snd_soc_bias_level prev_bias = snd_soc_dapm_get_bias_level(dapm); 4648 4648 4649 4649 switch (level) { 4650 4650 case SND_SOC_BIAS_ON: ··· 4880 4880 4881 4881 static int rt5677_probe(struct snd_soc_component *component) 4882 4882 { 4883 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 4883 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 4884 4884 struct rt5677_priv *rt5677 = snd_soc_component_get_drvdata(component); 4885 4885 int i; 4886 4886 ··· 4896 4896 ARRAY_SIZE(rt5677_dmic2_clk_1)); 4897 4897 } 4898 4898 4899 - snd_soc_component_force_bias_level(component, SND_SOC_BIAS_OFF); 4899 + snd_soc_dapm_force_bias_level(dapm, SND_SOC_BIAS_OFF); 4900 4900 4901 4901 regmap_update_bits(rt5677->regmap, RT5677_DIG_MISC, 4902 4902 ~RT5677_IRQ_DEBOUNCE_SEL_MASK, 0x0020);
+5 -5
sound/soc/codecs/rt5682.c
··· 928 928 static int rt5682_headset_detect(struct snd_soc_component *component, int jack_insert) 929 929 { 930 930 struct rt5682_priv *rt5682 = snd_soc_component_get_drvdata(component); 931 - struct snd_soc_dapm_context *dapm = &component->dapm; 931 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 932 932 unsigned int val, count; 933 933 934 934 if (jack_insert) { ··· 1115 1115 } 1116 1116 } 1117 1117 1118 - dapm = snd_soc_component_get_dapm(rt5682->component); 1118 + dapm = snd_soc_component_to_dapm(rt5682->component); 1119 1119 1120 1120 snd_soc_dapm_mutex_lock(dapm); 1121 1121 mutex_lock(&rt5682->calibrate_mutex); ··· 2595 2595 return -EINVAL; 2596 2596 2597 2597 component = rt5682->component; 2598 - dapm = snd_soc_component_get_dapm(component); 2598 + dapm = snd_soc_component_to_dapm(component); 2599 2599 2600 2600 snd_soc_dapm_mutex_lock(dapm); 2601 2601 ··· 2633 2633 return; 2634 2634 2635 2635 component = rt5682->component; 2636 - dapm = snd_soc_component_get_dapm(component); 2636 + dapm = snd_soc_component_to_dapm(component); 2637 2637 2638 2638 snd_soc_dapm_mutex_lock(dapm); 2639 2639 ··· 2928 2928 static int rt5682_probe(struct snd_soc_component *component) 2929 2929 { 2930 2930 struct rt5682_priv *rt5682 = snd_soc_component_get_drvdata(component); 2931 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 2931 2932 struct sdw_slave *slave; 2932 2933 unsigned long time; 2933 - struct snd_soc_dapm_context *dapm = &component->dapm; 2934 2934 2935 2935 rt5682->component = component; 2936 2936
+3 -2
sound/soc/codecs/rt5682s.c
··· 841 841 return; 842 842 } 843 843 844 - dapm = snd_soc_component_get_dapm(rt5682s->component); 844 + dapm = snd_soc_component_to_dapm(rt5682s->component); 845 845 846 846 snd_soc_dapm_mutex_lock(dapm); 847 847 mutex_lock(&rt5682s->calibrate_mutex); ··· 2485 2485 enum snd_soc_bias_level level) 2486 2486 { 2487 2487 struct rt5682s_priv *rt5682s = snd_soc_component_get_drvdata(component); 2488 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 2488 2489 2489 2490 switch (level) { 2490 2491 case SND_SOC_BIAS_PREPARE: ··· 2493 2492 RT5682S_PWR_LDO, RT5682S_PWR_LDO); 2494 2493 break; 2495 2494 case SND_SOC_BIAS_STANDBY: 2496 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) 2495 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) 2497 2496 regmap_update_bits(rt5682s->regmap, RT5682S_PWR_DIG_1, 2498 2497 RT5682S_DIG_GATE_CTRL, RT5682S_DIG_GATE_CTRL); 2499 2498 break;
+11 -17
sound/soc/codecs/rt700.c
··· 272 272 273 273 static void rt700_jack_init(struct rt700_priv *rt700) 274 274 { 275 - struct snd_soc_dapm_context *dapm = 276 - snd_soc_component_get_dapm(rt700->component); 275 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(rt700->component); 277 276 278 277 /* power on */ 279 - if (dapm->bias_level <= SND_SOC_BIAS_STANDBY) 278 + if (snd_soc_dapm_get_bias_level(dapm) <= SND_SOC_BIAS_STANDBY) 280 279 regmap_write(rt700->regmap, 281 280 RT700_SET_AUDIO_POWER_STATE, AC_PWRST_D0); 282 281 ··· 306 307 } 307 308 308 309 /* power off */ 309 - if (dapm->bias_level <= SND_SOC_BIAS_STANDBY) 310 + if (snd_soc_dapm_get_bias_level(dapm) <= SND_SOC_BIAS_STANDBY) 310 311 regmap_write(rt700->regmap, 311 312 RT700_SET_AUDIO_POWER_STATE, AC_PWRST_D3); 312 313 } ··· 361 362 struct snd_ctl_elem_value *ucontrol) 362 363 { 363 364 struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 364 - struct snd_soc_dapm_context *dapm = 365 - snd_soc_component_get_dapm(component); 365 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 366 366 struct soc_mixer_control *mc = 367 367 (struct soc_mixer_control *)kcontrol->private_value; 368 368 struct rt700_priv *rt700 = snd_soc_component_get_drvdata(component); ··· 396 398 val_ll |= read_ll; 397 399 } 398 400 399 - if (dapm->bias_level <= SND_SOC_BIAS_STANDBY) 401 + if (snd_soc_dapm_get_bias_level(dapm) <= SND_SOC_BIAS_STANDBY) 400 402 regmap_write(rt700->regmap, 401 403 RT700_SET_AUDIO_POWER_STATE, AC_PWRST_D0); 402 404 ··· 448 450 break; 449 451 } 450 452 451 - if (dapm->bias_level <= SND_SOC_BIAS_STANDBY) 453 + if (snd_soc_dapm_get_bias_level(dapm) <= SND_SOC_BIAS_STANDBY) 452 454 regmap_write(rt700->regmap, 453 455 RT700_SET_AUDIO_POWER_STATE, AC_PWRST_D3); 454 456 return 0; ··· 522 524 static int rt700_mux_get(struct snd_kcontrol *kcontrol, 523 525 struct snd_ctl_elem_value *ucontrol) 524 526 { 525 - struct snd_soc_component *component = 526 - snd_soc_dapm_kcontrol_component(kcontrol); 527 + struct snd_soc_component *component = snd_soc_dapm_kcontrol_to_component(kcontrol); 527 528 struct rt700_priv *rt700 = snd_soc_component_get_drvdata(component); 528 529 unsigned int reg, val = 0, nid; 529 530 int ret; ··· 550 553 static int rt700_mux_put(struct snd_kcontrol *kcontrol, 551 554 struct snd_ctl_elem_value *ucontrol) 552 555 { 553 - struct snd_soc_component *component = 554 - snd_soc_dapm_kcontrol_component(kcontrol); 555 - struct snd_soc_dapm_context *dapm = 556 - snd_soc_dapm_kcontrol_dapm(kcontrol); 556 + struct snd_soc_component *component = snd_soc_dapm_kcontrol_to_component(kcontrol); 557 + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol); 557 558 struct rt700_priv *rt700 = snd_soc_component_get_drvdata(component); 558 559 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; 559 560 unsigned int *item = ucontrol->value.enumerated.item; ··· 834 839 static int rt700_set_bias_level(struct snd_soc_component *component, 835 840 enum snd_soc_bias_level level) 836 841 { 837 - struct snd_soc_dapm_context *dapm = 838 - snd_soc_component_get_dapm(component); 842 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 839 843 struct rt700_priv *rt700 = snd_soc_component_get_drvdata(component); 840 844 841 845 switch (level) { 842 846 case SND_SOC_BIAS_PREPARE: 843 - if (dapm->bias_level == SND_SOC_BIAS_STANDBY) { 847 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_STANDBY) { 844 848 regmap_write(rt700->regmap, 845 849 RT700_SET_AUDIO_POWER_STATE, 846 850 AC_PWRST_D0);
+3 -6
sound/soc/codecs/rt711-sdca.c
··· 900 900 static int rt711_sdca_mux_get(struct snd_kcontrol *kcontrol, 901 901 struct snd_ctl_elem_value *ucontrol) 902 902 { 903 - struct snd_soc_component *component = 904 - snd_soc_dapm_kcontrol_component(kcontrol); 903 + struct snd_soc_component *component = snd_soc_dapm_kcontrol_to_component(kcontrol); 905 904 struct rt711_sdca_priv *rt711 = snd_soc_component_get_drvdata(component); 906 905 unsigned int val = 0, mask_sft; 907 906 ··· 922 923 static int rt711_sdca_mux_put(struct snd_kcontrol *kcontrol, 923 924 struct snd_ctl_elem_value *ucontrol) 924 925 { 925 - struct snd_soc_component *component = 926 - snd_soc_dapm_kcontrol_component(kcontrol); 927 - struct snd_soc_dapm_context *dapm = 928 - snd_soc_dapm_kcontrol_dapm(kcontrol); 926 + struct snd_soc_component *component = snd_soc_dapm_kcontrol_to_component(kcontrol); 927 + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol); 929 928 struct rt711_sdca_priv *rt711 = snd_soc_component_get_drvdata(component); 930 929 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; 931 930 unsigned int *item = ucontrol->value.enumerated.item;
+11 -17
sound/soc/codecs/rt711.c
··· 360 360 361 361 static void rt711_jack_init(struct rt711_priv *rt711) 362 362 { 363 - struct snd_soc_dapm_context *dapm = 364 - snd_soc_component_get_dapm(rt711->component); 363 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(rt711->component); 365 364 366 365 mutex_lock(&rt711->calibrate_mutex); 367 366 /* power on */ 368 - if (dapm->bias_level <= SND_SOC_BIAS_STANDBY) 367 + if (snd_soc_dapm_get_bias_level(dapm) <= SND_SOC_BIAS_STANDBY) 369 368 regmap_write(rt711->regmap, 370 369 RT711_SET_AUDIO_POWER_STATE, AC_PWRST_D0); 371 370 ··· 447 448 } 448 449 449 450 /* power off */ 450 - if (dapm->bias_level <= SND_SOC_BIAS_STANDBY) 451 + if (snd_soc_dapm_get_bias_level(dapm) <= SND_SOC_BIAS_STANDBY) 451 452 regmap_write(rt711->regmap, 452 453 RT711_SET_AUDIO_POWER_STATE, AC_PWRST_D3); 453 454 mutex_unlock(&rt711->calibrate_mutex); ··· 503 504 struct snd_ctl_elem_value *ucontrol) 504 505 { 505 506 struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 506 - struct snd_soc_dapm_context *dapm = 507 - snd_soc_component_get_dapm(component); 507 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 508 508 struct soc_mixer_control *mc = 509 509 (struct soc_mixer_control *)kcontrol->private_value; 510 510 struct rt711_priv *rt711 = snd_soc_component_get_drvdata(component); ··· 541 543 val_ll |= read_ll; 542 544 } 543 545 544 - if (dapm->bias_level <= SND_SOC_BIAS_STANDBY) 546 + if (snd_soc_dapm_get_bias_level(dapm) <= SND_SOC_BIAS_STANDBY) 545 547 regmap_write(rt711->regmap, 546 548 RT711_SET_AUDIO_POWER_STATE, AC_PWRST_D0); 547 549 ··· 595 597 break; 596 598 } 597 599 598 - if (dapm->bias_level <= SND_SOC_BIAS_STANDBY) 600 + if (snd_soc_dapm_get_bias_level(dapm) <= SND_SOC_BIAS_STANDBY) 599 601 regmap_write(rt711->regmap, 600 602 RT711_SET_AUDIO_POWER_STATE, AC_PWRST_D3); 601 603 ··· 680 682 static int rt711_mux_get(struct snd_kcontrol *kcontrol, 681 683 struct snd_ctl_elem_value *ucontrol) 682 684 { 683 - struct snd_soc_component *component = 684 - snd_soc_dapm_kcontrol_component(kcontrol); 685 + struct snd_soc_component *component = snd_soc_dapm_kcontrol_to_component(kcontrol); 685 686 struct rt711_priv *rt711 = snd_soc_component_get_drvdata(component); 686 687 unsigned int reg, val = 0, nid; 687 688 int ret; ··· 709 712 static int rt711_mux_put(struct snd_kcontrol *kcontrol, 710 713 struct snd_ctl_elem_value *ucontrol) 711 714 { 712 - struct snd_soc_component *component = 713 - snd_soc_dapm_kcontrol_component(kcontrol); 714 - struct snd_soc_dapm_context *dapm = 715 - snd_soc_dapm_kcontrol_dapm(kcontrol); 715 + struct snd_soc_component *component = snd_soc_dapm_kcontrol_to_component(kcontrol); 716 + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol); 716 717 struct rt711_priv *rt711 = snd_soc_component_get_drvdata(component); 717 718 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; 718 719 unsigned int *item = ucontrol->value.enumerated.item; ··· 895 900 static int rt711_set_bias_level(struct snd_soc_component *component, 896 901 enum snd_soc_bias_level level) 897 902 { 898 - struct snd_soc_dapm_context *dapm = 899 - snd_soc_component_get_dapm(component); 903 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 900 904 struct rt711_priv *rt711 = snd_soc_component_get_drvdata(component); 901 905 902 906 switch (level) { 903 907 case SND_SOC_BIAS_PREPARE: 904 - if (dapm->bias_level == SND_SOC_BIAS_STANDBY) { 908 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_STANDBY) { 905 909 regmap_write(rt711->regmap, 906 910 RT711_SET_AUDIO_POWER_STATE, 907 911 AC_PWRST_D0);
+3 -6
sound/soc/codecs/rt712-sdca-dmic.c
··· 429 429 static int rt712_sdca_dmic_mux_get(struct snd_kcontrol *kcontrol, 430 430 struct snd_ctl_elem_value *ucontrol) 431 431 { 432 - struct snd_soc_component *component = 433 - snd_soc_dapm_kcontrol_component(kcontrol); 432 + struct snd_soc_component *component = snd_soc_dapm_kcontrol_to_component(kcontrol); 434 433 struct rt712_sdca_dmic_priv *rt712 = snd_soc_component_get_drvdata(component); 435 434 unsigned int val = 0, mask_sft; 436 435 ··· 451 452 static int rt712_sdca_dmic_mux_put(struct snd_kcontrol *kcontrol, 452 453 struct snd_ctl_elem_value *ucontrol) 453 454 { 454 - struct snd_soc_component *component = 455 - snd_soc_dapm_kcontrol_component(kcontrol); 456 - struct snd_soc_dapm_context *dapm = 457 - snd_soc_dapm_kcontrol_dapm(kcontrol); 455 + struct snd_soc_component *component = snd_soc_dapm_kcontrol_to_component(kcontrol); 456 + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol); 458 457 struct rt712_sdca_dmic_priv *rt712 = snd_soc_component_get_drvdata(component); 459 458 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; 460 459 unsigned int *item = ucontrol->value.enumerated.item;
+7 -13
sound/soc/codecs/rt712-sdca.c
··· 743 743 static int rt712_sdca_mux_get(struct snd_kcontrol *kcontrol, 744 744 struct snd_ctl_elem_value *ucontrol) 745 745 { 746 - struct snd_soc_component *component = 747 - snd_soc_dapm_kcontrol_component(kcontrol); 746 + struct snd_soc_component *component = snd_soc_dapm_kcontrol_to_component(kcontrol); 748 747 struct rt712_sdca_priv *rt712 = snd_soc_component_get_drvdata(component); 749 748 unsigned int val = 0, mask = 0x3300; 750 749 ··· 767 768 static int rt712_sdca_mux_put(struct snd_kcontrol *kcontrol, 768 769 struct snd_ctl_elem_value *ucontrol) 769 770 { 770 - struct snd_soc_component *component = 771 - snd_soc_dapm_kcontrol_component(kcontrol); 772 - struct snd_soc_dapm_context *dapm = 773 - snd_soc_dapm_kcontrol_dapm(kcontrol); 771 + struct snd_soc_component *component = snd_soc_dapm_kcontrol_to_component(kcontrol); 772 + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol); 774 773 struct rt712_sdca_priv *rt712 = snd_soc_component_get_drvdata(component); 775 774 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; 776 775 unsigned int *item = ucontrol->value.enumerated.item; ··· 1014 1017 1015 1018 static int rt712_sdca_probe(struct snd_soc_component *component) 1016 1019 { 1017 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 1020 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1018 1021 struct rt712_sdca_priv *rt712 = snd_soc_component_get_drvdata(component); 1019 1022 int ret; 1020 1023 ··· 1227 1230 static int rt712_sdca_dmic_mux_get(struct snd_kcontrol *kcontrol, 1228 1231 struct snd_ctl_elem_value *ucontrol) 1229 1232 { 1230 - struct snd_soc_component *component = 1231 - snd_soc_dapm_kcontrol_component(kcontrol); 1233 + struct snd_soc_component *component = snd_soc_dapm_kcontrol_to_component(kcontrol); 1232 1234 struct rt712_sdca_priv *rt712 = snd_soc_component_get_drvdata(component); 1233 1235 unsigned int val = 0, mask_sft; 1234 1236 ··· 1249 1253 static int rt712_sdca_dmic_mux_put(struct snd_kcontrol *kcontrol, 1250 1254 struct snd_ctl_elem_value *ucontrol) 1251 1255 { 1252 - struct snd_soc_component *component = 1253 - snd_soc_dapm_kcontrol_component(kcontrol); 1254 - struct snd_soc_dapm_context *dapm = 1255 - snd_soc_dapm_kcontrol_dapm(kcontrol); 1256 + struct snd_soc_component *component = snd_soc_dapm_kcontrol_to_component(kcontrol); 1257 + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol); 1256 1258 struct rt712_sdca_priv *rt712 = snd_soc_component_get_drvdata(component); 1257 1259 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; 1258 1260 unsigned int *item = ucontrol->value.enumerated.item;
+3 -6
sound/soc/codecs/rt715-sdca.c
··· 502 502 static int rt715_sdca_mux_get(struct snd_kcontrol *kcontrol, 503 503 struct snd_ctl_elem_value *ucontrol) 504 504 { 505 - struct snd_soc_component *component = 506 - snd_soc_dapm_kcontrol_component(kcontrol); 505 + struct snd_soc_component *component = snd_soc_dapm_kcontrol_to_component(kcontrol); 507 506 struct rt715_sdca_priv *rt715 = snd_soc_component_get_drvdata(component); 508 507 unsigned int val, mask_sft; 509 508 ··· 537 538 static int rt715_sdca_mux_put(struct snd_kcontrol *kcontrol, 538 539 struct snd_ctl_elem_value *ucontrol) 539 540 { 540 - struct snd_soc_component *component = 541 - snd_soc_dapm_kcontrol_component(kcontrol); 542 - struct snd_soc_dapm_context *dapm = 543 - snd_soc_dapm_kcontrol_dapm(kcontrol); 541 + struct snd_soc_component *component = snd_soc_dapm_kcontrol_to_component(kcontrol); 542 + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol); 544 543 struct rt715_sdca_priv *rt715 = snd_soc_component_get_drvdata(component); 545 544 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; 546 545 unsigned int *item = ucontrol->value.enumerated.item;
+14 -21
sound/soc/codecs/rt715.c
··· 125 125 struct snd_ctl_elem_value *ucontrol) 126 126 { 127 127 struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 128 - struct snd_soc_dapm_context *dapm = 129 - snd_soc_component_get_dapm(component); 128 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 130 129 struct soc_mixer_control *mc = 131 130 (struct soc_mixer_control *)kcontrol->private_value; 132 131 struct rt715_priv *rt715 = snd_soc_component_get_drvdata(component); ··· 151 152 152 153 rt715_get_gain(rt715, addr_h, addr_l, val_h, &read_rl, &read_ll); 153 154 154 - if (dapm->bias_level <= SND_SOC_BIAS_STANDBY) 155 + if (snd_soc_dapm_get_bias_level(dapm) <= SND_SOC_BIAS_STANDBY) 155 156 regmap_write(rt715->regmap, 156 157 RT715_SET_AUDIO_POWER_STATE, AC_PWRST_D0); 157 158 ··· 205 206 } 206 207 207 208 /* D0:power on state, D3: power saving mode */ 208 - if (dapm->bias_level <= SND_SOC_BIAS_STANDBY) 209 + if (snd_soc_dapm_get_bias_level(dapm) <= SND_SOC_BIAS_STANDBY) 209 210 regmap_write(rt715->regmap, 210 211 RT715_SET_AUDIO_POWER_STATE, AC_PWRST_D3); 211 212 return k_vol_changed; ··· 249 250 struct snd_ctl_elem_value *ucontrol) 250 251 { 251 252 struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 252 - struct snd_soc_dapm_context *dapm = 253 - snd_soc_component_get_dapm(component); 253 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 254 254 struct rt715_priv *rt715 = snd_soc_component_get_drvdata(component); 255 255 static const unsigned int capture_reg_H[] = { 256 256 RT715_SET_GAIN_MIC_ADC_H, RT715_SET_GAIN_LINE_ADC_H, ··· 272 274 addr_l = capture_reg_L[j]; 273 275 rt715_get_gain(rt715, addr_h, addr_l, val_h, &read_rl, &read_ll); 274 276 275 - if (dapm->bias_level <= SND_SOC_BIAS_STANDBY) 277 + if (snd_soc_dapm_get_bias_level(dapm) <= SND_SOC_BIAS_STANDBY) 276 278 regmap_write(rt715->regmap, 277 279 RT715_SET_AUDIO_POWER_STATE, AC_PWRST_D0); 278 280 ··· 320 322 } 321 323 322 324 /* D0:power on state, D3: power saving mode */ 323 - if (dapm->bias_level <= SND_SOC_BIAS_STANDBY) 325 + if (snd_soc_dapm_get_bias_level(dapm) <= SND_SOC_BIAS_STANDBY) 324 326 regmap_write(rt715->regmap, 325 327 RT715_SET_AUDIO_POWER_STATE, AC_PWRST_D3); 326 328 return k_changed; ··· 356 358 struct snd_ctl_elem_value *ucontrol) 357 359 { 358 360 struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 359 - struct snd_soc_dapm_context *dapm = 360 - snd_soc_component_get_dapm(component); 361 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 361 362 struct rt715_priv *rt715 = snd_soc_component_get_drvdata(component); 362 363 static const unsigned int capture_reg_H[] = { 363 364 RT715_SET_GAIN_MIC_ADC_H, RT715_SET_GAIN_LINE_ADC_H, ··· 378 381 addr_l = capture_reg_L[j]; 379 382 rt715_get_gain(rt715, addr_h, addr_l, val_h, &read_rl, &read_ll); 380 383 381 - if (dapm->bias_level <= SND_SOC_BIAS_STANDBY) 384 + if (snd_soc_dapm_get_bias_level(dapm) <= SND_SOC_BIAS_STANDBY) 382 385 regmap_write(rt715->regmap, 383 386 RT715_SET_AUDIO_POWER_STATE, AC_PWRST_D0); 384 387 ··· 428 431 } 429 432 430 433 /* D0:power on state, D3: power saving mode */ 431 - if (dapm->bias_level <= SND_SOC_BIAS_STANDBY) 434 + if (snd_soc_dapm_get_bias_level(dapm) <= SND_SOC_BIAS_STANDBY) 432 435 regmap_write(rt715->regmap, 433 436 RT715_SET_AUDIO_POWER_STATE, AC_PWRST_D3); 434 437 return k_changed; ··· 543 546 static int rt715_mux_get(struct snd_kcontrol *kcontrol, 544 547 struct snd_ctl_elem_value *ucontrol) 545 548 { 546 - struct snd_soc_component *component = 547 - snd_soc_dapm_kcontrol_component(kcontrol); 549 + struct snd_soc_component *component = snd_soc_dapm_kcontrol_to_component(kcontrol); 548 550 struct rt715_priv *rt715 = snd_soc_component_get_drvdata(component); 549 551 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; 550 552 unsigned int reg, val; ··· 573 577 static int rt715_mux_put(struct snd_kcontrol *kcontrol, 574 578 struct snd_ctl_elem_value *ucontrol) 575 579 { 576 - struct snd_soc_component *component = 577 - snd_soc_dapm_kcontrol_component(kcontrol); 578 - struct snd_soc_dapm_context *dapm = 579 - snd_soc_dapm_kcontrol_dapm(kcontrol); 580 + struct snd_soc_component *component = snd_soc_dapm_kcontrol_to_component(kcontrol); 581 + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol); 580 582 struct rt715_priv *rt715 = snd_soc_component_get_drvdata(component); 581 583 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; 582 584 unsigned int *item = ucontrol->value.enumerated.item; ··· 746 752 static int rt715_set_bias_level(struct snd_soc_component *component, 747 753 enum snd_soc_bias_level level) 748 754 { 749 - struct snd_soc_dapm_context *dapm = 750 - snd_soc_component_get_dapm(component); 755 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 751 756 struct rt715_priv *rt715 = snd_soc_component_get_drvdata(component); 752 757 753 758 switch (level) { 754 759 case SND_SOC_BIAS_PREPARE: 755 - if (dapm->bias_level == SND_SOC_BIAS_STANDBY) { 760 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_STANDBY) { 756 761 regmap_write(rt715->regmap, 757 762 RT715_SET_AUDIO_POWER_STATE, 758 763 AC_PWRST_D0);
+3 -6
sound/soc/codecs/rt721-sdca.c
··· 746 746 static int rt721_sdca_adc_mux_get(struct snd_kcontrol *kcontrol, 747 747 struct snd_ctl_elem_value *ucontrol) 748 748 { 749 - struct snd_soc_component *component = 750 - snd_soc_dapm_kcontrol_component(kcontrol); 749 + struct snd_soc_component *component = snd_soc_dapm_kcontrol_to_component(kcontrol); 751 750 struct rt721_sdca_priv *rt721 = snd_soc_component_get_drvdata(component); 752 751 unsigned int val = 0, mask_sft, mask; 753 752 ··· 785 786 static int rt721_sdca_adc_mux_put(struct snd_kcontrol *kcontrol, 786 787 struct snd_ctl_elem_value *ucontrol) 787 788 { 788 - struct snd_soc_component *component = 789 - snd_soc_dapm_kcontrol_component(kcontrol); 790 - struct snd_soc_dapm_context *dapm = 791 - snd_soc_dapm_kcontrol_dapm(kcontrol); 789 + struct snd_soc_component *component = snd_soc_dapm_kcontrol_to_component(kcontrol); 790 + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol); 792 791 struct rt721_sdca_priv *rt721 = snd_soc_component_get_drvdata(component); 793 792 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; 794 793 unsigned int *item = ucontrol->value.enumerated.item;
+4 -3
sound/soc/codecs/simple-mux.c
··· 34 34 static int simple_mux_control_get(struct snd_kcontrol *kcontrol, 35 35 struct snd_ctl_elem_value *ucontrol) 36 36 { 37 - struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_dapm(kcontrol); 37 + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol); 38 38 struct snd_soc_component *c = snd_soc_dapm_to_component(dapm); 39 39 struct simple_mux *priv = snd_soc_component_get_drvdata(c); 40 40 ··· 46 46 static int simple_mux_control_put(struct snd_kcontrol *kcontrol, 47 47 struct snd_ctl_elem_value *ucontrol) 48 48 { 49 - struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_dapm(kcontrol); 49 + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol); 50 50 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; 51 51 struct snd_soc_component *c = snd_soc_dapm_to_component(dapm); 52 52 struct simple_mux *priv = snd_soc_component_get_drvdata(c); ··· 59 59 60 60 priv->mux = ucontrol->value.enumerated.item[0]; 61 61 62 - if (priv->idle_state != MUX_IDLE_AS_IS && dapm->bias_level < SND_SOC_BIAS_PREPARE) 62 + if (priv->idle_state != MUX_IDLE_AS_IS && 63 + snd_soc_dapm_get_bias_level(dapm) < SND_SOC_BIAS_PREPARE) 63 64 return 0; 64 65 65 66 gpiod_set_value_cansleep(priv->gpiod_mux, priv->mux);
+3 -4
sound/soc/codecs/sma1303.c
··· 518 518 struct snd_soc_component *component = 519 519 snd_soc_dapm_to_component(w->dapm); 520 520 struct sma1303_priv *sma1303 = snd_soc_component_get_drvdata(component); 521 - unsigned int mux = dapm_kcontrol_get_value(w->kcontrols[0]); 521 + unsigned int mux = snd_soc_dapm_kcontrol_get_value(w->kcontrols[0]); 522 522 int ret = 0; 523 523 bool change = false, temp = false; 524 524 ··· 588 588 struct snd_soc_component *component = 589 589 snd_soc_dapm_to_component(w->dapm); 590 590 struct sma1303_priv *sma1303 = snd_soc_component_get_drvdata(component); 591 - unsigned int mux = dapm_kcontrol_get_value(w->kcontrols[0]); 591 + unsigned int mux = snd_soc_dapm_kcontrol_get_value(w->kcontrols[0]); 592 592 int ret = 0; 593 593 bool change = false, temp = false; 594 594 ··· 1557 1557 1558 1558 static int sma1303_probe(struct snd_soc_component *component) 1559 1559 { 1560 - struct snd_soc_dapm_context *dapm = 1561 - snd_soc_component_get_dapm(component); 1560 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1562 1561 1563 1562 snd_soc_dapm_sync(dapm); 1564 1563
+25 -34
sound/soc/codecs/sma1307.c
··· 790 790 static int sma1307_dapm_aif_in_get(struct snd_kcontrol *kcontrol, 791 791 struct snd_ctl_elem_value *ucontrol) 792 792 { 793 - struct snd_soc_dapm_context *dapm = 794 - snd_soc_dapm_kcontrol_dapm(kcontrol); 795 - struct sma1307_priv *sma1307 = 796 - snd_soc_component_get_drvdata(dapm->component); 793 + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol); 794 + struct snd_soc_component *component = snd_soc_dapm_to_component(dapm); 795 + struct sma1307_priv *sma1307 = snd_soc_component_get_drvdata(component); 797 796 798 797 ucontrol->value.enumerated.item[0] = (unsigned int)sma1307->dapm_aif_in; 799 798 snd_soc_dapm_put_enum_double(kcontrol, ucontrol); ··· 803 804 static int sma1307_dapm_aif_in_put(struct snd_kcontrol *kcontrol, 804 805 struct snd_ctl_elem_value *ucontrol) 805 806 { 806 - struct snd_soc_dapm_context *dapm = 807 - snd_soc_dapm_kcontrol_dapm(kcontrol); 808 - struct sma1307_priv *sma1307 = 809 - snd_soc_component_get_drvdata(dapm->component); 807 + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol); 808 + struct snd_soc_component *component = snd_soc_dapm_to_component(dapm); 809 + struct sma1307_priv *sma1307 = snd_soc_component_get_drvdata(component); 810 810 int val = (int)ucontrol->value.enumerated.item[0]; 811 811 bool change; 812 812 ··· 828 830 static int sma1307_dapm_sdo_setting_get(struct snd_kcontrol *kcontrol, 829 831 struct snd_ctl_elem_value *ucontrol) 830 832 { 831 - struct snd_soc_dapm_context *dapm = 832 - snd_soc_dapm_kcontrol_dapm(kcontrol); 833 - struct sma1307_priv *sma1307 = 834 - snd_soc_component_get_drvdata(dapm->component); 833 + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol); 834 + struct snd_soc_component *component = snd_soc_dapm_to_component(dapm); 835 + struct sma1307_priv *sma1307 = snd_soc_component_get_drvdata(component); 835 836 836 837 ucontrol->value.enumerated.item[0] = 837 838 (unsigned int)sma1307->dapm_sdo_setting; ··· 842 845 static int sma1307_dapm_sdo_setting_put(struct snd_kcontrol *kcontrol, 843 846 struct snd_ctl_elem_value *ucontrol) 844 847 { 845 - struct snd_soc_dapm_context *dapm = 846 - snd_soc_dapm_kcontrol_dapm(kcontrol); 847 - struct sma1307_priv *sma1307 = 848 - snd_soc_component_get_drvdata(dapm->component); 848 + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol); 849 + struct snd_soc_component *component = snd_soc_dapm_to_component(dapm); 850 + struct sma1307_priv *sma1307 = snd_soc_component_get_drvdata(component); 849 851 int val = (int)ucontrol->value.enumerated.item[0]; 850 852 bool change; 851 853 ··· 867 871 static int sma1307_dapm_aif_out_get(struct snd_kcontrol *kcontrol, 868 872 struct snd_ctl_elem_value *ucontrol) 869 873 { 870 - struct snd_soc_dapm_context *dapm = 871 - snd_soc_dapm_kcontrol_dapm(kcontrol); 872 - struct sma1307_priv *sma1307 = 873 - snd_soc_component_get_drvdata(dapm->component); 874 + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol); 875 + struct snd_soc_component *component = snd_soc_dapm_to_component(dapm); 876 + struct sma1307_priv *sma1307 = snd_soc_component_get_drvdata(component); 874 877 unsigned int val = 0; 875 878 876 879 if (!strcmp(kcontrol->id.name, SMA1307_AIF_OUT0_NAME)) { ··· 890 895 static int sma1307_dapm_aif_out_put(struct snd_kcontrol *kcontrol, 891 896 struct snd_ctl_elem_value *ucontrol) 892 897 { 893 - struct snd_soc_dapm_context *dapm = 894 - snd_soc_dapm_kcontrol_dapm(kcontrol); 895 - struct sma1307_priv *sma1307 = 896 - snd_soc_component_get_drvdata(dapm->component); 898 + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol); 899 + struct snd_soc_component *component = snd_soc_dapm_to_component(dapm); 900 + struct sma1307_priv *sma1307 = snd_soc_component_get_drvdata(component); 897 901 int val = (int)ucontrol->value.enumerated.item[0]; 898 902 bool change; 899 903 ··· 927 933 static int sma1307_dapm_sdo_enable_get(struct snd_kcontrol *kcontrol, 928 934 struct snd_ctl_elem_value *ucontrol) 929 935 { 930 - struct snd_soc_dapm_context *dapm = 931 - snd_soc_dapm_kcontrol_dapm(kcontrol); 932 - struct sma1307_priv *sma1307 = 933 - snd_soc_component_get_drvdata(dapm->component); 936 + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol); 937 + struct snd_soc_component *component = snd_soc_dapm_to_component(dapm); 938 + struct sma1307_priv *sma1307 = snd_soc_component_get_drvdata(component); 934 939 935 940 ucontrol->value.integer.value[0] = (long)sma1307->dapm_sdo_en; 936 941 snd_soc_dapm_put_volsw(kcontrol, ucontrol); ··· 940 947 static int sma1307_dapm_sdo_enable_put(struct snd_kcontrol *kcontrol, 941 948 struct snd_ctl_elem_value *ucontrol) 942 949 { 943 - struct snd_soc_dapm_context *dapm = 944 - snd_soc_dapm_kcontrol_dapm(kcontrol); 945 - struct sma1307_priv *sma1307 = 946 - snd_soc_component_get_drvdata(dapm->component); 950 + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol); 951 + struct snd_soc_component *component = snd_soc_dapm_to_component(dapm); 952 + struct sma1307_priv *sma1307 = snd_soc_component_get_drvdata(component); 947 953 int val = (int)ucontrol->value.integer.value[0]; 948 954 bool change; 949 955 ··· 1849 1857 1850 1858 static int sma1307_probe(struct snd_soc_component *component) 1851 1859 { 1852 - struct snd_soc_dapm_context *dapm = 1853 - snd_soc_component_get_dapm(component); 1860 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1854 1861 1855 1862 snd_soc_dapm_sync(dapm); 1856 1863
+2 -1
sound/soc/codecs/ssm2518.c
··· 500 500 enum snd_soc_bias_level level) 501 501 { 502 502 struct ssm2518 *ssm2518 = snd_soc_component_get_drvdata(component); 503 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 503 504 int ret = 0; 504 505 505 506 switch (level) { ··· 509 508 case SND_SOC_BIAS_PREPARE: 510 509 break; 511 510 case SND_SOC_BIAS_STANDBY: 512 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) 511 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) 513 512 ret = ssm2518_set_power(ssm2518, true); 514 513 break; 515 514 case SND_SOC_BIAS_OFF:
+2 -2
sound/soc/codecs/ssm2602.c
··· 562 562 563 563 static int ssm2602_component_probe(struct snd_soc_component *component) 564 564 { 565 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 565 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 566 566 struct ssm2602_priv *ssm2602 = snd_soc_component_get_drvdata(component); 567 567 int ret; 568 568 ··· 587 587 588 588 static int ssm2604_component_probe(struct snd_soc_component *component) 589 589 { 590 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 590 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 591 591 int ret; 592 592 593 593 ret = snd_soc_dapm_new_controls(dapm, ssm2604_dapm_widgets,
+2 -1
sound/soc/codecs/ssm4567.c
··· 369 369 enum snd_soc_bias_level level) 370 370 { 371 371 struct ssm4567 *ssm4567 = snd_soc_component_get_drvdata(component); 372 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 372 373 int ret = 0; 373 374 374 375 switch (level) { ··· 378 377 case SND_SOC_BIAS_PREPARE: 379 378 break; 380 379 case SND_SOC_BIAS_STANDBY: 381 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) 380 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) 382 381 ret = ssm4567_set_power(ssm4567, true); 383 382 break; 384 383 case SND_SOC_BIAS_OFF:
+4 -2
sound/soc/codecs/sta32x.c
··· 799 799 { 800 800 int ret; 801 801 struct sta32x_priv *sta32x = snd_soc_component_get_drvdata(component); 802 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 802 803 803 804 dev_dbg(component->dev, "level = %d\n", level); 804 805 switch (level) { ··· 814 813 break; 815 814 816 815 case SND_SOC_BIAS_STANDBY: 817 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { 816 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) { 818 817 ret = regulator_bulk_enable(ARRAY_SIZE(sta32x->supplies), 819 818 sta32x->supplies); 820 819 if (ret != 0) { ··· 871 870 872 871 static int sta32x_probe(struct snd_soc_component *component) 873 872 { 873 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 874 874 struct sta32x_priv *sta32x = snd_soc_component_get_drvdata(component); 875 875 struct sta32x_platform_data *pdata = sta32x->pdata; 876 876 int i, ret = 0, thermal = 0; ··· 976 974 if (sta32x->pdata->needs_esd_watchdog) 977 975 INIT_DELAYED_WORK(&sta32x->watchdog_work, sta32x_watchdog); 978 976 979 - snd_soc_component_force_bias_level(component, SND_SOC_BIAS_STANDBY); 977 + snd_soc_dapm_force_bias_level(dapm, SND_SOC_BIAS_STANDBY); 980 978 /* Bias level configuration will have done an extra enable */ 981 979 regulator_bulk_disable(ARRAY_SIZE(sta32x->supplies), sta32x->supplies); 982 980
+4 -2
sound/soc/codecs/sta350.c
··· 830 830 enum snd_soc_bias_level level) 831 831 { 832 832 struct sta350_priv *sta350 = snd_soc_component_get_drvdata(component); 833 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 833 834 int ret; 834 835 835 836 dev_dbg(component->dev, "level = %d\n", level); ··· 846 845 break; 847 846 848 847 case SND_SOC_BIAS_STANDBY: 849 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { 848 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) { 850 849 ret = regulator_bulk_enable( 851 850 ARRAY_SIZE(sta350->supplies), 852 851 sta350->supplies); ··· 906 905 907 906 static int sta350_probe(struct snd_soc_component *component) 908 907 { 908 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 909 909 struct sta350_priv *sta350 = snd_soc_component_get_drvdata(component); 910 910 struct sta350_platform_data *pdata = sta350->pdata; 911 911 int i, ret = 0, thermal = 0; ··· 1030 1028 sta350->coef_shadow[60] = 0x400000; 1031 1029 sta350->coef_shadow[61] = 0x400000; 1032 1030 1033 - snd_soc_component_force_bias_level(component, SND_SOC_BIAS_STANDBY); 1031 + snd_soc_dapm_force_bias_level(dapm, SND_SOC_BIAS_STANDBY); 1034 1032 /* Bias level configuration will have done an extra enable */ 1035 1033 regulator_bulk_disable(ARRAY_SIZE(sta350->supplies), sta350->supplies); 1036 1034
+2 -1
sound/soc/codecs/sta529.c
··· 155 155 snd_soc_bias_level level) 156 156 { 157 157 struct sta529 *sta529 = snd_soc_component_get_drvdata(component); 158 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 158 159 159 160 switch (level) { 160 161 case SND_SOC_BIAS_ON: ··· 166 165 FFX_CLK_ENB); 167 166 break; 168 167 case SND_SOC_BIAS_STANDBY: 169 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) 168 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) 170 169 regcache_sync(sta529->regmap); 171 170 snd_soc_component_update_bits(component, STA529_FFXCFG0, 172 171 POWER_CNTLMSAK, POWER_STDBY);
+2 -1
sound/soc/codecs/tas571x.c
··· 322 322 enum snd_soc_bias_level level) 323 323 { 324 324 struct tas571x_private *priv = snd_soc_component_get_drvdata(component); 325 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 325 326 int ret; 326 327 327 328 switch (level) { ··· 331 330 case SND_SOC_BIAS_PREPARE: 332 331 break; 333 332 case SND_SOC_BIAS_STANDBY: 334 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { 333 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) { 335 334 if (!IS_ERR(priv->mclk)) { 336 335 ret = clk_prepare_enable(priv->mclk); 337 336 if (ret) {
+3 -1
sound/soc/codecs/tas6424.c
··· 346 346 static int tas6424_set_bias_level(struct snd_soc_component *component, 347 347 enum snd_soc_bias_level level) 348 348 { 349 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 350 + 349 351 dev_dbg(component->dev, "%s() level=%d\n", __func__, level); 350 352 351 353 switch (level) { ··· 355 353 case SND_SOC_BIAS_PREPARE: 356 354 break; 357 355 case SND_SOC_BIAS_STANDBY: 358 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) 356 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) 359 357 tas6424_power_on(component); 360 358 break; 361 359 case SND_SOC_BIAS_OFF:
+2 -2
sound/soc/codecs/tlv320adc3xxx.c
··· 1193 1193 struct snd_soc_dai *dai) 1194 1194 { 1195 1195 struct snd_soc_component *component = dai->component; 1196 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(dai->component); 1196 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(dai->component); 1197 1197 struct adc3xxx *adc3xxx = snd_soc_component_get_drvdata(component); 1198 1198 int i, width = 16; 1199 1199 u8 iface_len, bdiv; ··· 1299 1299 static int adc3xxx_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) 1300 1300 { 1301 1301 struct snd_soc_component *component = codec_dai->component; 1302 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 1302 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1303 1303 struct adc3xxx *adc3xxx = snd_soc_component_get_drvdata(component); 1304 1304 u8 clkdir = 0, format = 0; 1305 1305 int master = 0;
+8 -6
sound/soc/codecs/tlv320aic31xx.c
··· 799 799 800 800 static int aic31xx_add_widgets(struct snd_soc_component *component) 801 801 { 802 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 802 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 803 803 struct aic31xx_priv *aic31xx = snd_soc_component_get_drvdata(component); 804 804 int ret = 0; 805 805 ··· 1030 1030 static int aic31xx_clock_master_routes(struct snd_soc_component *component, 1031 1031 unsigned int fmt) 1032 1032 { 1033 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 1033 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1034 1034 struct aic31xx_priv *aic31xx = snd_soc_component_get_drvdata(component); 1035 1035 int ret; 1036 1036 ··· 1316 1316 static int aic31xx_set_bias_level(struct snd_soc_component *component, 1317 1317 enum snd_soc_bias_level level) 1318 1318 { 1319 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1320 + 1319 1321 dev_dbg(component->dev, "## %s: %d -> %d\n", __func__, 1320 - snd_soc_component_get_bias_level(component), level); 1322 + snd_soc_dapm_get_bias_level(dapm), level); 1321 1323 1322 1324 switch (level) { 1323 1325 case SND_SOC_BIAS_ON: 1324 1326 break; 1325 1327 case SND_SOC_BIAS_PREPARE: 1326 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_STANDBY) 1328 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_STANDBY) 1327 1329 aic31xx_clk_on(component); 1328 1330 break; 1329 1331 case SND_SOC_BIAS_STANDBY: 1330 - switch (snd_soc_component_get_bias_level(component)) { 1332 + switch (snd_soc_dapm_get_bias_level(dapm)) { 1331 1333 case SND_SOC_BIAS_OFF: 1332 1334 aic31xx_power_on(component); 1333 1335 break; ··· 1341 1339 } 1342 1340 break; 1343 1341 case SND_SOC_BIAS_OFF: 1344 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_STANDBY) 1342 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_STANDBY) 1345 1343 aic31xx_power_off(component); 1346 1344 break; 1347 1345 }
+2 -1
sound/soc/codecs/tlv320aic32x4.c
··· 883 883 static int aic32x4_set_bias_level(struct snd_soc_component *component, 884 884 enum snd_soc_bias_level level) 885 885 { 886 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 886 887 int ret; 887 888 888 889 static struct clk_bulk_data clocks[] = { ··· 908 907 break; 909 908 case SND_SOC_BIAS_STANDBY: 910 909 /* Initial cold start */ 911 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) 910 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) 912 911 break; 913 912 914 913 clk_bulk_disable_unprepare(ARRAY_SIZE(clocks), clocks);
+6 -5
sound/soc/codecs/tlv320aic3x.c
··· 163 163 static int snd_soc_dapm_put_volsw_aic3x(struct snd_kcontrol *kcontrol, 164 164 struct snd_ctl_elem_value *ucontrol) 165 165 { 166 - struct snd_soc_component *component = snd_soc_dapm_kcontrol_component(kcontrol); 167 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 166 + struct snd_soc_component *component = snd_soc_dapm_kcontrol_to_component(kcontrol); 167 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 168 168 struct soc_mixer_control *mc = 169 169 (struct soc_mixer_control *)kcontrol->private_value; 170 170 unsigned int reg = mc->reg; ··· 1009 1009 static int aic3x_add_widgets(struct snd_soc_component *component) 1010 1010 { 1011 1011 struct aic3x_priv *aic3x = snd_soc_component_get_drvdata(component); 1012 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 1012 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1013 1013 1014 1014 switch (aic3x->model) { 1015 1015 case AIC3X_MODEL_3X: ··· 1449 1449 static int aic3x_set_bias_level(struct snd_soc_component *component, 1450 1450 enum snd_soc_bias_level level) 1451 1451 { 1452 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1452 1453 struct aic3x_priv *aic3x = snd_soc_component_get_drvdata(component); 1453 1454 1454 1455 switch (level) { 1455 1456 case SND_SOC_BIAS_ON: 1456 1457 break; 1457 1458 case SND_SOC_BIAS_PREPARE: 1458 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_STANDBY && 1459 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_STANDBY && 1459 1460 aic3x->master) { 1460 1461 /* enable pll */ 1461 1462 snd_soc_component_update_bits(component, AIC3X_PLL_PROGA_REG, ··· 1466 1465 case SND_SOC_BIAS_STANDBY: 1467 1466 if (!aic3x->power) 1468 1467 aic3x_set_power(component, 1); 1469 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_PREPARE && 1468 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_PREPARE && 1470 1469 aic3x->master) { 1471 1470 /* disable pll */ 1472 1471 snd_soc_component_update_bits(component, AIC3X_PLL_PROGA_REG,
+3 -2
sound/soc/codecs/tlv320dac33.c
··· 623 623 static int dac33_set_bias_level(struct snd_soc_component *component, 624 624 enum snd_soc_bias_level level) 625 625 { 626 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 626 627 int ret; 627 628 628 629 switch (level) { ··· 632 631 case SND_SOC_BIAS_PREPARE: 633 632 break; 634 633 case SND_SOC_BIAS_STANDBY: 635 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { 634 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) { 636 635 /* Coming from OFF, switch on the component */ 637 636 ret = dac33_hard_power(component, 1); 638 637 if (ret != 0) ··· 643 642 break; 644 643 case SND_SOC_BIAS_OFF: 645 644 /* Do not power off, when the component is already off */ 646 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) 645 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) 647 646 return 0; 648 647 ret = dac33_hard_power(component, 0); 649 648 if (ret != 0)
+3 -1
sound/soc/codecs/twl4030.c
··· 1570 1570 static int twl4030_set_bias_level(struct snd_soc_component *component, 1571 1571 enum snd_soc_bias_level level) 1572 1572 { 1573 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1574 + 1573 1575 switch (level) { 1574 1576 case SND_SOC_BIAS_ON: 1575 1577 break; 1576 1578 case SND_SOC_BIAS_PREPARE: 1577 1579 break; 1578 1580 case SND_SOC_BIAS_STANDBY: 1579 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) 1581 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) 1580 1582 twl4030_codec_enable(component, 1); 1581 1583 break; 1582 1584 case SND_SOC_BIAS_OFF:
+4 -3
sound/soc/codecs/twl6040.c
··· 323 323 static int twl6040_soc_dapm_put_vibra_enum(struct snd_kcontrol *kcontrol, 324 324 struct snd_ctl_elem_value *ucontrol) 325 325 { 326 - struct snd_soc_component *component = snd_soc_dapm_kcontrol_component(kcontrol); 326 + struct snd_soc_component *component = snd_soc_dapm_kcontrol_to_component(kcontrol); 327 327 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; 328 328 unsigned int val; 329 329 ··· 521 521 522 522 int twl6040_get_dl1_gain(struct snd_soc_component *component) 523 523 { 524 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 524 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 525 525 526 526 if (snd_soc_dapm_get_pin_status(dapm, "EP")) 527 527 return -1; /* -1dB */ ··· 1097 1097 static int twl6040_probe(struct snd_soc_component *component) 1098 1098 { 1099 1099 struct twl6040_data *priv; 1100 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1100 1101 struct platform_device *pdev = to_platform_device(component->dev); 1101 1102 int ret = 0; 1102 1103 ··· 1126 1125 return ret; 1127 1126 } 1128 1127 1129 - snd_soc_component_force_bias_level(component, SND_SOC_BIAS_STANDBY); 1128 + snd_soc_dapm_force_bias_level(dapm, SND_SOC_BIAS_STANDBY); 1130 1129 twl6040_init_chip(component); 1131 1130 1132 1131 return 0;
+2 -1
sound/soc/codecs/uda1380.c
··· 588 588 static int uda1380_set_bias_level(struct snd_soc_component *component, 589 589 enum snd_soc_bias_level level) 590 590 { 591 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 591 592 int pm = uda1380_read_reg_cache(component, UDA1380_PM); 592 593 int reg; 593 594 struct uda1380_platform_data *pdata = component->dev->platform_data; ··· 600 599 uda1380_write(component, UDA1380_PM, R02_PON_BIAS | pm); 601 600 break; 602 601 case SND_SOC_BIAS_STANDBY: 603 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { 602 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) { 604 603 if (gpio_is_valid(pdata->gpio_power)) { 605 604 gpio_set_value(pdata->gpio_power, 1); 606 605 mdelay(1);
+15 -11
sound/soc/codecs/wcd9335.c
··· 1260 1260 static int slim_rx_mux_get(struct snd_kcontrol *kc, 1261 1261 struct snd_ctl_elem_value *ucontrol) 1262 1262 { 1263 - struct snd_soc_dapm_widget *w = snd_soc_dapm_kcontrol_widget(kc); 1264 - struct wcd9335_codec *wcd = dev_get_drvdata(w->dapm->dev); 1263 + struct snd_soc_dapm_widget *w = snd_soc_dapm_kcontrol_to_widget(kc); 1264 + struct device *dev = snd_soc_dapm_to_dev(w->dapm); 1265 + struct wcd9335_codec *wcd = dev_get_drvdata(dev); 1265 1266 u32 port_id = w->shift; 1266 1267 1267 1268 ucontrol->value.enumerated.item[0] = wcd->rx_port_value[port_id]; ··· 1273 1272 static int slim_rx_mux_put(struct snd_kcontrol *kc, 1274 1273 struct snd_ctl_elem_value *ucontrol) 1275 1274 { 1276 - struct snd_soc_dapm_widget *w = snd_soc_dapm_kcontrol_widget(kc); 1277 - struct wcd9335_codec *wcd = dev_get_drvdata(w->dapm->dev); 1275 + struct snd_soc_dapm_widget *w = snd_soc_dapm_kcontrol_to_widget(kc); 1276 + struct device *dev = snd_soc_dapm_to_dev(w->dapm); 1277 + struct wcd9335_codec *wcd = dev_get_drvdata(dev); 1278 1278 struct soc_enum *e = (struct soc_enum *)kc->private_value; 1279 1279 struct snd_soc_dapm_update *update = NULL; 1280 1280 u32 port_id = w->shift; ··· 1325 1323 struct snd_ctl_elem_value *ucontrol) 1326 1324 { 1327 1325 1328 - struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_dapm(kc); 1329 - struct wcd9335_codec *wcd = dev_get_drvdata(dapm->dev); 1330 - struct snd_soc_dapm_widget *widget = snd_soc_dapm_kcontrol_widget(kc); 1326 + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kc); 1327 + struct device *dev = snd_soc_dapm_to_dev(dapm); 1328 + struct wcd9335_codec *wcd = dev_get_drvdata(dev); 1329 + struct snd_soc_dapm_widget *widget = snd_soc_dapm_kcontrol_to_widget(kc); 1331 1330 struct soc_mixer_control *mixer = 1332 1331 (struct soc_mixer_control *)kc->private_value; 1333 1332 int dai_id = widget->shift; ··· 1343 1340 struct snd_ctl_elem_value *ucontrol) 1344 1341 { 1345 1342 1346 - struct snd_soc_dapm_widget *widget = snd_soc_dapm_kcontrol_widget(kc); 1347 - struct wcd9335_codec *wcd = dev_get_drvdata(widget->dapm->dev); 1343 + struct snd_soc_dapm_widget *widget = snd_soc_dapm_kcontrol_to_widget(kc); 1344 + struct device *dev = snd_soc_dapm_to_dev(widget->dapm); 1345 + struct wcd9335_codec *wcd = dev_get_drvdata(dev); 1348 1346 struct snd_soc_dapm_update *update = NULL; 1349 1347 struct soc_mixer_control *mixer = 1350 1348 (struct soc_mixer_control *)kc->private_value; ··· 1478 1474 static int wcd9335_put_dec_enum(struct snd_kcontrol *kc, 1479 1475 struct snd_ctl_elem_value *ucontrol) 1480 1476 { 1481 - struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_dapm(kc); 1477 + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kc); 1482 1478 struct snd_soc_component *component = snd_soc_dapm_to_component(dapm); 1483 1479 struct soc_enum *e = (struct soc_enum *)kc->private_value; 1484 1480 unsigned int val, reg, sel; ··· 1533 1529 struct snd_soc_component *component; 1534 1530 int reg, val; 1535 1531 1536 - component = snd_soc_dapm_kcontrol_component(kc); 1532 + component = snd_soc_dapm_kcontrol_to_component(kc); 1537 1533 val = ucontrol->value.enumerated.item[0]; 1538 1534 1539 1535 if (e->reg == WCD9335_CDC_RX0_RX_PATH_SEC0)
+15 -11
sound/soc/codecs/wcd934x.c
··· 3250 3250 static int slim_rx_mux_get(struct snd_kcontrol *kc, 3251 3251 struct snd_ctl_elem_value *ucontrol) 3252 3252 { 3253 - struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_dapm(kc); 3254 - struct snd_soc_dapm_widget *w = snd_soc_dapm_kcontrol_widget(kc); 3255 - struct wcd934x_codec *wcd = dev_get_drvdata(dapm->dev); 3253 + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kc); 3254 + struct snd_soc_dapm_widget *w = snd_soc_dapm_kcontrol_to_widget(kc); 3255 + struct device *dev = snd_soc_dapm_to_dev(dapm); 3256 + struct wcd934x_codec *wcd = dev_get_drvdata(dev); 3256 3257 3257 3258 ucontrol->value.enumerated.item[0] = wcd->rx_port_value[w->shift]; 3258 3259 ··· 3288 3287 static int slim_rx_mux_put(struct snd_kcontrol *kc, 3289 3288 struct snd_ctl_elem_value *ucontrol) 3290 3289 { 3291 - struct snd_soc_dapm_widget *w = snd_soc_dapm_kcontrol_widget(kc); 3292 - struct wcd934x_codec *wcd = dev_get_drvdata(w->dapm->dev); 3290 + struct snd_soc_dapm_widget *w = snd_soc_dapm_kcontrol_to_widget(kc); 3291 + struct device *dev = snd_soc_dapm_to_dev(w->dapm); 3292 + struct wcd934x_codec *wcd = dev_get_drvdata(dev); 3293 3293 struct soc_enum *e = (struct soc_enum *)kc->private_value; 3294 3294 struct snd_soc_dapm_update *update = NULL; 3295 3295 struct wcd934x_slim_ch *ch, *c; ··· 3357 3355 struct snd_soc_component *component; 3358 3356 int reg, val; 3359 3357 3360 - component = snd_soc_dapm_kcontrol_component(kc); 3358 + component = snd_soc_dapm_kcontrol_to_component(kc); 3361 3359 val = ucontrol->value.enumerated.item[0]; 3362 3360 if (e->reg == WCD934X_CDC_RX0_RX_PATH_SEC0) 3363 3361 reg = WCD934X_CDC_RX0_RX_PATH_CFG0; ··· 3390 3388 u16 mic_sel_reg = 0; 3391 3389 u8 mic_sel; 3392 3390 3393 - comp = snd_soc_dapm_kcontrol_component(kcontrol); 3391 + comp = snd_soc_dapm_kcontrol_to_component(kcontrol); 3394 3392 3395 3393 val = ucontrol->value.enumerated.item[0]; 3396 3394 if (val > e->items - 1) ··· 3769 3767 static int slim_tx_mixer_get(struct snd_kcontrol *kc, 3770 3768 struct snd_ctl_elem_value *ucontrol) 3771 3769 { 3772 - struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_dapm(kc); 3773 - struct wcd934x_codec *wcd = dev_get_drvdata(dapm->dev); 3770 + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kc); 3771 + struct device *dev = snd_soc_dapm_to_dev(dapm); 3772 + struct wcd934x_codec *wcd = dev_get_drvdata(dev); 3774 3773 struct soc_mixer_control *mixer = 3775 3774 (struct soc_mixer_control *)kc->private_value; 3776 3775 int port_id = mixer->shift; ··· 3784 3781 static int slim_tx_mixer_put(struct snd_kcontrol *kc, 3785 3782 struct snd_ctl_elem_value *ucontrol) 3786 3783 { 3787 - struct snd_soc_dapm_widget *widget = snd_soc_dapm_kcontrol_widget(kc); 3788 - struct wcd934x_codec *wcd = dev_get_drvdata(widget->dapm->dev); 3784 + struct snd_soc_dapm_widget *widget = snd_soc_dapm_kcontrol_to_widget(kc); 3785 + struct device *dev = snd_soc_dapm_to_dev(widget->dapm); 3786 + struct wcd934x_codec *wcd = dev_get_drvdata(dev); 3789 3787 struct snd_soc_dapm_update *update = NULL; 3790 3788 struct soc_mixer_control *mixer = 3791 3789 (struct soc_mixer_control *)kc->private_value;
+1 -1
sound/soc/codecs/wcd937x.c
··· 2473 2473 2474 2474 static int wcd937x_soc_codec_probe(struct snd_soc_component *component) 2475 2475 { 2476 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 2476 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 2477 2477 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); 2478 2478 struct sdw_slave *tx_sdw_dev = wcd937x->tx_sdw_dev; 2479 2479 struct device *dev = component->dev;
+3 -2
sound/soc/codecs/wm0010.c
··· 723 723 enum snd_soc_bias_level level) 724 724 { 725 725 struct wm0010_priv *wm0010 = snd_soc_component_get_drvdata(component); 726 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 726 727 727 728 switch (level) { 728 729 case SND_SOC_BIAS_ON: 729 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_PREPARE) 730 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_PREPARE) 730 731 wm0010_boot(component); 731 732 break; 732 733 case SND_SOC_BIAS_PREPARE: 733 734 break; 734 735 case SND_SOC_BIAS_STANDBY: 735 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_PREPARE) { 736 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_PREPARE) { 736 737 mutex_lock(&wm0010->lock); 737 738 wm0010_halt(component); 738 739 mutex_unlock(&wm0010->lock);
+2 -2
sound/soc/codecs/wm5100.c
··· 2101 2101 int wm5100_detect(struct snd_soc_component *component, struct snd_soc_jack *jack) 2102 2102 { 2103 2103 struct wm5100_priv *wm5100 = snd_soc_component_get_drvdata(component); 2104 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 2104 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 2105 2105 2106 2106 if (jack) { 2107 2107 wm5100->jack = jack; ··· 2329 2329 2330 2330 static int wm5100_probe(struct snd_soc_component *component) 2331 2331 { 2332 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 2332 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 2333 2333 struct i2c_client *i2c = to_i2c_client(component->dev); 2334 2334 struct wm5100_priv *wm5100 = snd_soc_component_get_drvdata(component); 2335 2335 int ret, i;
+2 -2
sound/soc/codecs/wm5102.c
··· 1949 1949 1950 1950 static int wm5102_component_probe(struct snd_soc_component *component) 1951 1951 { 1952 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 1952 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1953 1953 struct wm5102_priv *priv = snd_soc_component_get_drvdata(component); 1954 1954 struct arizona *arizona = priv->core.arizona; 1955 1955 int ret; ··· 1971 1971 1972 1972 arizona_init_gpio(component); 1973 1973 1974 - snd_soc_component_disable_pin(component, "HAPTICS"); 1974 + snd_soc_dapm_disable_pin(dapm, "HAPTICS"); 1975 1975 1976 1976 priv->core.arizona->dapm = dapm; 1977 1977
+5 -5
sound/soc/codecs/wm5110.c
··· 403 403 struct snd_ctl_elem_value *ucontrol) 404 404 { 405 405 struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 406 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 406 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 407 407 struct arizona *arizona = dev_get_drvdata(component->dev->parent); 408 408 struct soc_mixer_control *mc = 409 409 (struct soc_mixer_control *)kcontrol->private_value; ··· 468 468 struct snd_ctl_elem_value *ucontrol) 469 469 { 470 470 struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 471 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 471 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 472 472 int ret; 473 473 474 474 /* ··· 488 488 struct snd_ctl_elem_value *ucontrol) 489 489 { 490 490 struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 491 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 491 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 492 492 int ret; 493 493 494 494 /* ··· 2297 2297 2298 2298 static int wm5110_component_probe(struct snd_soc_component *component) 2299 2299 { 2300 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 2300 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 2301 2301 struct wm5110_priv *priv = snd_soc_component_get_drvdata(component); 2302 2302 struct arizona *arizona = priv->core.arizona; 2303 2303 int i, ret; ··· 2324 2324 if (ret) 2325 2325 goto err_adsp2_codec_probe; 2326 2326 2327 - snd_soc_component_disable_pin(component, "HAPTICS"); 2327 + snd_soc_dapm_disable_pin(dapm, "HAPTICS"); 2328 2328 2329 2329 return 0; 2330 2330
+2 -1
sound/soc/codecs/wm8350.c
··· 1075 1075 static int wm8350_set_bias_level(struct snd_soc_component *component, 1076 1076 enum snd_soc_bias_level level) 1077 1077 { 1078 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1078 1079 struct wm8350_data *priv = snd_soc_component_get_drvdata(component); 1079 1080 struct wm8350 *wm8350 = priv->wm8350; 1080 1081 struct wm8350_audio_platform_data *platform = ··· 1100 1099 break; 1101 1100 1102 1101 case SND_SOC_BIAS_STANDBY: 1103 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { 1102 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) { 1104 1103 ret = regulator_bulk_enable(ARRAY_SIZE(priv->supplies), 1105 1104 priv->supplies); 1106 1105 if (ret != 0)
+2 -1
sound/soc/codecs/wm8400.c
··· 1111 1111 enum snd_soc_bias_level level) 1112 1112 { 1113 1113 struct wm8400_priv *wm8400 = snd_soc_component_get_drvdata(component); 1114 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1114 1115 u16 val; 1115 1116 int ret; 1116 1117 ··· 1127 1126 break; 1128 1127 1129 1128 case SND_SOC_BIAS_STANDBY: 1130 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { 1129 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) { 1131 1130 ret = regulator_bulk_enable(ARRAY_SIZE(power), 1132 1131 &power[0]); 1133 1132 if (ret != 0) {
+2 -1
sound/soc/codecs/wm8510.c
··· 504 504 enum snd_soc_bias_level level) 505 505 { 506 506 struct wm8510_priv *wm8510 = snd_soc_component_get_drvdata(component); 507 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 507 508 u16 power1 = snd_soc_component_read(component, WM8510_POWER1) & ~0x3; 508 509 509 510 switch (level) { ··· 517 516 case SND_SOC_BIAS_STANDBY: 518 517 power1 |= WM8510_POWER1_BIASEN | WM8510_POWER1_BUFIOEN; 519 518 520 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { 519 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) { 521 520 regcache_sync(wm8510->regmap); 522 521 523 522 /* Initial cap charge at VMID 5k */
+2 -1
sound/soc/codecs/wm8523.c
··· 317 317 enum snd_soc_bias_level level) 318 318 { 319 319 struct wm8523_priv *wm8523 = snd_soc_component_get_drvdata(component); 320 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 320 321 int ret; 321 322 322 323 switch (level) { ··· 331 330 break; 332 331 333 332 case SND_SOC_BIAS_STANDBY: 334 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { 333 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) { 335 334 ret = regulator_bulk_enable(ARRAY_SIZE(wm8523->supplies), 336 335 wm8523->supplies); 337 336 if (ret != 0) {
+4 -2
sound/soc/codecs/wm8580.c
··· 820 820 static int wm8580_set_bias_level(struct snd_soc_component *component, 821 821 enum snd_soc_bias_level level) 822 822 { 823 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 824 + 823 825 switch (level) { 824 826 case SND_SOC_BIAS_ON: 825 827 case SND_SOC_BIAS_PREPARE: 826 828 break; 827 829 828 830 case SND_SOC_BIAS_STANDBY: 829 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { 831 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) { 830 832 /* Power up and get individual control of the DACs */ 831 833 snd_soc_component_update_bits(component, WM8580_PWRDN1, 832 834 WM8580_PWRDN1_PWDN | ··· 909 907 static int wm8580_probe(struct snd_soc_component *component) 910 908 { 911 909 struct wm8580_priv *wm8580 = snd_soc_component_get_drvdata(component); 912 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 910 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 913 911 int ret = 0; 914 912 915 913 switch (wm8580->drvdata->num_dacs) {
+2 -1
sound/soc/codecs/wm8711.c
··· 298 298 enum snd_soc_bias_level level) 299 299 { 300 300 struct wm8711_priv *wm8711 = snd_soc_component_get_drvdata(component); 301 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 301 302 u16 reg = snd_soc_component_read(component, WM8711_PWR) & 0xff7f; 302 303 303 304 switch (level) { ··· 308 307 case SND_SOC_BIAS_PREPARE: 309 308 break; 310 309 case SND_SOC_BIAS_STANDBY: 311 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) 310 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) 312 311 regcache_sync(wm8711->regmap); 313 312 314 313 snd_soc_component_write(component, WM8711_PWR, reg | 0x0040);
+2 -1
sound/soc/codecs/wm8728.c
··· 161 161 enum snd_soc_bias_level level) 162 162 { 163 163 struct wm8728_priv *wm8728 = snd_soc_component_get_drvdata(component); 164 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 164 165 u16 reg; 165 166 166 167 switch (level) { 167 168 case SND_SOC_BIAS_ON: 168 169 case SND_SOC_BIAS_PREPARE: 169 170 case SND_SOC_BIAS_STANDBY: 170 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { 171 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) { 171 172 /* Power everything up... */ 172 173 reg = snd_soc_component_read(component, WM8728_DACCTL); 173 174 snd_soc_component_write(component, WM8728_DACCTL, reg & ~0x4);
+3 -2
sound/soc/codecs/wm8731.c
··· 362 362 int clk_id, unsigned int freq, int dir) 363 363 { 364 364 struct snd_soc_component *component = codec_dai->component; 365 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 365 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 366 366 struct wm8731_priv *wm8731 = snd_soc_component_get_drvdata(component); 367 367 368 368 switch (clk_id) { ··· 465 465 enum snd_soc_bias_level level) 466 466 { 467 467 struct wm8731_priv *wm8731 = snd_soc_component_get_drvdata(component); 468 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 468 469 int ret; 469 470 u16 reg; 470 471 ··· 480 479 case SND_SOC_BIAS_PREPARE: 481 480 break; 482 481 case SND_SOC_BIAS_STANDBY: 483 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { 482 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) { 484 483 ret = regulator_bulk_enable(ARRAY_SIZE(wm8731->supplies), 485 484 wm8731->supplies); 486 485 if (ret != 0)
+4 -2
sound/soc/codecs/wm8737.c
··· 452 452 enum snd_soc_bias_level level) 453 453 { 454 454 struct wm8737_priv *wm8737 = snd_soc_component_get_drvdata(component); 455 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 455 456 int ret; 456 457 457 458 switch (level) { ··· 466 465 break; 467 466 468 467 case SND_SOC_BIAS_STANDBY: 469 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { 468 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) { 470 469 ret = regulator_bulk_enable(ARRAY_SIZE(wm8737->supplies), 471 470 wm8737->supplies); 472 471 if (ret != 0) { ··· 538 537 static int wm8737_probe(struct snd_soc_component *component) 539 538 { 540 539 struct wm8737_priv *wm8737 = snd_soc_component_get_drvdata(component); 540 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 541 541 int ret; 542 542 543 543 ret = regulator_bulk_enable(ARRAY_SIZE(wm8737->supplies), ··· 559 557 snd_soc_component_update_bits(component, WM8737_RIGHT_PGA_VOLUME, WM8737_RVU, 560 558 WM8737_RVU); 561 559 562 - snd_soc_component_force_bias_level(component, SND_SOC_BIAS_STANDBY); 560 + snd_soc_dapm_force_bias_level(dapm, SND_SOC_BIAS_STANDBY); 563 561 564 562 /* Bias level configuration will have done an extra enable */ 565 563 regulator_bulk_disable(ARRAY_SIZE(wm8737->supplies), wm8737->supplies);
+2 -1
sound/soc/codecs/wm8750.c
··· 621 621 static int wm8750_set_bias_level(struct snd_soc_component *component, 622 622 enum snd_soc_bias_level level) 623 623 { 624 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 624 625 u16 pwr_reg = snd_soc_component_read(component, WM8750_PWR1) & 0xfe3e; 625 626 626 627 switch (level) { ··· 632 631 case SND_SOC_BIAS_PREPARE: 633 632 break; 634 633 case SND_SOC_BIAS_STANDBY: 635 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { 634 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) { 636 635 snd_soc_component_cache_sync(component); 637 636 638 637 /* Set VMID to 5k */
+2 -1
sound/soc/codecs/wm8753.c
··· 1331 1331 enum snd_soc_bias_level level) 1332 1332 { 1333 1333 struct wm8753_priv *wm8753 = snd_soc_component_get_drvdata(component); 1334 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1334 1335 u16 pwr_reg = snd_soc_component_read(component, WM8753_PWR1) & 0xfe3e; 1335 1336 1336 1337 switch (level) { ··· 1344 1343 flush_delayed_work(&wm8753->charge_work); 1345 1344 break; 1346 1345 case SND_SOC_BIAS_STANDBY: 1347 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { 1346 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) { 1348 1347 /* set vmid to 5k for quick power up */ 1349 1348 snd_soc_component_write(component, WM8753_PWR1, pwr_reg | 0x01c1); 1350 1349 schedule_delayed_work(&wm8753->charge_work,
+2 -1
sound/soc/codecs/wm8770.c
··· 497 497 enum snd_soc_bias_level level) 498 498 { 499 499 int ret; 500 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 500 501 struct wm8770_priv *wm8770; 501 502 502 503 wm8770 = snd_soc_component_get_drvdata(component); ··· 508 507 case SND_SOC_BIAS_PREPARE: 509 508 break; 510 509 case SND_SOC_BIAS_STANDBY: 511 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { 510 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) { 512 511 ret = regulator_bulk_enable(ARRAY_SIZE(wm8770->supplies), 513 512 wm8770->supplies); 514 513 if (ret) {
+2 -1
sound/soc/codecs/wm8776.c
··· 334 334 enum snd_soc_bias_level level) 335 335 { 336 336 struct wm8776_priv *wm8776 = snd_soc_component_get_drvdata(component); 337 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 337 338 338 339 switch (level) { 339 340 case SND_SOC_BIAS_ON: ··· 342 341 case SND_SOC_BIAS_PREPARE: 343 342 break; 344 343 case SND_SOC_BIAS_STANDBY: 345 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { 344 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) { 346 345 regcache_sync(wm8776->regmap); 347 346 348 347 /* Disable the global powerdown; DAPM does the rest */
+2 -2
sound/soc/codecs/wm8804.c
··· 157 157 static int txsrc_put(struct snd_kcontrol *kcontrol, 158 158 struct snd_ctl_elem_value *ucontrol) 159 159 { 160 - struct snd_soc_component *component = snd_soc_dapm_kcontrol_component(kcontrol); 161 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 160 + struct snd_soc_component *component = snd_soc_dapm_kcontrol_to_component(kcontrol); 161 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 162 162 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; 163 163 unsigned int val = ucontrol->value.enumerated.item[0] << e->shift_l; 164 164 unsigned int mask = 1 << e->shift_l;
+8 -4
sound/soc/codecs/wm8900.c
··· 1023 1023 static int wm8900_set_bias_level(struct snd_soc_component *component, 1024 1024 enum snd_soc_bias_level level) 1025 1025 { 1026 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1026 1027 u16 reg; 1027 1028 1028 1029 switch (level) { ··· 1042 1041 1043 1042 case SND_SOC_BIAS_STANDBY: 1044 1043 /* Charge capacitors if initial power up */ 1045 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { 1044 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) { 1046 1045 /* STARTUP_BIAS_ENA on */ 1047 1046 snd_soc_component_write(component, WM8900_REG_POWER1, 1048 1047 WM8900_REG_POWER1_STARTUP_BIAS_ENA); ··· 1116 1115 static int wm8900_suspend(struct snd_soc_component *component) 1117 1116 { 1118 1117 struct wm8900_priv *wm8900 = snd_soc_component_get_drvdata(component); 1118 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1119 1119 int fll_out = wm8900->fll_out; 1120 1120 int fll_in = wm8900->fll_in; 1121 1121 int ret; ··· 1131 1129 wm8900->fll_out = fll_out; 1132 1130 wm8900->fll_in = fll_in; 1133 1131 1134 - snd_soc_component_force_bias_level(component, SND_SOC_BIAS_OFF); 1132 + snd_soc_dapm_force_bias_level(dapm, SND_SOC_BIAS_OFF); 1135 1133 1136 1134 return 0; 1137 1135 } ··· 1139 1137 static int wm8900_resume(struct snd_soc_component *component) 1140 1138 { 1141 1139 struct wm8900_priv *wm8900 = snd_soc_component_get_drvdata(component); 1140 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1142 1141 int ret; 1143 1142 1144 1143 wm8900_reset(component); ··· 1150 1147 return ret; 1151 1148 } 1152 1149 1153 - snd_soc_component_force_bias_level(component, SND_SOC_BIAS_STANDBY); 1150 + snd_soc_dapm_force_bias_level(dapm, SND_SOC_BIAS_STANDBY); 1154 1151 1155 1152 /* Restart the FLL? */ 1156 1153 if (wm8900->fll_out) { ··· 1172 1169 1173 1170 static int wm8900_probe(struct snd_soc_component *component) 1174 1171 { 1172 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1175 1173 int reg; 1176 1174 1177 1175 reg = snd_soc_component_read(component, WM8900_REG_ID); ··· 1184 1180 wm8900_reset(component); 1185 1181 1186 1182 /* Turn the chip on */ 1187 - snd_soc_component_force_bias_level(component, SND_SOC_BIAS_STANDBY); 1183 + snd_soc_dapm_force_bias_level(dapm, SND_SOC_BIAS_STANDBY); 1188 1184 1189 1185 /* Latch the volume update bits */ 1190 1186 snd_soc_component_update_bits(component, WM8900_REG_LINVOL, 0x100, 0x100);
+4 -2
sound/soc/codecs/wm8903.c
··· 369 369 static int wm8903_class_w_put(struct snd_kcontrol *kcontrol, 370 370 struct snd_ctl_elem_value *ucontrol) 371 371 { 372 - struct snd_soc_component *component = snd_soc_dapm_kcontrol_component(kcontrol); 372 + struct snd_soc_component *component = snd_soc_dapm_kcontrol_to_component(kcontrol); 373 373 struct wm8903_priv *wm8903 = snd_soc_component_get_drvdata(component); 374 374 u16 reg; 375 375 int ret; ··· 1099 1099 static int wm8903_set_bias_level(struct snd_soc_component *component, 1100 1100 enum snd_soc_bias_level level) 1101 1101 { 1102 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1103 + 1102 1104 switch (level) { 1103 1105 case SND_SOC_BIAS_ON: 1104 1106 break; ··· 1112 1110 break; 1113 1111 1114 1112 case SND_SOC_BIAS_STANDBY: 1115 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { 1113 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) { 1116 1114 snd_soc_component_update_bits(component, WM8903_BIAS_CONTROL_0, 1117 1115 WM8903_POBCTRL | WM8903_ISEL_MASK | 1118 1116 WM8903_STARTUP_BIAS_ENA |
+5 -4
sound/soc/codecs/wm8904.c
··· 1246 1246 static int wm8904_add_widgets(struct snd_soc_component *component) 1247 1247 { 1248 1248 struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); 1249 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 1249 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1250 1250 1251 1251 snd_soc_dapm_new_controls(dapm, wm8904_core_dapm_widgets, 1252 1252 ARRAY_SIZE(wm8904_core_dapm_widgets)); ··· 1934 1934 enum snd_soc_bias_level level) 1935 1935 { 1936 1936 struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); 1937 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1937 1938 int ret; 1938 1939 1939 1940 switch (level) { ··· 1953 1952 break; 1954 1953 1955 1954 case SND_SOC_BIAS_STANDBY: 1956 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { 1955 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) { 1957 1956 ret = regulator_bulk_enable(ARRAY_SIZE(wm8904->supplies), 1958 1957 wm8904->supplies); 1959 1958 if (ret != 0) { ··· 2115 2114 2116 2115 static void wm8904_handle_dmic_pdata(struct snd_soc_component *component) 2117 2116 { 2118 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 2117 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 2119 2118 struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); 2120 2119 struct wm8904_pdata *pdata = wm8904->pdata; 2121 2120 unsigned int dmic_src; ··· 2162 2161 2163 2162 static void wm8904_handle_pdata(struct snd_soc_component *component) 2164 2163 { 2165 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 2164 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 2166 2165 struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); 2167 2166 struct wm8904_pdata *pdata = wm8904->pdata; 2168 2167 int ret, i;
+4 -2
sound/soc/codecs/wm8940.c
··· 476 476 enum snd_soc_bias_level level) 477 477 { 478 478 struct wm8940_priv *wm8940 = snd_soc_component_get_drvdata(component); 479 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 479 480 u16 val; 480 481 u16 pwr_reg = snd_soc_component_read(component, WM8940_POWER1) & 0x1F0; 481 482 int ret = 0; ··· 499 498 ret = snd_soc_component_write(component, WM8940_POWER1, pwr_reg | 0x1); 500 499 break; 501 500 case SND_SOC_BIAS_STANDBY: 502 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { 501 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) { 503 502 ret = regcache_sync(wm8940->regmap); 504 503 if (ret < 0) { 505 504 dev_err(component->dev, "Failed to sync cache: %d\n", ret); ··· 762 761 763 762 static int wm8940_probe(struct snd_soc_component *component) 764 763 { 764 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 765 765 struct wm8940_setup_data *pdata = component->dev->platform_data; 766 766 int ret; 767 767 u16 reg; ··· 784 782 return ret; 785 783 } 786 784 787 - snd_soc_component_force_bias_level(component, SND_SOC_BIAS_STANDBY); 785 + snd_soc_dapm_force_bias_level(dapm, SND_SOC_BIAS_STANDBY); 788 786 789 787 ret = snd_soc_component_write(component, WM8940_POWER1, 0x180); 790 788 if (ret < 0)
+4 -2
sound/soc/codecs/wm8955.c
··· 764 764 enum snd_soc_bias_level level) 765 765 { 766 766 struct wm8955_priv *wm8955 = snd_soc_component_get_drvdata(component); 767 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 767 768 int ret; 768 769 769 770 switch (level) { ··· 784 783 break; 785 784 786 785 case SND_SOC_BIAS_STANDBY: 787 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { 786 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) { 788 787 ret = regulator_bulk_enable(ARRAY_SIZE(wm8955->supplies), 789 788 wm8955->supplies); 790 789 if (ret != 0) { ··· 867 866 868 867 static int wm8955_probe(struct snd_soc_component *component) 869 868 { 869 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 870 870 struct wm8955_priv *wm8955 = snd_soc_component_get_drvdata(component); 871 871 struct wm8955_pdata *pdata = dev_get_platdata(component->dev); 872 872 int ret, i; ··· 929 927 WM8955_DMEN, WM8955_DMEN); 930 928 } 931 929 932 - snd_soc_component_force_bias_level(component, SND_SOC_BIAS_STANDBY); 930 + snd_soc_dapm_force_bias_level(dapm, SND_SOC_BIAS_STANDBY); 933 931 934 932 /* Bias level configuration will have done an extra enable */ 935 933 regulator_bulk_disable(ARRAY_SIZE(wm8955->supplies), wm8955->supplies);
+7 -5
sound/soc/codecs/wm8960.c
··· 488 488 { 489 489 struct wm8960_priv *wm8960 = snd_soc_component_get_drvdata(component); 490 490 struct wm8960_data *pdata = &wm8960->pdata; 491 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 491 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 492 492 struct snd_soc_dapm_widget *w; 493 493 494 494 snd_soc_dapm_new_controls(dapm, wm8960_dapm_widgets, ··· 913 913 enum snd_soc_bias_level level) 914 914 { 915 915 struct wm8960_priv *wm8960 = snd_soc_component_get_drvdata(component); 916 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 916 917 u16 pm2 = snd_soc_component_read(component, WM8960_POWER2); 917 918 int ret; 918 919 ktime_t tout; ··· 923 922 break; 924 923 925 924 case SND_SOC_BIAS_PREPARE: 926 - switch (snd_soc_component_get_bias_level(component)) { 925 + switch (snd_soc_dapm_get_bias_level(dapm)) { 927 926 case SND_SOC_BIAS_STANDBY: 928 927 if (!IS_ERR(wm8960->mclk)) { 929 928 ret = clk_prepare_enable(wm8960->mclk); ··· 962 961 break; 963 962 964 963 case SND_SOC_BIAS_STANDBY: 965 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { 964 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) { 966 965 /* ensure discharge is complete */ 967 966 tout = WM8960_DSCH_TOUT - ktime_ms_delta(ktime_get(), wm8960->dsch_start); 968 967 if (tout > 0) ··· 1010 1009 enum snd_soc_bias_level level) 1011 1010 { 1012 1011 struct wm8960_priv *wm8960 = snd_soc_component_get_drvdata(component); 1012 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1013 1013 u16 pm2 = snd_soc_component_read(component, WM8960_POWER2); 1014 1014 int reg, ret; 1015 1015 ··· 1019 1017 break; 1020 1018 1021 1019 case SND_SOC_BIAS_PREPARE: 1022 - switch (snd_soc_component_get_bias_level(component)) { 1020 + switch (snd_soc_dapm_get_bias_level(dapm)) { 1023 1021 case SND_SOC_BIAS_STANDBY: 1024 1022 /* Enable anti pop mode */ 1025 1023 snd_soc_component_update_bits(component, WM8960_APOP1, ··· 1102 1100 break; 1103 1101 1104 1102 case SND_SOC_BIAS_STANDBY: 1105 - switch (snd_soc_component_get_bias_level(component)) { 1103 + switch (snd_soc_dapm_get_bias_level(dapm)) { 1106 1104 case SND_SOC_BIAS_PREPARE: 1107 1105 /* Disable HP discharge */ 1108 1106 snd_soc_component_update_bits(component, WM8960_APOP2,
+3 -2
sound/soc/codecs/wm8961.c
··· 743 743 static int wm8961_set_bias_level(struct snd_soc_component *component, 744 744 enum snd_soc_bias_level level) 745 745 { 746 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 746 747 u16 reg; 747 748 748 749 /* This is all slightly unusual since we have no bypass paths ··· 756 755 break; 757 756 758 757 case SND_SOC_BIAS_PREPARE: 759 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_STANDBY) { 758 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_STANDBY) { 760 759 /* Enable bias generation */ 761 760 reg = snd_soc_component_read(component, WM8961_ANTI_POP); 762 761 reg |= WM8961_BUFIOEN | WM8961_BUFDCOPEN; ··· 771 770 break; 772 771 773 772 case SND_SOC_BIAS_STANDBY: 774 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_PREPARE) { 773 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_PREPARE) { 775 774 /* VREF off */ 776 775 reg = snd_soc_component_read(component, WM8961_PWR_MGMT_1); 777 776 reg &= ~WM8961_VREF;
+13 -9
sound/soc/codecs/wm8962.c
··· 2419 2419 { 2420 2420 struct wm8962_priv *wm8962 = snd_soc_component_get_drvdata(component); 2421 2421 struct wm8962_pdata *pdata = &wm8962->pdata; 2422 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 2422 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 2423 2423 2424 2424 snd_soc_add_component_controls(component, wm8962_snd_controls, 2425 2425 ARRAY_SIZE(wm8962_snd_controls)); ··· 2466 2466 2467 2467 static void wm8962_configure_bclk(struct snd_soc_component *component) 2468 2468 { 2469 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 2469 2470 struct wm8962_priv *wm8962 = snd_soc_component_get_drvdata(component); 2470 2471 int best, min_diff, diff; 2471 2472 int dspclk, i; ··· 2506 2505 * So we here provisionally enable it and then disable it afterward 2507 2506 * if current bias_level hasn't reached SND_SOC_BIAS_ON. 2508 2507 */ 2509 - if (snd_soc_component_get_bias_level(component) != SND_SOC_BIAS_ON) 2508 + if (snd_soc_dapm_get_bias_level(dapm) != SND_SOC_BIAS_ON) 2510 2509 snd_soc_component_update_bits(component, WM8962_CLOCKING2, 2511 2510 WM8962_SYSCLK_ENA_MASK, WM8962_SYSCLK_ENA); 2512 2511 ··· 2520 2519 usleep_range(500, 1000); 2521 2520 dspclk = snd_soc_component_read(component, WM8962_CLOCKING1); 2522 2521 2523 - if (snd_soc_component_get_bias_level(component) != SND_SOC_BIAS_ON) 2522 + if (snd_soc_dapm_get_bias_level(dapm) != SND_SOC_BIAS_ON) 2524 2523 snd_soc_component_update_bits(component, WM8962_CLOCKING2, 2525 2524 WM8962_SYSCLK_ENA_MASK, 0); 2526 2525 ··· 2580 2579 static int wm8962_set_bias_level(struct snd_soc_component *component, 2581 2580 enum snd_soc_bias_level level) 2582 2581 { 2582 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 2583 + 2583 2584 switch (level) { 2584 2585 case SND_SOC_BIAS_ON: 2585 2586 break; ··· 2599 2596 snd_soc_component_update_bits(component, WM8962_PWR_MGMT_1, 2600 2597 WM8962_VMID_SEL_MASK, 0x100); 2601 2598 2602 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) 2599 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) 2603 2600 msleep(100); 2604 2601 break; 2605 2602 ··· 2632 2629 struct snd_soc_dai *dai) 2633 2630 { 2634 2631 struct snd_soc_component *component = dai->component; 2632 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 2635 2633 struct wm8962_priv *wm8962 = snd_soc_component_get_drvdata(component); 2636 2634 int i; 2637 2635 int aif0 = 0; ··· 2683 2679 dev_dbg(component->dev, "hw_params set BCLK %dHz LRCLK %dHz\n", 2684 2680 wm8962->bclk, wm8962->lrclk); 2685 2681 2686 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_ON) 2682 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_ON) 2687 2683 wm8962_configure_bclk(component); 2688 2684 2689 2685 return 0; ··· 3197 3193 int wm8962_mic_detect(struct snd_soc_component *component, struct snd_soc_jack *jack) 3198 3194 { 3199 3195 struct wm8962_priv *wm8962 = snd_soc_component_get_drvdata(component); 3200 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 3196 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 3201 3197 int irq_mask, enable; 3202 3198 3203 3199 wm8962->jack = jack; ··· 3243 3239 struct wm8962_priv *wm8962 = 3244 3240 container_of(work, struct wm8962_priv, beep_work); 3245 3241 struct snd_soc_component *component = wm8962->component; 3246 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 3242 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 3247 3243 int i; 3248 3244 int reg = 0; 3249 3245 int best = 0; ··· 3492 3488 3493 3489 static int wm8962_probe(struct snd_soc_component *component) 3494 3490 { 3495 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 3491 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 3496 3492 int ret; 3497 3493 struct wm8962_priv *wm8962 = snd_soc_component_get_drvdata(component); 3498 3494 int i; ··· 3547 3543 } 3548 3544 if (!dmicclk || !dmicdat) { 3549 3545 dev_dbg(component->dev, "DMIC not in use, disabling\n"); 3550 - snd_soc_dapm_nc_pin(dapm, "DMICDAT"); 3546 + snd_soc_dapm_disable_pin(dapm, "DMICDAT"); 3551 3547 } 3552 3548 if (dmicclk != dmicdat) 3553 3549 dev_warn(component->dev, "DMIC GPIOs partially configured\n");
+2 -1
sound/soc/codecs/wm8971.c
··· 561 561 enum snd_soc_bias_level level) 562 562 { 563 563 struct wm8971_priv *wm8971 = snd_soc_component_get_drvdata(component); 564 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 564 565 u16 pwr_reg = snd_soc_component_read(component, WM8971_PWR1) & 0xfe3e; 565 566 566 567 switch (level) { ··· 574 573 flush_delayed_work(&wm8971->charge_work); 575 574 break; 576 575 case SND_SOC_BIAS_STANDBY: 577 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { 576 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) { 578 577 snd_soc_component_cache_sync(component); 579 578 /* charge output caps - set vmid to 5k for quick power up */ 580 579 snd_soc_component_write(component, WM8971_PWR1, pwr_reg | 0x01c0);
+2 -1
sound/soc/codecs/wm8974.c
··· 583 583 static int wm8974_set_bias_level(struct snd_soc_component *component, 584 584 enum snd_soc_bias_level level) 585 585 { 586 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 586 587 u16 power1 = snd_soc_component_read(component, WM8974_POWER1) & ~0x3; 587 588 588 589 switch (level) { ··· 596 595 case SND_SOC_BIAS_STANDBY: 597 596 power1 |= WM8974_POWER1_BIASEN | WM8974_POWER1_BUFIOEN; 598 597 599 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { 598 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) { 600 599 regcache_sync(dev_get_regmap(component->dev, NULL)); 601 600 602 601 /* Initial cap charge at VMID 5k */
+6 -3
sound/soc/codecs/wm8978.c
··· 853 853 static int wm8978_set_bias_level(struct snd_soc_component *component, 854 854 enum snd_soc_bias_level level) 855 855 { 856 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 856 857 u16 power1 = snd_soc_component_read(component, WM8978_POWER_MANAGEMENT_1) & ~3; 857 858 858 859 switch (level) { ··· 866 865 /* bit 3: enable bias, bit 2: enable I/O tie off buffer */ 867 866 power1 |= 0xc; 868 867 869 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { 868 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) { 870 869 /* Initial cap charge at VMID 5k */ 871 870 snd_soc_component_write(component, WM8978_POWER_MANAGEMENT_1, 872 871 power1 | 0x3); ··· 925 924 static int wm8978_suspend(struct snd_soc_component *component) 926 925 { 927 926 struct wm8978_priv *wm8978 = snd_soc_component_get_drvdata(component); 927 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 928 928 929 - snd_soc_component_force_bias_level(component, SND_SOC_BIAS_OFF); 929 + snd_soc_dapm_force_bias_level(dapm, SND_SOC_BIAS_OFF); 930 930 /* Also switch PLL off */ 931 931 snd_soc_component_write(component, WM8978_POWER_MANAGEMENT_1, 0); 932 932 ··· 939 937 static int wm8978_resume(struct snd_soc_component *component) 940 938 { 941 939 struct wm8978_priv *wm8978 = snd_soc_component_get_drvdata(component); 940 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 942 941 943 942 /* Sync reg_cache with the hardware */ 944 943 regcache_sync(wm8978->regmap); 945 944 946 - snd_soc_component_force_bias_level(component, SND_SOC_BIAS_STANDBY); 945 + snd_soc_dapm_force_bias_level(dapm, SND_SOC_BIAS_STANDBY); 947 946 948 947 if (wm8978->f_pllout) 949 948 /* Switch PLL on */
+2 -1
sound/soc/codecs/wm8983.c
··· 848 848 enum snd_soc_bias_level level) 849 849 { 850 850 struct wm8983_priv *wm8983 = snd_soc_component_get_drvdata(component); 851 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 851 852 int ret; 852 853 853 854 switch (level) { ··· 860 859 1 << WM8983_VMIDSEL_SHIFT); 861 860 break; 862 861 case SND_SOC_BIAS_STANDBY: 863 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { 862 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) { 864 863 ret = regcache_sync(wm8983->regmap); 865 864 if (ret < 0) { 866 865 dev_err(component->dev, "Failed to sync cache: %d\n", ret);
+3 -2
sound/soc/codecs/wm8985.c
··· 564 564 static int wm8985_add_widgets(struct snd_soc_component *component) 565 565 { 566 566 struct wm8985_priv *wm8985 = snd_soc_component_get_drvdata(component); 567 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 567 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 568 568 569 569 switch (wm8985->dev_type) { 570 570 case WM8758: ··· 948 948 enum snd_soc_bias_level level) 949 949 { 950 950 int ret; 951 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 951 952 struct wm8985_priv *wm8985; 952 953 953 954 wm8985 = snd_soc_component_get_drvdata(component); ··· 961 960 1 << WM8985_VMIDSEL_SHIFT); 962 961 break; 963 962 case SND_SOC_BIAS_STANDBY: 964 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { 963 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) { 965 964 ret = regulator_bulk_enable(ARRAY_SIZE(wm8985->supplies), 966 965 wm8985->supplies); 967 966 if (ret) {
+2 -1
sound/soc/codecs/wm8988.c
··· 723 723 enum snd_soc_bias_level level) 724 724 { 725 725 struct wm8988_priv *wm8988 = snd_soc_component_get_drvdata(component); 726 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 726 727 u16 pwr_reg = snd_soc_component_read(component, WM8988_PWR1) & ~0x1c1; 727 728 728 729 switch (level) { ··· 736 735 break; 737 736 738 737 case SND_SOC_BIAS_STANDBY: 739 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { 738 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) { 740 739 regcache_sync(wm8988->regmap); 741 740 742 741 /* VREF, VMID=2x5k */
+5 -2
sound/soc/codecs/wm8990.c
··· 1017 1017 enum snd_soc_bias_level level) 1018 1018 { 1019 1019 struct wm8990_priv *wm8990 = snd_soc_component_get_drvdata(component); 1020 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1020 1021 int ret; 1021 1022 1022 1023 switch (level) { ··· 1031 1030 break; 1032 1031 1033 1032 case SND_SOC_BIAS_STANDBY: 1034 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { 1033 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) { 1035 1034 ret = regcache_sync(wm8990->regmap); 1036 1035 if (ret < 0) { 1037 1036 dev_err(component->dev, "Failed to sync cache: %d\n", ret); ··· 1185 1184 */ 1186 1185 static int wm8990_probe(struct snd_soc_component *component) 1187 1186 { 1187 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1188 + 1188 1189 wm8990_reset(component); 1189 1190 1190 1191 /* charge output caps */ 1191 - snd_soc_component_force_bias_level(component, SND_SOC_BIAS_STANDBY); 1192 + snd_soc_dapm_force_bias_level(dapm, SND_SOC_BIAS_STANDBY); 1192 1193 1193 1194 snd_soc_component_update_bits(component, WM8990_AUDIO_INTERFACE_4, 1194 1195 WM8990_ALRCGPIO1, WM8990_ALRCGPIO1);
+2 -1
sound/soc/codecs/wm8991.c
··· 1081 1081 enum snd_soc_bias_level level) 1082 1082 { 1083 1083 struct wm8991_priv *wm8991 = snd_soc_component_get_drvdata(component); 1084 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1084 1085 u16 val; 1085 1086 1086 1087 switch (level) { ··· 1096 1095 break; 1097 1096 1098 1097 case SND_SOC_BIAS_STANDBY: 1099 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { 1098 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) { 1100 1099 regcache_sync(wm8991->regmap); 1101 1100 /* Enable all output discharge bits */ 1102 1101 snd_soc_component_write(component, WM8991_ANTIPOP1, WM8991_DIS_LLINE |
+8 -5
sound/soc/codecs/wm8993.c
··· 973 973 enum snd_soc_bias_level level) 974 974 { 975 975 struct wm8993_priv *wm8993 = snd_soc_component_get_drvdata(component); 976 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 976 977 int ret; 977 978 978 979 wm_hubs_set_bias_level(component, level); ··· 989 988 break; 990 989 991 990 case SND_SOC_BIAS_STANDBY: 992 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { 991 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) { 993 992 ret = regulator_bulk_enable(ARRAY_SIZE(wm8993->supplies), 994 993 wm8993->supplies); 995 994 if (ret != 0) ··· 1483 1482 static int wm8993_probe(struct snd_soc_component *component) 1484 1483 { 1485 1484 struct wm8993_priv *wm8993 = snd_soc_component_get_drvdata(component); 1486 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 1485 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1487 1486 1488 1487 wm8993->hubs_data.hp_startup_mode = 1; 1489 1488 wm8993->hubs_data.dcs_codes_l = -2; ··· 1537 1536 * VMID as an output and can disable it. 1538 1537 */ 1539 1538 if (wm8993->pdata.lineout1_diff && wm8993->pdata.lineout2_diff) 1540 - dapm->idle_bias = false; 1539 + snd_soc_dapm_set_idle_bias(dapm, false); 1541 1540 1542 1541 return 0; 1543 1542 ··· 1547 1546 static int wm8993_suspend(struct snd_soc_component *component) 1548 1547 { 1549 1548 struct wm8993_priv *wm8993 = snd_soc_component_get_drvdata(component); 1549 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1550 1550 int fll_fout = wm8993->fll_fout; 1551 1551 int fll_fref = wm8993->fll_fref; 1552 1552 int ret; ··· 1562 1560 wm8993->fll_fout = fll_fout; 1563 1561 wm8993->fll_fref = fll_fref; 1564 1562 1565 - snd_soc_component_force_bias_level(component, SND_SOC_BIAS_OFF); 1563 + snd_soc_dapm_force_bias_level(dapm, SND_SOC_BIAS_OFF); 1566 1564 1567 1565 return 0; 1568 1566 } ··· 1570 1568 static int wm8993_resume(struct snd_soc_component *component) 1571 1569 { 1572 1570 struct wm8993_priv *wm8993 = snd_soc_component_get_drvdata(component); 1571 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1573 1572 int ret; 1574 1573 1575 - snd_soc_component_force_bias_level(component, SND_SOC_BIAS_STANDBY); 1574 + snd_soc_dapm_force_bias_level(dapm, SND_SOC_BIAS_STANDBY); 1576 1575 1577 1576 /* Restart the FLL? */ 1578 1577 if (wm8993->fll_fout) {
+19 -17
sound/soc/codecs/wm8994.c
··· 214 214 215 215 static int configure_clock(struct snd_soc_component *component) 216 216 { 217 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 217 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 218 218 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); 219 219 int change, new; 220 220 ··· 1515 1515 static int wm8994_put_class_w(struct snd_kcontrol *kcontrol, 1516 1516 struct snd_ctl_elem_value *ucontrol) 1517 1517 { 1518 - struct snd_soc_component *component = snd_soc_dapm_kcontrol_component(kcontrol); 1518 + struct snd_soc_component *component = snd_soc_dapm_kcontrol_to_component(kcontrol); 1519 1519 int ret; 1520 1520 1521 1521 ret = snd_soc_dapm_put_volsw(kcontrol, ucontrol); ··· 2615 2615 enum snd_soc_bias_level level) 2616 2616 { 2617 2617 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); 2618 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 2618 2619 struct wm8994 *control = wm8994->wm8994; 2619 2620 2620 2621 wm_hubs_set_bias_level(component, level); ··· 2638 2637 break; 2639 2638 } 2640 2639 2641 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_STANDBY) 2640 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_STANDBY) 2642 2641 active_reference(component); 2643 2642 break; 2644 2643 2645 2644 case SND_SOC_BIAS_STANDBY: 2646 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { 2645 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) { 2647 2646 switch (control->type) { 2648 2647 case WM8958: 2649 2648 if (control->revision == 0) { ··· 2667 2666 WM8994_LINEOUT2_DISCH); 2668 2667 } 2669 2668 2670 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_PREPARE) 2669 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_PREPARE) 2671 2670 active_dereference(component); 2672 2671 2673 2672 /* MICBIAS into bypass mode on newer devices */ ··· 2687 2686 break; 2688 2687 2689 2688 case SND_SOC_BIAS_OFF: 2690 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_STANDBY) 2689 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_STANDBY) 2691 2690 wm8994->cur_fw = NULL; 2692 2691 break; 2693 2692 } ··· 2698 2697 int wm8994_vmid_mode(struct snd_soc_component *component, enum wm8994_vmid_mode mode) 2699 2698 { 2700 2699 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); 2701 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 2700 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 2702 2701 2703 2702 switch (mode) { 2704 2703 case WM8994_VMID_NORMAL: ··· 3300 3299 static int wm8994_component_suspend(struct snd_soc_component *component) 3301 3300 { 3302 3301 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); 3302 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 3303 3303 int i, ret; 3304 3304 3305 3305 for (i = 0; i < ARRAY_SIZE(wm8994->fll); i++) { ··· 3312 3310 i + 1, ret); 3313 3311 } 3314 3312 3315 - snd_soc_component_force_bias_level(component, SND_SOC_BIAS_OFF); 3313 + snd_soc_dapm_force_bias_level(dapm, SND_SOC_BIAS_OFF); 3316 3314 3317 3315 return 0; 3318 3316 } ··· 3505 3503 int wm8994_mic_detect(struct snd_soc_component *component, struct snd_soc_jack *jack, 3506 3504 int micbias) 3507 3505 { 3508 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 3506 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 3509 3507 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); 3510 3508 struct wm8994_micdet *micdet; 3511 3509 struct wm8994 *control = wm8994->wm8994; ··· 3655 3653 /* Should be called with accdet_lock held */ 3656 3654 static void wm1811_micd_stop(struct snd_soc_component *component) 3657 3655 { 3658 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 3656 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 3659 3657 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); 3660 3658 3661 3659 if (!wm8994->jackdet) ··· 3775 3773 mic_work.work); 3776 3774 struct wm8994 *control = wm8994->wm8994; 3777 3775 struct snd_soc_component *component = wm8994->hubs.component; 3778 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 3776 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 3779 3777 3780 3778 pm_runtime_get_sync(component->dev); 3781 3779 ··· 3814 3812 struct wm8994_priv *wm8994 = data; 3815 3813 struct wm8994 *control = wm8994->wm8994; 3816 3814 struct snd_soc_component *component = wm8994->hubs.component; 3817 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 3815 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 3818 3816 int reg, delay; 3819 3817 bool present; 3820 3818 ··· 3930 3928 wm1811_micdet_cb det_cb, void *det_cb_data, 3931 3929 wm1811_mic_id_cb id_cb, void *id_cb_data) 3932 3930 { 3933 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 3931 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 3934 3932 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); 3935 3933 struct wm8994 *control = wm8994->wm8994; 3936 3934 u16 micd_lvl_sel; ··· 3982 3980 snd_soc_component_update_bits(component, WM8958_MIC_DETECT_2, 3983 3981 WM8958_MICD_LVL_SEL_MASK, micd_lvl_sel); 3984 3982 3985 - WARN_ON(snd_soc_component_get_bias_level(component) > SND_SOC_BIAS_STANDBY); 3983 + WARN_ON(snd_soc_dapm_get_bias_level(dapm) > SND_SOC_BIAS_STANDBY); 3986 3984 3987 3985 /* 3988 3986 * If we can use jack detection start off with that, ··· 4150 4148 4151 4149 static int wm8994_component_probe(struct snd_soc_component *component) 4152 4150 { 4153 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 4151 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 4154 4152 struct wm8994 *control = dev_get_drvdata(component->dev->parent); 4155 4153 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); 4156 4154 unsigned int reg; ··· 4185 4183 wm8994->micdet_irq = control->pdata.micdet_irq; 4186 4184 4187 4185 /* By default use idle_bias false, will override for WM8994 */ 4188 - dapm->idle_bias = false; 4186 + snd_soc_dapm_set_idle_bias(dapm, false); 4189 4187 4190 4188 /* Set revision-specific configuration */ 4191 4189 switch (control->type) { ··· 4193 4191 /* Single ended line outputs should have VMID on. */ 4194 4192 if (!control->pdata.lineout1_diff || 4195 4193 !control->pdata.lineout2_diff) 4196 - dapm->idle_bias = true; 4194 + snd_soc_dapm_set_idle_bias(dapm, true); 4197 4195 4198 4196 switch (control->revision) { 4199 4197 case 2:
+4 -3
sound/soc/codecs/wm8995.c
··· 547 547 static int wm8995_put_class_w(struct snd_kcontrol *kcontrol, 548 548 struct snd_ctl_elem_value *ucontrol) 549 549 { 550 - struct snd_soc_component *component = snd_soc_dapm_kcontrol_component(kcontrol); 550 + struct snd_soc_component *component = snd_soc_dapm_kcontrol_to_component(kcontrol); 551 551 int ret; 552 552 553 553 ret = snd_soc_dapm_put_volsw(kcontrol, ucontrol); ··· 718 718 719 719 static int configure_clock(struct snd_soc_component *component) 720 720 { 721 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 721 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 722 722 struct wm8995_priv *wm8995; 723 723 int change, new; 724 724 ··· 1955 1955 static int wm8995_set_bias_level(struct snd_soc_component *component, 1956 1956 enum snd_soc_bias_level level) 1957 1957 { 1958 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1958 1959 struct wm8995_priv *wm8995; 1959 1960 int ret; 1960 1961 ··· 1965 1964 case SND_SOC_BIAS_PREPARE: 1966 1965 break; 1967 1966 case SND_SOC_BIAS_STANDBY: 1968 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { 1967 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) { 1969 1968 ret = regulator_bulk_enable(ARRAY_SIZE(wm8995->supplies), 1970 1969 wm8995->supplies); 1971 1970 if (ret)
+5 -4
sound/soc/codecs/wm8996.c
··· 1572 1572 enum snd_soc_bias_level level) 1573 1573 { 1574 1574 struct wm8996_priv *wm8996 = snd_soc_component_get_drvdata(component); 1575 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1575 1576 int ret; 1576 1577 1577 1578 switch (level) { ··· 1587 1586 break; 1588 1587 1589 1588 case SND_SOC_BIAS_STANDBY: 1590 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { 1589 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) { 1591 1590 ret = regulator_bulk_enable(ARRAY_SIZE(wm8996->supplies), 1592 1591 wm8996->supplies); 1593 1592 if (ret != 0) { ··· 2239 2238 wm8996_polarity_fn polarity_cb) 2240 2239 { 2241 2240 struct wm8996_priv *wm8996 = snd_soc_component_get_drvdata(component); 2242 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 2241 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 2243 2242 2244 2243 wm8996->jack = jack; 2245 2244 wm8996->detecting = true; ··· 2284 2283 2285 2284 static void wm8996_hpdet_irq(struct snd_soc_component *component) 2286 2285 { 2287 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 2286 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 2288 2287 struct wm8996_priv *wm8996 = snd_soc_component_get_drvdata(component); 2289 2288 int val, reg, report; 2290 2289 ··· 2344 2343 2345 2344 static void wm8996_hpdet_start(struct snd_soc_component *component) 2346 2345 { 2347 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 2346 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 2348 2347 2349 2348 /* Unclamp the output, we can't measure while we're shorting it */ 2350 2349 snd_soc_component_update_bits(component, WM8996_ANALOGUE_HP_1,
+2 -2
sound/soc/codecs/wm8997.c
··· 1055 1055 1056 1056 static int wm8997_component_probe(struct snd_soc_component *component) 1057 1057 { 1058 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 1058 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1059 1059 struct wm8997_priv *priv = snd_soc_component_get_drvdata(component); 1060 1060 struct arizona *arizona = priv->core.arizona; 1061 1061 int ret; ··· 1066 1066 if (ret < 0) 1067 1067 return ret; 1068 1068 1069 - snd_soc_component_disable_pin(component, "HAPTICS"); 1069 + snd_soc_dapm_disable_pin(dapm, "HAPTICS"); 1070 1070 1071 1071 priv->core.arizona->dapm = dapm; 1072 1072
+4 -4
sound/soc/codecs/wm8998.c
··· 101 101 static int wm8998_inmux_put(struct snd_kcontrol *kcontrol, 102 102 struct snd_ctl_elem_value *ucontrol) 103 103 { 104 - struct snd_soc_component *component = snd_soc_dapm_kcontrol_component(kcontrol); 105 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 104 + struct snd_soc_component *component = snd_soc_dapm_kcontrol_to_component(kcontrol); 105 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 106 106 struct wm8998_priv *wm8998 = snd_soc_component_get_drvdata(component); 107 107 struct arizona *arizona = wm8998->core.arizona; 108 108 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; ··· 1279 1279 static int wm8998_component_probe(struct snd_soc_component *component) 1280 1280 { 1281 1281 struct wm8998_priv *priv = snd_soc_component_get_drvdata(component); 1282 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 1282 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1283 1283 struct arizona *arizona = priv->core.arizona; 1284 1284 int ret; 1285 1285 ··· 1292 1292 1293 1293 arizona_init_gpio(component); 1294 1294 1295 - snd_soc_component_disable_pin(component, "HAPTICS"); 1295 + snd_soc_dapm_disable_pin(dapm, "HAPTICS"); 1296 1296 1297 1297 return 0; 1298 1298 }
+2 -1
sound/soc/codecs/wm9081.c
··· 816 816 enum snd_soc_bias_level level) 817 817 { 818 818 struct wm9081_priv *wm9081 = snd_soc_component_get_drvdata(component); 819 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 819 820 820 821 switch (level) { 821 822 case SND_SOC_BIAS_ON: ··· 834 833 835 834 case SND_SOC_BIAS_STANDBY: 836 835 /* Initial cold start */ 837 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { 836 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) { 838 837 regcache_cache_only(wm9081->regmap, false); 839 838 regcache_sync(wm9081->regmap); 840 839
+3 -2
sound/soc/codecs/wm9090.c
··· 409 409 static int wm9090_add_controls(struct snd_soc_component *component) 410 410 { 411 411 struct wm9090_priv *wm9090 = snd_soc_component_get_drvdata(component); 412 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 412 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 413 413 int i; 414 414 415 415 snd_soc_dapm_new_controls(dapm, wm9090_dapm_widgets, ··· 463 463 enum snd_soc_bias_level level) 464 464 { 465 465 struct wm9090_priv *wm9090 = snd_soc_component_get_drvdata(component); 466 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 466 467 467 468 switch (level) { 468 469 case SND_SOC_BIAS_ON: ··· 481 480 break; 482 481 483 482 case SND_SOC_BIAS_STANDBY: 484 - if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { 483 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) { 485 484 /* Restore the register cache */ 486 485 regcache_sync(wm9090->regmap); 487 486 }
+4 -3
sound/soc/codecs/wm9712.c
··· 215 215 static int wm9712_hp_mixer_put(struct snd_kcontrol *kcontrol, 216 216 struct snd_ctl_elem_value *ucontrol) 217 217 { 218 - struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_dapm(kcontrol); 218 + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol); 219 219 struct snd_soc_component *component = snd_soc_dapm_to_component(dapm); 220 220 struct wm9712_priv *wm9712 = snd_soc_component_get_drvdata(component); 221 221 unsigned int val = ucontrol->value.integer.value[0]; ··· 259 259 static int wm9712_hp_mixer_get(struct snd_kcontrol *kcontrol, 260 260 struct snd_ctl_elem_value *ucontrol) 261 261 { 262 - struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_dapm(kcontrol); 262 + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol); 263 263 struct snd_soc_component *component = snd_soc_dapm_to_component(dapm); 264 264 struct wm9712_priv *wm9712 = snd_soc_component_get_drvdata(component); 265 265 struct soc_mixer_control *mc = ··· 611 611 static int wm9712_soc_resume(struct snd_soc_component *component) 612 612 { 613 613 struct wm9712_priv *wm9712 = snd_soc_component_get_drvdata(component); 614 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 614 615 int ret; 615 616 616 617 ret = snd_ac97_reset(wm9712->ac97, true, WM9712_VENDOR_ID, ··· 619 618 if (ret < 0) 620 619 return ret; 621 620 622 - snd_soc_component_force_bias_level(component, SND_SOC_BIAS_STANDBY); 621 + snd_soc_dapm_force_bias_level(dapm, SND_SOC_BIAS_STANDBY); 623 622 624 623 if (ret == 0) 625 624 snd_soc_component_cache_sync(component);
+4 -3
sound/soc/codecs/wm9713.c
··· 224 224 static int wm9713_hp_mixer_put(struct snd_kcontrol *kcontrol, 225 225 struct snd_ctl_elem_value *ucontrol) 226 226 { 227 - struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_dapm(kcontrol); 227 + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol); 228 228 struct snd_soc_component *component = snd_soc_dapm_to_component(dapm); 229 229 struct wm9713_priv *wm9713 = snd_soc_component_get_drvdata(component); 230 230 unsigned int val = ucontrol->value.integer.value[0]; ··· 268 268 static int wm9713_hp_mixer_get(struct snd_kcontrol *kcontrol, 269 269 struct snd_ctl_elem_value *ucontrol) 270 270 { 271 - struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_dapm(kcontrol); 271 + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol); 272 272 struct snd_soc_component *component = snd_soc_dapm_to_component(dapm); 273 273 struct wm9713_priv *wm9713 = snd_soc_component_get_drvdata(component); 274 274 struct soc_mixer_control *mc = ··· 1176 1176 static int wm9713_soc_resume(struct snd_soc_component *component) 1177 1177 { 1178 1178 struct wm9713_priv *wm9713 = snd_soc_component_get_drvdata(component); 1179 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1179 1180 int ret; 1180 1181 1181 1182 ret = snd_ac97_reset(wm9713->ac97, true, WM9713_VENDOR_ID, ··· 1184 1183 if (ret < 0) 1185 1184 return ret; 1186 1185 1187 - snd_soc_component_force_bias_level(component, SND_SOC_BIAS_STANDBY); 1186 + snd_soc_dapm_force_bias_level(dapm, SND_SOC_BIAS_STANDBY); 1188 1187 1189 1188 /* do we need to re-start the PLL ? */ 1190 1189 if (wm9713->pll_in)
+6 -5
sound/soc/codecs/wm_adsp.c
··· 953 953 { 954 954 struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 955 955 struct wm_adsp *dsps = snd_soc_component_get_drvdata(component); 956 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 956 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 957 957 struct soc_mixer_control *mc = 958 958 (struct soc_mixer_control *)kcontrol->private_value; 959 959 struct wm_adsp *dsp = &dsps[mc->shift - 1]; ··· 965 965 snprintf(preload, ARRAY_SIZE(preload), "%s Preload", dsp->cs_dsp.name); 966 966 967 967 if (ucontrol->value.integer.value[0] || dsp->toggle_preload) 968 - snd_soc_component_force_enable_pin(component, preload); 968 + snd_soc_dapm_force_enable_pin(dapm, preload); 969 969 else 970 - snd_soc_component_disable_pin(component, preload); 970 + snd_soc_dapm_disable_pin(dapm, preload); 971 971 972 972 snd_soc_dapm_sync(dapm); 973 973 ··· 976 976 dsp->preloaded = ucontrol->value.integer.value[0]; 977 977 978 978 if (dsp->toggle_preload) { 979 - snd_soc_component_disable_pin(component, preload); 979 + snd_soc_dapm_disable_pin(dapm, preload); 980 980 snd_soc_dapm_sync(dapm); 981 981 } 982 982 ··· 1121 1121 1122 1122 int wm_adsp2_component_probe(struct wm_adsp *dsp, struct snd_soc_component *component) 1123 1123 { 1124 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1124 1125 char preload[32]; 1125 1126 1126 1127 if (!dsp->cs_dsp.no_core_startstop) { 1127 1128 snprintf(preload, ARRAY_SIZE(preload), "%s Preload", dsp->cs_dsp.name); 1128 - snd_soc_component_disable_pin(component, preload); 1129 + snd_soc_dapm_disable_pin(dapm, preload); 1129 1130 } 1130 1131 1131 1132 cs_dsp_init_debugfs(&dsp->cs_dsp, component->debugfs_root);
+4 -4
sound/soc/codecs/wm_hubs.c
··· 694 694 static int class_w_put_volsw(struct snd_kcontrol *kcontrol, 695 695 struct snd_ctl_elem_value *ucontrol) 696 696 { 697 - struct snd_soc_component *component = snd_soc_dapm_kcontrol_component(kcontrol); 697 + struct snd_soc_component *component = snd_soc_dapm_kcontrol_to_component(kcontrol); 698 698 int ret; 699 699 700 700 ret = snd_soc_dapm_put_volsw(kcontrol, ucontrol); ··· 714 714 static int class_w_put_double(struct snd_kcontrol *kcontrol, 715 715 struct snd_ctl_elem_value *ucontrol) 716 716 { 717 - struct snd_soc_component *component = snd_soc_dapm_kcontrol_component(kcontrol); 717 + struct snd_soc_component *component = snd_soc_dapm_kcontrol_to_component(kcontrol); 718 718 int ret; 719 719 720 720 ret = snd_soc_dapm_put_enum_double(kcontrol, ucontrol); ··· 1112 1112 1113 1113 int wm_hubs_add_analogue_controls(struct snd_soc_component *component) 1114 1114 { 1115 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 1115 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1116 1116 1117 1117 /* Latch volume update bits & default ZC on */ 1118 1118 snd_soc_component_update_bits(component, WM8993_LEFT_LINE_INPUT_1_2_VOLUME, ··· 1156 1156 int lineout1_diff, int lineout2_diff) 1157 1157 { 1158 1158 struct wm_hubs_data *hubs = snd_soc_component_get_drvdata(component); 1159 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 1159 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1160 1160 1161 1161 hubs->component = component; 1162 1162
+2 -2
sound/soc/fsl/fsl-asoc-card.c
··· 536 536 void *data) 537 537 { 538 538 struct snd_soc_jack *jack = (struct snd_soc_jack *)data; 539 - struct snd_soc_dapm_context *dapm = &jack->card->dapm; 539 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(jack->card); 540 540 541 541 if (event & SND_JACK_HEADPHONE) 542 542 /* Disable speaker if headphone is plugged in */ ··· 553 553 void *data) 554 554 { 555 555 struct snd_soc_jack *jack = (struct snd_soc_jack *)data; 556 - struct snd_soc_dapm_context *dapm = &jack->card->dapm; 556 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(jack->card); 557 557 558 558 if (event & SND_JACK_MICROPHONE) 559 559 /* Disable dmic if microphone is plugged in */
+1 -1
sound/soc/fsl/imx-rpmsg.c
··· 72 72 of_property_read_string_index(data->card.dev->of_node, 73 73 "ignore-suspend-widgets", 74 74 i, &widgets); 75 - dapm = snd_soc_component_get_dapm(codec_comp); 75 + dapm = snd_soc_component_to_dapm(codec_comp); 76 76 snd_soc_dapm_ignore_suspend(dapm, widgets); 77 77 } 78 78 }
+2 -2
sound/soc/generic/audio-graph-card.c
··· 43 43 struct snd_kcontrol *kcontrol, 44 44 int event) 45 45 { 46 - struct snd_soc_dapm_context *dapm = w->dapm; 47 - struct simple_util_priv *priv = snd_soc_card_get_drvdata(dapm->card); 46 + struct snd_soc_card *card = snd_soc_dapm_to_card(w->dapm); 47 + struct simple_util_priv *priv = snd_soc_card_get_drvdata(card); 48 48 49 49 switch (event) { 50 50 case SND_SOC_DAPM_POST_PMU:
+3 -4
sound/soc/intel/atom/sst-atom-controls.c
··· 637 637 * inputs as an IPC to the DSP. 638 638 */ 639 639 for (i = 0; i < w->num_kcontrols; i++) { 640 - if (dapm_kcontrol_get_value(w->kcontrols[i])) { 640 + if (snd_soc_dapm_kcontrol_get_value(w->kcontrols[i])) { 641 641 mc = (struct soc_mixer_control *)(w->kcontrols[i])->private_value; 642 642 val |= 1 << mc->shift; 643 643 } ··· 1530 1530 int sst_dsp_init_v2_dpcm(struct snd_soc_component *component) 1531 1531 { 1532 1532 int i, ret = 0; 1533 - struct snd_soc_dapm_context *dapm = 1534 - snd_soc_component_get_dapm(component); 1533 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1535 1534 struct sst_data *drv = snd_soc_component_get_drvdata(component); 1536 1535 unsigned int gains = ARRAY_SIZE(sst_gain_controls)/3; 1537 1536 ··· 1543 1544 ARRAY_SIZE(sst_dapm_widgets)); 1544 1545 snd_soc_dapm_add_routes(dapm, intercon, 1545 1546 ARRAY_SIZE(intercon)); 1546 - snd_soc_dapm_new_widgets(dapm->card); 1547 + snd_soc_dapm_new_widgets(component->card); 1547 1548 1548 1549 for (i = 0; i < gains; i++) { 1549 1550 sst_gains[i].mute = SST_GAIN_MUTE_DEFAULT;
+1 -2
sound/soc/intel/avs/boards/da7219.c
··· 29 29 static int platform_clock_control(struct snd_soc_dapm_widget *w, 30 30 struct snd_kcontrol *k, int event) 31 31 { 32 - struct snd_soc_dapm_context *dapm = w->dapm; 33 - struct snd_soc_card *card = dapm->card; 32 + struct snd_soc_card *card = snd_soc_dapm_to_card(w->dapm); 34 33 struct snd_soc_dai *codec_dai; 35 34 int ret = 0; 36 35
+3 -2
sound/soc/intel/avs/boards/es8336.c
··· 38 38 static int avs_es8336_speaker_power_event(struct snd_soc_dapm_widget *w, 39 39 struct snd_kcontrol *kcontrol, int event) 40 40 { 41 - struct snd_soc_card *card = w->dapm->card; 41 + struct snd_soc_card *card = snd_soc_dapm_to_card(w->dapm); 42 42 struct avs_card_drvdata *data; 43 43 bool speaker_en; 44 44 ··· 101 101 struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(runtime, 0); 102 102 struct snd_soc_component *component = codec_dai->component; 103 103 struct snd_soc_card *card = runtime->card; 104 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 104 105 struct snd_soc_jack_pin *pins; 105 106 struct avs_card_drvdata *data; 106 107 struct gpio_desc *gpiod; ··· 133 132 snd_jack_set_key(data->jack.jack, SND_JACK_BTN_0, KEY_PLAYPAUSE); 134 133 snd_soc_component_set_jack(component, &data->jack, NULL); 135 134 136 - card->dapm.idle_bias = false; 135 + snd_soc_dapm_set_idle_bias(dapm, false); 137 136 138 137 return 0; 139 138 }
+1 -2
sound/soc/intel/avs/boards/nau8825.c
··· 23 23 static int 24 24 avs_nau8825_clock_control(struct snd_soc_dapm_widget *w, struct snd_kcontrol *control, int event) 25 25 { 26 - struct snd_soc_dapm_context *dapm = w->dapm; 27 - struct snd_soc_card *card = dapm->card; 26 + struct snd_soc_card *card = snd_soc_dapm_to_card(w->dapm); 28 27 struct snd_soc_dai *codec_dai; 29 28 int ret; 30 29
+3 -3
sound/soc/intel/avs/boards/rt274.c
··· 27 27 static int 28 28 avs_rt274_clock_control(struct snd_soc_dapm_widget *w, struct snd_kcontrol *control, int event) 29 29 { 30 - struct snd_soc_dapm_context *dapm = w->dapm; 31 - struct snd_soc_card *card = dapm->card; 30 + struct snd_soc_card *card = snd_soc_dapm_to_card(w->dapm); 32 31 struct snd_soc_dai *codec_dai; 33 32 int ret; 34 33 ··· 92 93 struct snd_soc_jack_pin *pins; 93 94 struct snd_soc_jack *jack; 94 95 struct snd_soc_card *card = runtime->card; 96 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 95 97 int num_pins, ret; 96 98 97 99 jack = snd_soc_card_get_drvdata(card); ··· 117 117 return ret; 118 118 } 119 119 120 - card->dapm.idle_bias = false; 120 + snd_soc_dapm_set_idle_bias(dapm, false); 121 121 122 122 return 0; 123 123 }
+2 -1
sound/soc/intel/avs/boards/rt5514.c
··· 33 33 34 34 static int avs_rt5514_codec_init(struct snd_soc_pcm_runtime *runtime) 35 35 { 36 - int ret = snd_soc_dapm_ignore_suspend(&runtime->card->dapm, "DMIC"); 36 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(runtime->card); 37 + int ret = snd_soc_dapm_ignore_suspend(dapm, "DMIC"); 37 38 38 39 if (ret) 39 40 dev_err(runtime->dev, "DMIC - Ignore suspend failed = %d\n", ret);
+2 -1
sound/soc/intel/avs/boards/rt5640.c
··· 50 50 { 51 51 struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(runtime, 0); 52 52 struct snd_soc_card *card = runtime->card; 53 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 53 54 struct snd_soc_jack_pin *pins; 54 55 struct snd_soc_jack *jack; 55 56 int num_pins, ret; ··· 68 67 return ret; 69 68 70 69 snd_soc_component_set_jack(codec_dai->component, jack, NULL); 71 - card->dapm.idle_bias = false; 70 + snd_soc_dapm_set_idle_bias(dapm, false); 72 71 73 72 return 0; 74 73 }
+3 -4
sound/soc/intel/avs/control.c
··· 15 15 16 16 static struct avs_dev *avs_get_kcontrol_adev(struct snd_kcontrol *kcontrol) 17 17 { 18 - struct snd_soc_dapm_widget *w; 18 + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol); 19 + struct device *dev = snd_soc_dapm_to_dev(dapm); 19 20 20 - w = snd_soc_dapm_kcontrol_widget(kcontrol); 21 - 22 - return to_avs_dev(w->dapm->component->dev); 21 + return to_avs_dev(dev); 23 22 } 24 23 25 24 static struct avs_path_module *avs_get_volume_module(struct avs_dev *adev, u32 id)
+1 -1
sound/soc/intel/avs/pcm.c
··· 1624 1624 return -ENOMEM; 1625 1625 1626 1626 cname = dev_name(&codec->core.dev); 1627 - dapm = snd_soc_component_get_dapm(component); 1627 + dapm = snd_soc_component_to_dapm(component); 1628 1628 pcm = list_first_entry(&codec->pcm_list_head, struct hda_pcm, list); 1629 1629 1630 1630 for (i = 0; i < pcm_count; i++, pcm = list_next_entry(pcm, list)) {
+4 -5
sound/soc/intel/boards/bdw-rt5677.c
··· 27 27 static int bdw_rt5677_event_hp(struct snd_soc_dapm_widget *w, 28 28 struct snd_kcontrol *k, int event) 29 29 { 30 - struct snd_soc_dapm_context *dapm = w->dapm; 31 - struct snd_soc_card *card = dapm->card; 30 + struct snd_soc_card *card = snd_soc_dapm_to_card(w->dapm); 32 31 struct bdw_rt5677_priv *bdw_rt5677 = snd_soc_card_get_drvdata(card); 33 32 34 33 if (SND_SOC_DAPM_EVENT_ON(event)) ··· 227 228 struct bdw_rt5677_priv *bdw_rt5677 = 228 229 snd_soc_card_get_drvdata(rtd->card); 229 230 struct snd_soc_component *component = snd_soc_rtd_to_codec(rtd, 0)->component; 230 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 231 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 231 232 int ret; 232 233 233 234 ret = devm_acpi_dev_add_driver_gpios(component->dev, bdw_rt5677_gpios); ··· 365 366 struct snd_soc_dapm_context *dapm; 366 367 367 368 if (bdw_rt5677->component) { 368 - dapm = snd_soc_component_get_dapm(bdw_rt5677->component); 369 + dapm = snd_soc_component_to_dapm(bdw_rt5677->component); 369 370 snd_soc_dapm_disable_pin(dapm, "MICBIAS1"); 370 371 } 371 372 return 0; ··· 377 378 struct snd_soc_dapm_context *dapm; 378 379 379 380 if (bdw_rt5677->component) { 380 - dapm = snd_soc_component_get_dapm(bdw_rt5677->component); 381 + dapm = snd_soc_component_to_dapm(bdw_rt5677->component); 381 382 snd_soc_dapm_force_enable_pin(dapm, "MICBIAS1"); 382 383 } 383 384 return 0;
+2 -1
sound/soc/intel/boards/bytcht_cx2072x.c
··· 70 70 static int byt_cht_cx2072x_init(struct snd_soc_pcm_runtime *rtd) 71 71 { 72 72 struct snd_soc_card *card = rtd->card; 73 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 73 74 struct snd_soc_component *codec = snd_soc_rtd_to_codec(rtd, 0)->component; 74 75 int ret; 75 76 ··· 78 77 byt_cht_cx2072x_acpi_gpios)) 79 78 dev_warn(rtd->dev, "Unable to add GPIO mapping table\n"); 80 79 81 - card->dapm.idle_bias = false; 80 + snd_soc_dapm_set_idle_bias(dapm, false); 82 81 83 82 /* set the default PLL rate, the clock is handled by the codec driver */ 84 83 ret = snd_soc_dai_set_sysclk(snd_soc_rtd_to_codec(rtd, 0), CX2072X_MCLK_EXTERNAL_PLL,
+5 -4
sound/soc/intel/boards/bytcht_es8316.c
··· 89 89 static int byt_cht_es8316_speaker_power_event(struct snd_soc_dapm_widget *w, 90 90 struct snd_kcontrol *kcontrol, int event) 91 91 { 92 - struct snd_soc_card *card = w->dapm->card; 92 + struct snd_soc_card *card = snd_soc_dapm_to_card(w->dapm); 93 93 struct byt_cht_es8316_private *priv = snd_soc_card_get_drvdata(card); 94 94 95 95 if (SND_SOC_DAPM_EVENT_ON(event)) ··· 174 174 { 175 175 struct snd_soc_component *codec = snd_soc_rtd_to_codec(runtime, 0)->component; 176 176 struct snd_soc_card *card = runtime->card; 177 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 177 178 struct byt_cht_es8316_private *priv = snd_soc_card_get_drvdata(card); 178 179 const struct snd_soc_dapm_route *custom_map; 179 180 int num_routes; 180 181 int ret; 181 182 182 - card->dapm.idle_bias = false; 183 + snd_soc_dapm_set_idle_bias(dapm, false); 183 184 184 185 switch (BYT_CHT_ES8316_MAP(quirk)) { 185 186 case BYT_CHT_ES8316_INTMIC_IN1_MAP: ··· 193 192 num_routes = ARRAY_SIZE(byt_cht_es8316_intmic_in2_map); 194 193 break; 195 194 } 196 - ret = snd_soc_dapm_add_routes(&card->dapm, custom_map, num_routes); 195 + ret = snd_soc_dapm_add_routes(dapm, custom_map, num_routes); 197 196 if (ret) 198 197 return ret; 199 198 ··· 204 203 custom_map = byt_cht_es8316_ssp2_map; 205 204 num_routes = ARRAY_SIZE(byt_cht_es8316_ssp2_map); 206 205 } 207 - ret = snd_soc_dapm_add_routes(&card->dapm, custom_map, num_routes); 206 + ret = snd_soc_dapm_add_routes(dapm, custom_map, num_routes); 208 207 if (ret) 209 208 return ret; 210 209
+13 -12
sound/soc/intel/boards/bytcr_rt5640.c
··· 257 257 258 258 static struct snd_soc_dai *byt_rt5640_get_codec_dai(struct snd_soc_dapm_context *dapm) 259 259 { 260 - struct snd_soc_card *card = dapm->card; 260 + struct snd_soc_card *card = snd_soc_dapm_to_card(dapm); 261 261 struct snd_soc_dai *codec_dai; 262 262 263 263 codec_dai = snd_soc_card_get_codec_dai(card, BYT_CODEC_DAI1); ··· 273 273 struct snd_kcontrol *k, int event) 274 274 { 275 275 struct snd_soc_dapm_context *dapm = w->dapm; 276 - struct snd_soc_card *card = dapm->card; 276 + struct snd_soc_card *card = snd_soc_dapm_to_card(dapm); 277 277 struct snd_soc_dai *codec_dai; 278 278 struct byt_rt5640_private *priv = snd_soc_card_get_drvdata(card); 279 279 int ret; ··· 1317 1317 static int byt_rt5640_init(struct snd_soc_pcm_runtime *runtime) 1318 1318 { 1319 1319 struct snd_soc_card *card = runtime->card; 1320 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 1320 1321 struct byt_rt5640_private *priv = snd_soc_card_get_drvdata(card); 1321 1322 struct rt5640_set_jack_data *jack_data = &priv->jack_data; 1322 1323 struct snd_soc_component *component = snd_soc_rtd_to_codec(runtime, 0)->component; ··· 1325 1324 int num_routes = 0; 1326 1325 int ret; 1327 1326 1328 - card->dapm.idle_bias = false; 1327 + snd_soc_dapm_set_idle_bias(dapm, false); 1329 1328 jack_data->use_platform_clock = true; 1330 1329 1331 1330 /* Start with RC clk for jack-detect (we disable MCLK below) */ ··· 1368 1367 break; 1369 1368 } 1370 1369 1371 - ret = snd_soc_dapm_add_routes(&card->dapm, custom_map, num_routes); 1370 + ret = snd_soc_dapm_add_routes(dapm, custom_map, num_routes); 1372 1371 if (ret) 1373 1372 return ret; 1374 1373 1375 1374 if (byt_rt5640_quirk & BYT_RT5640_HSMIC2_ON_IN1) { 1376 - ret = snd_soc_dapm_add_routes(&card->dapm, 1375 + ret = snd_soc_dapm_add_routes(dapm, 1377 1376 byt_rt5640_hsmic2_in1_map, 1378 1377 ARRAY_SIZE(byt_rt5640_hsmic2_in1_map)); 1379 1378 if (ret) ··· 1381 1380 } 1382 1381 1383 1382 if (byt_rt5640_quirk & BYT_RT5640_SSP2_AIF2) { 1384 - ret = snd_soc_dapm_add_routes(&card->dapm, 1383 + ret = snd_soc_dapm_add_routes(dapm, 1385 1384 byt_rt5640_ssp2_aif2_map, 1386 1385 ARRAY_SIZE(byt_rt5640_ssp2_aif2_map)); 1387 1386 } else if (byt_rt5640_quirk & BYT_RT5640_SSP0_AIF1) { 1388 - ret = snd_soc_dapm_add_routes(&card->dapm, 1387 + ret = snd_soc_dapm_add_routes(dapm, 1389 1388 byt_rt5640_ssp0_aif1_map, 1390 1389 ARRAY_SIZE(byt_rt5640_ssp0_aif1_map)); 1391 1390 } else if (byt_rt5640_quirk & BYT_RT5640_SSP0_AIF2) { 1392 - ret = snd_soc_dapm_add_routes(&card->dapm, 1391 + ret = snd_soc_dapm_add_routes(dapm, 1393 1392 byt_rt5640_ssp0_aif2_map, 1394 1393 ARRAY_SIZE(byt_rt5640_ssp0_aif2_map)); 1395 1394 } else { 1396 - ret = snd_soc_dapm_add_routes(&card->dapm, 1395 + ret = snd_soc_dapm_add_routes(dapm, 1397 1396 byt_rt5640_ssp2_aif1_map, 1398 1397 ARRAY_SIZE(byt_rt5640_ssp2_aif1_map)); 1399 1398 } ··· 1401 1400 return ret; 1402 1401 1403 1402 if (byt_rt5640_quirk & BYT_RT5640_MONO_SPEAKER) { 1404 - ret = snd_soc_dapm_add_routes(&card->dapm, 1403 + ret = snd_soc_dapm_add_routes(dapm, 1405 1404 byt_rt5640_mono_spk_map, 1406 1405 ARRAY_SIZE(byt_rt5640_mono_spk_map)); 1407 1406 } else if (!(byt_rt5640_quirk & BYT_RT5640_NO_SPEAKERS)) { 1408 - ret = snd_soc_dapm_add_routes(&card->dapm, 1407 + ret = snd_soc_dapm_add_routes(dapm, 1409 1408 byt_rt5640_stereo_spk_map, 1410 1409 ARRAY_SIZE(byt_rt5640_stereo_spk_map)); 1411 1410 } ··· 1413 1412 return ret; 1414 1413 1415 1414 if (byt_rt5640_quirk & BYT_RT5640_LINEOUT) { 1416 - ret = snd_soc_dapm_add_routes(&card->dapm, 1415 + ret = snd_soc_dapm_add_routes(dapm, 1417 1416 byt_rt5640_lineout_map, 1418 1417 ARRAY_SIZE(byt_rt5640_lineout_map)); 1419 1418 if (ret)
+9 -9
sound/soc/intel/boards/bytcr_rt5651.c
··· 188 188 static int platform_clock_control(struct snd_soc_dapm_widget *w, 189 189 struct snd_kcontrol *k, int event) 190 190 { 191 - struct snd_soc_dapm_context *dapm = w->dapm; 192 - struct snd_soc_card *card = dapm->card; 191 + struct snd_soc_card *card = snd_soc_dapm_to_card(w->dapm); 193 192 struct snd_soc_dai *codec_dai; 194 193 struct byt_rt5651_private *priv = snd_soc_card_get_drvdata(card); 195 194 int ret; ··· 233 234 static int rt5651_ext_amp_power_event(struct snd_soc_dapm_widget *w, 234 235 struct snd_kcontrol *kcontrol, int event) 235 236 { 236 - struct snd_soc_card *card = w->dapm->card; 237 + struct snd_soc_card *card = snd_soc_dapm_to_card(w->dapm); 237 238 struct byt_rt5651_private *priv = snd_soc_card_get_drvdata(card); 238 239 239 240 if (SND_SOC_DAPM_EVENT_ON(event)) ··· 578 579 static int byt_rt5651_init(struct snd_soc_pcm_runtime *runtime) 579 580 { 580 581 struct snd_soc_card *card = runtime->card; 582 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 581 583 struct snd_soc_component *codec = snd_soc_rtd_to_codec(runtime, 0)->component; 582 584 struct byt_rt5651_private *priv = snd_soc_card_get_drvdata(card); 583 585 const struct snd_soc_dapm_route *custom_map; ··· 586 586 int report; 587 587 int ret; 588 588 589 - card->dapm.idle_bias = false; 589 + snd_soc_dapm_set_idle_bias(dapm, false); 590 590 591 591 /* Start with RC clk for jack-detect (we disable MCLK below) */ 592 592 if (byt_rt5651_quirk & BYT_RT5651_MCLK_EN) ··· 610 610 custom_map = byt_rt5651_intmic_dmic_map; 611 611 num_routes = ARRAY_SIZE(byt_rt5651_intmic_dmic_map); 612 612 } 613 - ret = snd_soc_dapm_add_routes(&card->dapm, custom_map, num_routes); 613 + ret = snd_soc_dapm_add_routes(dapm, custom_map, num_routes); 614 614 if (ret) 615 615 return ret; 616 616 617 617 if (byt_rt5651_quirk & BYT_RT5651_SSP2_AIF2) { 618 - ret = snd_soc_dapm_add_routes(&card->dapm, 618 + ret = snd_soc_dapm_add_routes(dapm, 619 619 byt_rt5651_ssp2_aif2_map, 620 620 ARRAY_SIZE(byt_rt5651_ssp2_aif2_map)); 621 621 } else if (byt_rt5651_quirk & BYT_RT5651_SSP0_AIF1) { 622 - ret = snd_soc_dapm_add_routes(&card->dapm, 622 + ret = snd_soc_dapm_add_routes(dapm, 623 623 byt_rt5651_ssp0_aif1_map, 624 624 ARRAY_SIZE(byt_rt5651_ssp0_aif1_map)); 625 625 } else if (byt_rt5651_quirk & BYT_RT5651_SSP0_AIF2) { 626 - ret = snd_soc_dapm_add_routes(&card->dapm, 626 + ret = snd_soc_dapm_add_routes(dapm, 627 627 byt_rt5651_ssp0_aif2_map, 628 628 ARRAY_SIZE(byt_rt5651_ssp0_aif2_map)); 629 629 } else { 630 - ret = snd_soc_dapm_add_routes(&card->dapm, 630 + ret = snd_soc_dapm_add_routes(dapm, 631 631 byt_rt5651_ssp2_aif1_map, 632 632 ARRAY_SIZE(byt_rt5651_ssp2_aif1_map)); 633 633 }
+7 -7
sound/soc/intel/boards/bytcr_wm5102.c
··· 99 99 static int byt_wm5102_spkvdd_power_event(struct snd_soc_dapm_widget *w, 100 100 struct snd_kcontrol *kcontrol, int event) 101 101 { 102 - struct snd_soc_card *card = w->dapm->card; 102 + struct snd_soc_card *card = snd_soc_dapm_to_card(w->dapm); 103 103 struct byt_wm5102_private *priv = snd_soc_card_get_drvdata(card); 104 104 105 105 gpiod_set_value_cansleep(priv->spkvdd_en_gpio, ··· 150 150 static int platform_clock_control(struct snd_soc_dapm_widget *w, 151 151 struct snd_kcontrol *k, int event) 152 152 { 153 - struct snd_soc_dapm_context *dapm = w->dapm; 154 - struct snd_soc_card *card = dapm->card; 153 + struct snd_soc_card *card = snd_soc_dapm_to_card(w->dapm); 155 154 struct snd_soc_dai *codec_dai; 156 155 struct byt_wm5102_private *priv = snd_soc_card_get_drvdata(card); 157 156 int ret; ··· 282 283 static int byt_wm5102_init(struct snd_soc_pcm_runtime *runtime) 283 284 { 284 285 struct snd_soc_card *card = runtime->card; 286 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 285 287 struct byt_wm5102_private *priv = snd_soc_card_get_drvdata(card); 286 288 struct snd_soc_component *component = snd_soc_rtd_to_codec(runtime, 0)->component; 287 289 const struct snd_soc_dapm_route *custom_map = NULL; 288 290 int ret, jack_type, num_routes = 0; 289 291 290 - card->dapm.idle_bias = false; 292 + snd_soc_dapm_set_idle_bias(dapm, false); 291 293 292 294 ret = snd_soc_add_card_controls(card, byt_wm5102_controls, 293 295 ARRAY_SIZE(byt_wm5102_controls)); ··· 307 307 num_routes = ARRAY_SIZE(byt_wm5102_intmic_in1l_hsmic_in2l_map); 308 308 break; 309 309 } 310 - ret = snd_soc_dapm_add_routes(&card->dapm, custom_map, num_routes); 310 + ret = snd_soc_dapm_add_routes(dapm, custom_map, num_routes); 311 311 if (ret) 312 312 return ret; 313 313 ··· 321 321 num_routes = ARRAY_SIZE(byt_wm5102_spk_hpout2_map); 322 322 break; 323 323 } 324 - ret = snd_soc_dapm_add_routes(&card->dapm, custom_map, num_routes); 324 + ret = snd_soc_dapm_add_routes(dapm, custom_map, num_routes); 325 325 if (ret) 326 326 return ret; 327 327 ··· 332 332 custom_map = bytcr_wm5102_ssp0_map; 333 333 num_routes = ARRAY_SIZE(bytcr_wm5102_ssp0_map); 334 334 } 335 - ret = snd_soc_dapm_add_routes(&card->dapm, custom_map, num_routes); 335 + ret = snd_soc_dapm_add_routes(dapm, custom_map, num_routes); 336 336 if (ret) 337 337 return ret; 338 338
+2 -3
sound/soc/intel/boards/cht_bsw_max98090_ti.c
··· 42 42 static int platform_clock_control(struct snd_soc_dapm_widget *w, 43 43 struct snd_kcontrol *k, int event) 44 44 { 45 - struct snd_soc_dapm_context *dapm = w->dapm; 46 - struct snd_soc_card *card = dapm->card; 45 + struct snd_soc_card *card = snd_soc_dapm_to_card(w->dapm); 47 46 struct snd_soc_dai *codec_dai; 48 47 struct cht_mc_private *ctx = snd_soc_card_get_drvdata(card); 49 48 int ret; ··· 129 130 unsigned long event, void *data) 130 131 { 131 132 struct snd_soc_jack *jack = (struct snd_soc_jack *)data; 132 - struct snd_soc_dapm_context *dapm = &jack->card->dapm; 133 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(jack->card); 133 134 134 135 if (event & SND_JACK_MICROPHONE) { 135 136 snd_soc_dapm_force_enable_pin(dapm, "SHDN");
+6 -6
sound/soc/intel/boards/cht_bsw_rt5645.c
··· 66 66 static int platform_clock_control(struct snd_soc_dapm_widget *w, 67 67 struct snd_kcontrol *k, int event) 68 68 { 69 - struct snd_soc_dapm_context *dapm = w->dapm; 70 - struct snd_soc_card *card = dapm->card; 69 + struct snd_soc_card *card = snd_soc_dapm_to_card(w->dapm); 71 70 struct snd_soc_dai *codec_dai; 72 71 struct cht_mc_private *ctx = snd_soc_card_get_drvdata(card); 73 72 int ret; ··· 249 250 static int cht_codec_init(struct snd_soc_pcm_runtime *runtime) 250 251 { 251 252 struct snd_soc_card *card = runtime->card; 253 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 252 254 struct cht_mc_private *ctx = snd_soc_card_get_drvdata(runtime->card); 253 255 struct snd_soc_component *component = snd_soc_rtd_to_codec(runtime, 0)->component; 254 256 int jack_type; ··· 275 275 } 276 276 277 277 if (cht_rt5645_quirk & CHT_RT5645_SSP2_AIF2) { 278 - ret = snd_soc_dapm_add_routes(&card->dapm, 278 + ret = snd_soc_dapm_add_routes(dapm, 279 279 cht_rt5645_ssp2_aif2_map, 280 280 ARRAY_SIZE(cht_rt5645_ssp2_aif2_map)); 281 281 } else if (cht_rt5645_quirk & CHT_RT5645_SSP0_AIF1) { 282 - ret = snd_soc_dapm_add_routes(&card->dapm, 282 + ret = snd_soc_dapm_add_routes(dapm, 283 283 cht_rt5645_ssp0_aif1_map, 284 284 ARRAY_SIZE(cht_rt5645_ssp0_aif1_map)); 285 285 } else if (cht_rt5645_quirk & CHT_RT5645_SSP0_AIF2) { 286 - ret = snd_soc_dapm_add_routes(&card->dapm, 286 + ret = snd_soc_dapm_add_routes(dapm, 287 287 cht_rt5645_ssp0_aif2_map, 288 288 ARRAY_SIZE(cht_rt5645_ssp0_aif2_map)); 289 289 } else { 290 - ret = snd_soc_dapm_add_routes(&card->dapm, 290 + ret = snd_soc_dapm_add_routes(dapm, 291 291 cht_rt5645_ssp2_aif1_map, 292 292 ARRAY_SIZE(cht_rt5645_ssp2_aif1_map)); 293 293 }
+4 -4
sound/soc/intel/boards/cht_bsw_rt5672.c
··· 51 51 static int platform_clock_control(struct snd_soc_dapm_widget *w, 52 52 struct snd_kcontrol *k, int event) 53 53 { 54 - struct snd_soc_dapm_context *dapm = w->dapm; 55 - struct snd_soc_card *card = dapm->card; 54 + struct snd_soc_card *card = snd_soc_dapm_to_card(w->dapm); 56 55 struct snd_soc_dai *codec_dai; 57 56 struct cht_mc_private *ctx = snd_soc_card_get_drvdata(card); 58 57 int ret; ··· 192 193 static int cht_codec_init(struct snd_soc_pcm_runtime *runtime) 193 194 { 194 195 int ret; 196 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(runtime->card); 195 197 struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(runtime, 0); 196 198 struct snd_soc_component *component = codec_dai->component; 197 199 struct cht_mc_private *ctx = snd_soc_card_get_drvdata(runtime->card); ··· 215 215 RT5670_CLK_SEL_I2S1_ASRC); 216 216 217 217 if (ctx->use_ssp0) { 218 - ret = snd_soc_dapm_add_routes(&runtime->card->dapm, 218 + ret = snd_soc_dapm_add_routes(dapm, 219 219 cht_audio_ssp0_map, 220 220 ARRAY_SIZE(cht_audio_ssp0_map)); 221 221 } else { 222 - ret = snd_soc_dapm_add_routes(&runtime->card->dapm, 222 + ret = snd_soc_dapm_add_routes(dapm, 223 223 cht_audio_ssp2_map, 224 224 ARRAY_SIZE(cht_audio_ssp2_map)); 225 225 }
+6 -4
sound/soc/intel/boards/sof_board_helpers.c
··· 51 51 static int dmic_init(struct snd_soc_pcm_runtime *rtd) 52 52 { 53 53 struct snd_soc_card *card = rtd->card; 54 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 54 55 int ret; 55 56 56 - ret = snd_soc_dapm_new_controls(&card->dapm, dmic_widgets, 57 + ret = snd_soc_dapm_new_controls(dapm, dmic_widgets, 57 58 ARRAY_SIZE(dmic_widgets)); 58 59 if (ret) { 59 60 dev_err(rtd->dev, "fail to add dmic widgets, ret %d\n", ret); 60 61 return ret; 61 62 } 62 63 63 - ret = snd_soc_dapm_add_routes(&card->dapm, dmic_routes, 64 + ret = snd_soc_dapm_add_routes(dapm, dmic_routes, 64 65 ARRAY_SIZE(dmic_routes)); 65 66 if (ret) { 66 67 dev_err(rtd->dev, "fail to add dmic routes, ret %d\n", ret); ··· 112 111 static int hda_init(struct snd_soc_pcm_runtime *rtd) 113 112 { 114 113 struct snd_soc_card *card = rtd->card; 114 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 115 115 int ret; 116 116 117 - ret = snd_soc_dapm_new_controls(&card->dapm, hda_widgets, 117 + ret = snd_soc_dapm_new_controls(dapm, hda_widgets, 118 118 ARRAY_SIZE(hda_widgets)); 119 119 if (ret) { 120 120 dev_err(rtd->dev, "fail to add hda widgets, ret %d\n", ret); 121 121 return ret; 122 122 } 123 123 124 - ret = snd_soc_dapm_add_routes(&card->dapm, hda_routes, 124 + ret = snd_soc_dapm_add_routes(dapm, hda_routes, 125 125 ARRAY_SIZE(hda_routes)); 126 126 if (ret) 127 127 dev_err(rtd->dev, "fail to add hda routes, ret %d\n", ret);
+3 -2
sound/soc/intel/boards/sof_cirrus_common.c
··· 48 48 static int cs35l41_init(struct snd_soc_pcm_runtime *rtd) 49 49 { 50 50 struct snd_soc_card *card = rtd->card; 51 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 51 52 int ret; 52 53 53 - ret = snd_soc_dapm_new_controls(&card->dapm, cs35l41_dapm_widgets, 54 + ret = snd_soc_dapm_new_controls(dapm, cs35l41_dapm_widgets, 54 55 ARRAY_SIZE(cs35l41_dapm_widgets)); 55 56 if (ret) { 56 57 dev_err(rtd->dev, "fail to add dapm controls, ret %d\n", ret); ··· 65 64 return ret; 66 65 } 67 66 68 - ret = snd_soc_dapm_add_routes(&card->dapm, cs35l41_dapm_routes, 67 + ret = snd_soc_dapm_add_routes(dapm, cs35l41_dapm_routes, 69 68 ARRAY_SIZE(cs35l41_dapm_routes)); 70 69 71 70 if (ret)
+2 -3
sound/soc/intel/boards/sof_da7219.c
··· 29 29 static int platform_clock_control(struct snd_soc_dapm_widget *w, 30 30 struct snd_kcontrol *k, int event) 31 31 { 32 - struct snd_soc_dapm_context *dapm = w->dapm; 33 - struct snd_soc_card *card = dapm->card; 32 + struct snd_soc_card *card = snd_soc_dapm_to_card(w->dapm); 34 33 struct sof_card_private *ctx = snd_soc_card_get_drvdata(card); 35 34 struct snd_soc_dai *codec_dai; 36 35 int ret = 0; ··· 180 181 static int card_late_probe(struct snd_soc_card *card) 181 182 { 182 183 struct sof_card_private *ctx = snd_soc_card_get_drvdata(card); 183 - struct snd_soc_dapm_context *dapm = &card->dapm; 184 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 184 185 int err; 185 186 186 187 if (ctx->amp_type == CODEC_MAX98373) {
+7 -5
sound/soc/intel/boards/sof_es8336.c
··· 155 155 static int sof_es8316_speaker_power_event(struct snd_soc_dapm_widget *w, 156 156 struct snd_kcontrol *kcontrol, int event) 157 157 { 158 - struct snd_soc_card *card = w->dapm->card; 158 + struct snd_soc_card *card = snd_soc_dapm_to_card(w->dapm); 159 159 struct sof_es8336_private *priv = snd_soc_card_get_drvdata(card); 160 160 161 161 if (priv->speaker_en == !SND_SOC_DAPM_EVENT_ON(event)) ··· 231 231 static int dmic_init(struct snd_soc_pcm_runtime *runtime) 232 232 { 233 233 struct snd_soc_card *card = runtime->card; 234 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 234 235 int ret; 235 236 236 - ret = snd_soc_dapm_new_controls(&card->dapm, dmic_widgets, 237 + ret = snd_soc_dapm_new_controls(dapm, dmic_widgets, 237 238 ARRAY_SIZE(dmic_widgets)); 238 239 if (ret) { 239 240 dev_err(card->dev, "DMic widget addition failed: %d\n", ret); 240 241 return ret; 241 242 } 242 243 243 - ret = snd_soc_dapm_add_routes(&card->dapm, dmic_map, 244 + ret = snd_soc_dapm_add_routes(dapm, dmic_map, 244 245 ARRAY_SIZE(dmic_map)); 245 246 if (ret) 246 247 dev_err(card->dev, "DMic map addition failed: %d\n", ret); ··· 272 271 { 273 272 struct snd_soc_component *codec = snd_soc_rtd_to_codec(runtime, 0)->component; 274 273 struct snd_soc_card *card = runtime->card; 274 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 275 275 struct sof_es8336_private *priv = snd_soc_card_get_drvdata(card); 276 276 const struct snd_soc_dapm_route *custom_map; 277 277 int num_routes; 278 278 int ret; 279 279 280 - card->dapm.idle_bias = false; 280 + snd_soc_dapm_set_idle_bias(dapm, false); 281 281 282 282 if (quirk & SOC_ES8336_HEADSET_MIC1) { 283 283 custom_map = sof_es8316_headset_mic1_map; ··· 288 286 num_routes = ARRAY_SIZE(sof_es8316_headset_mic2_map); 289 287 } 290 288 291 - ret = snd_soc_dapm_add_routes(&card->dapm, custom_map, num_routes); 289 + ret = snd_soc_dapm_add_routes(dapm, custom_map, num_routes); 292 290 if (ret) 293 291 return ret; 294 292
+12 -10
sound/soc/intel/boards/sof_maxim_common.c
··· 201 201 202 202 cpu_dai = snd_soc_rtd_to_cpu(rtd, 0); 203 203 for_each_rtd_codec_dais(rtd, j, codec_dai) { 204 - struct snd_soc_dapm_context *dapm = 205 - snd_soc_component_get_dapm(cpu_dai->component); 204 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(cpu_dai->component); 206 205 char pin_name[MAX_98373_PIN_NAME]; 207 206 208 207 snprintf(pin_name, ARRAY_SIZE(pin_name), "%s Spk", ··· 238 239 static int max_98373_spk_codec_init(struct snd_soc_pcm_runtime *rtd) 239 240 { 240 241 struct snd_soc_card *card = rtd->card; 242 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 241 243 unsigned int num_codecs = get_num_codecs(MAX_98373_ACPI_HID); 242 244 int ret; 243 245 244 246 switch (num_codecs) { 245 247 case 2: 246 - ret = snd_soc_dapm_new_controls(&card->dapm, maxim_2spk_widgets, 248 + ret = snd_soc_dapm_new_controls(dapm, maxim_2spk_widgets, 247 249 ARRAY_SIZE(maxim_2spk_widgets)); 248 250 if (ret) { 249 251 dev_err(rtd->dev, "fail to add max98373 widgets, ret %d\n", ··· 260 260 return ret; 261 261 } 262 262 263 - ret = snd_soc_dapm_add_routes(&card->dapm, max_98373_dapm_routes, 263 + ret = snd_soc_dapm_add_routes(dapm, max_98373_dapm_routes, 264 264 ARRAY_SIZE(max_98373_dapm_routes)); 265 265 if (ret) { 266 266 dev_err(rtd->dev, "fail to add max98373 routes, ret %d\n", ··· 416 416 static int max_98390_init(struct snd_soc_pcm_runtime *rtd) 417 417 { 418 418 struct snd_soc_card *card = rtd->card; 419 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 419 420 unsigned int num_codecs = get_num_codecs(MAX_98390_ACPI_HID); 420 421 int ret; 421 422 422 423 switch (num_codecs) { 423 424 case 4: 424 425 /* add widgets/controls/dapm for tweeter speakers */ 425 - ret = snd_soc_dapm_new_controls(&card->dapm, max_98390_tt_dapm_widgets, 426 + ret = snd_soc_dapm_new_controls(dapm, max_98390_tt_dapm_widgets, 426 427 ARRAY_SIZE(max_98390_tt_dapm_widgets)); 427 428 if (ret) { 428 429 dev_err(rtd->dev, "unable to add tweeter dapm widgets, ret %d\n", ··· 440 439 return ret; 441 440 } 442 441 443 - ret = snd_soc_dapm_add_routes(&card->dapm, max_98390_tt_dapm_routes, 442 + ret = snd_soc_dapm_add_routes(dapm, max_98390_tt_dapm_routes, 444 443 ARRAY_SIZE(max_98390_tt_dapm_routes)); 445 444 if (ret) { 446 445 dev_err(rtd->dev, "unable to add tweeter dapm routes, ret %d\n", ··· 451 450 fallthrough; 452 451 case 2: 453 452 /* add regular speakers dapm route */ 454 - ret = snd_soc_dapm_new_controls(&card->dapm, maxim_2spk_widgets, 453 + ret = snd_soc_dapm_new_controls(dapm, maxim_2spk_widgets, 455 454 ARRAY_SIZE(maxim_2spk_widgets)); 456 455 if (ret) { 457 456 dev_err(rtd->dev, "fail to add max98390 woofer widgets, ret %d\n", ··· 467 466 return ret; 468 467 } 469 468 470 - ret = snd_soc_dapm_add_routes(&card->dapm, max_98390_dapm_routes, 469 + ret = snd_soc_dapm_add_routes(dapm, max_98390_dapm_routes, 471 470 ARRAY_SIZE(max_98390_dapm_routes)); 472 471 if (ret) { 473 472 dev_err(rtd->dev, "unable to add dapm routes, ret %d\n", ··· 565 564 static int max_98357a_init(struct snd_soc_pcm_runtime *rtd) 566 565 { 567 566 struct snd_soc_card *card = rtd->card; 567 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 568 568 int ret; 569 569 570 - ret = snd_soc_dapm_new_controls(&card->dapm, max_98357a_dapm_widgets, 570 + ret = snd_soc_dapm_new_controls(dapm, max_98357a_dapm_widgets, 571 571 ARRAY_SIZE(max_98357a_dapm_widgets)); 572 572 if (ret) { 573 573 dev_err(rtd->dev, "unable to add dapm controls, ret %d\n", ret); ··· 583 581 return ret; 584 582 } 585 583 586 - ret = snd_soc_dapm_add_routes(&card->dapm, max_98357a_dapm_routes, 584 + ret = snd_soc_dapm_add_routes(dapm, max_98357a_dapm_routes, 587 585 ARRAY_SIZE(max_98357a_dapm_routes)); 588 586 589 587 if (ret)
+1 -1
sound/soc/intel/boards/sof_nau8825.c
··· 122 122 static int sof_card_late_probe(struct snd_soc_card *card) 123 123 { 124 124 struct sof_card_private *ctx = snd_soc_card_get_drvdata(card); 125 - struct snd_soc_dapm_context *dapm = &card->dapm; 125 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 126 126 int err; 127 127 128 128 if (ctx->amp_type == CODEC_MAX98373) {
+3 -2
sound/soc/intel/boards/sof_nuvoton_common.c
··· 34 34 static int nau8318_init(struct snd_soc_pcm_runtime *rtd) 35 35 { 36 36 struct snd_soc_card *card = rtd->card; 37 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 37 38 int ret; 38 39 39 - ret = snd_soc_dapm_new_controls(&card->dapm, nau8318_widgets, 40 + ret = snd_soc_dapm_new_controls(dapm, nau8318_widgets, 40 41 ARRAY_SIZE(nau8318_widgets)); 41 42 if (ret) { 42 43 dev_err(rtd->dev, "fail to add nau8318 widgets, ret %d\n", ret); ··· 51 50 return ret; 52 51 } 53 52 54 - ret = snd_soc_dapm_add_routes(&card->dapm, nau8318_routes, 53 + ret = snd_soc_dapm_add_routes(dapm, nau8318_routes, 55 54 ARRAY_SIZE(nau8318_routes)); 56 55 57 56 if (ret) {
+3 -2
sound/soc/intel/boards/sof_pcm512x.c
··· 177 177 static int dmic_init(struct snd_soc_pcm_runtime *rtd) 178 178 { 179 179 struct snd_soc_card *card = rtd->card; 180 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 180 181 int ret; 181 182 182 - ret = snd_soc_dapm_new_controls(&card->dapm, dmic_widgets, 183 + ret = snd_soc_dapm_new_controls(dapm, dmic_widgets, 183 184 ARRAY_SIZE(dmic_widgets)); 184 185 if (ret) { 185 186 dev_err(card->dev, "DMic widget addition failed: %d\n", ret); ··· 188 187 return ret; 189 188 } 190 189 191 - ret = snd_soc_dapm_add_routes(&card->dapm, dmic_map, 190 + ret = snd_soc_dapm_add_routes(dapm, dmic_map, 192 191 ARRAY_SIZE(dmic_map)); 193 192 194 193 if (ret)
+18 -16
sound/soc/intel/boards/sof_realtek_common.c
··· 186 186 static int rt1011_init(struct snd_soc_pcm_runtime *rtd) 187 187 { 188 188 struct snd_soc_card *card = rtd->card; 189 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 189 190 unsigned int num_codecs = get_num_codecs(RT1011_ACPI_HID); 190 191 int ret; 191 192 192 193 switch (num_codecs) { 193 194 case 2: 194 195 if (!soc_intel_is_cml()) { 195 - ret = snd_soc_dapm_new_controls(&card->dapm, realtek_2spk_widgets, 196 + ret = snd_soc_dapm_new_controls(dapm, realtek_2spk_widgets, 196 197 ARRAY_SIZE(realtek_2spk_widgets)); 197 198 if (ret) { 198 199 dev_err(rtd->dev, "fail to add rt1011 widgets, ret %d\n", ··· 209 208 return ret; 210 209 } 211 210 212 - ret = snd_soc_dapm_add_routes(&card->dapm, speaker_map_lr, 211 + ret = snd_soc_dapm_add_routes(dapm, speaker_map_lr, 213 212 ARRAY_SIZE(speaker_map_lr)); 214 213 if (ret) { 215 214 dev_err(rtd->dev, "fail to add rt1011 routes, ret %d\n", ··· 226 225 */ 227 226 fallthrough; 228 227 case 4: 229 - ret = snd_soc_dapm_new_controls(&card->dapm, realtek_4spk_widgets, 230 - num_codecs); 228 + ret = snd_soc_dapm_new_controls(dapm, realtek_4spk_widgets, num_codecs); 231 229 if (ret) { 232 230 dev_err(rtd->dev, "fail to add rt1011 widgets, ret %d\n", 233 231 ret); 234 232 return ret; 235 233 } 236 234 237 - ret = snd_soc_add_card_controls(card, realtek_4spk_kcontrols, 238 - num_codecs); 235 + ret = snd_soc_add_card_controls(card, realtek_4spk_kcontrols, num_codecs); 239 236 if (ret) { 240 237 dev_err(rtd->dev, "fail to add rt1011 controls, ret %d\n", 241 238 ret); 242 239 return ret; 243 240 } 244 241 245 - ret = snd_soc_dapm_add_routes(&card->dapm, rt1011_4spk_routes, 246 - num_codecs); 242 + ret = snd_soc_dapm_add_routes(dapm, rt1011_4spk_routes, num_codecs); 247 243 if (ret) { 248 244 dev_err(rtd->dev, "fail to add rt1011 routes, ret %d\n", 249 245 ret); ··· 342 344 static int rt1015p_init(struct snd_soc_pcm_runtime *rtd) 343 345 { 344 346 struct snd_soc_card *card = rtd->card; 347 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 345 348 int ret; 346 349 347 - ret = snd_soc_dapm_new_controls(&card->dapm, realtek_2spk_widgets, 350 + ret = snd_soc_dapm_new_controls(dapm, realtek_2spk_widgets, 348 351 ARRAY_SIZE(realtek_2spk_widgets)); 349 352 if (ret) { 350 353 dev_err(rtd->dev, "fail to add rt1015p widgets, ret %d\n", ret); ··· 359 360 return ret; 360 361 } 361 362 362 - ret = snd_soc_dapm_add_routes(&card->dapm, rt1015p_dapm_routes, 363 + ret = snd_soc_dapm_add_routes(dapm, rt1015p_dapm_routes, 363 364 ARRAY_SIZE(rt1015p_dapm_routes)); 364 365 if (ret) 365 366 dev_err(rtd->dev, "Speaker map addition failed: %d\n", ret); ··· 480 481 static int speaker_codec_init_lr(struct snd_soc_pcm_runtime *rtd) 481 482 { 482 483 struct snd_soc_card *card = rtd->card; 484 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 483 485 unsigned int num_codecs = get_num_codecs(RT1015_ACPI_HID); 484 486 int ret; 485 487 486 488 switch (num_codecs) { 487 489 case 2: 488 - ret = snd_soc_dapm_new_controls(&card->dapm, realtek_2spk_widgets, 490 + ret = snd_soc_dapm_new_controls(dapm, realtek_2spk_widgets, 489 491 ARRAY_SIZE(realtek_2spk_widgets)); 490 492 if (ret) { 491 493 dev_err(rtd->dev, "fail to add rt1015 widgets, ret %d\n", ··· 502 502 return ret; 503 503 } 504 504 505 - ret = snd_soc_dapm_add_routes(&rtd->card->dapm, speaker_map_lr, 505 + ret = snd_soc_dapm_add_routes(dapm, speaker_map_lr, 506 506 ARRAY_SIZE(speaker_map_lr)); 507 507 if (ret) { 508 508 dev_err(rtd->dev, "fail to add rt1015 routes, ret %d\n", ··· 561 561 static int rt1308_init(struct snd_soc_pcm_runtime *rtd) 562 562 { 563 563 struct snd_soc_card *card = rtd->card; 564 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 564 565 int ret; 565 566 566 - ret = snd_soc_dapm_new_controls(&card->dapm, rt1308_dapm_widgets, 567 + ret = snd_soc_dapm_new_controls(dapm, rt1308_dapm_widgets, 567 568 ARRAY_SIZE(rt1308_dapm_widgets)); 568 569 if (ret) { 569 570 dev_err(rtd->dev, "fail to add dapm controls, ret %d\n", ret); ··· 578 577 return ret; 579 578 } 580 579 581 - ret = snd_soc_dapm_add_routes(&card->dapm, rt1308_dapm_routes, 580 + ret = snd_soc_dapm_add_routes(dapm, rt1308_dapm_routes, 582 581 ARRAY_SIZE(rt1308_dapm_routes)); 583 582 584 583 if (ret) ··· 651 650 static int rt1019p_init(struct snd_soc_pcm_runtime *rtd) 652 651 { 653 652 struct snd_soc_card *card = rtd->card; 653 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 654 654 int ret; 655 655 656 - ret = snd_soc_dapm_new_controls(&card->dapm, realtek_2spk_widgets, 656 + ret = snd_soc_dapm_new_controls(dapm, realtek_2spk_widgets, 657 657 ARRAY_SIZE(realtek_2spk_widgets)); 658 658 if (ret) { 659 659 dev_err(rtd->dev, "fail to add rt1019p widgets, ret %d\n", ret); ··· 668 666 return ret; 669 667 } 670 668 671 - ret = snd_soc_dapm_add_routes(&card->dapm, rt1019p_dapm_routes, 669 + ret = snd_soc_dapm_add_routes(dapm, rt1019p_dapm_routes, 672 670 ARRAY_SIZE(rt1019p_dapm_routes)); 673 671 if (ret) { 674 672 dev_err(rtd->dev, "Speaker map addition failed: %d\n", ret);
+4 -3
sound/soc/intel/boards/sof_rt5682.c
··· 408 408 static int sof_card_late_probe(struct snd_soc_card *card) 409 409 { 410 410 struct sof_card_private *ctx = snd_soc_card_get_drvdata(card); 411 - struct snd_soc_dapm_context *dapm = &card->dapm; 411 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 412 412 int err; 413 413 414 414 if (ctx->amp_type == CODEC_MAX98373) { ··· 462 462 static int rt5650_spk_init(struct snd_soc_pcm_runtime *rtd) 463 463 { 464 464 struct snd_soc_card *card = rtd->card; 465 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 465 466 int ret; 466 467 467 - ret = snd_soc_dapm_new_controls(&card->dapm, rt5650_spk_widgets, 468 + ret = snd_soc_dapm_new_controls(dapm, rt5650_spk_widgets, 468 469 ARRAY_SIZE(rt5650_spk_widgets)); 469 470 if (ret) { 470 471 dev_err(rtd->dev, "fail to add rt5650 spk widgets, ret %d\n", ··· 481 480 return ret; 482 481 } 483 482 484 - ret = snd_soc_dapm_add_routes(&card->dapm, rt5650_spk_dapm_routes, 483 + ret = snd_soc_dapm_add_routes(dapm, rt5650_spk_dapm_routes, 485 484 ARRAY_SIZE(rt5650_spk_dapm_routes)); 486 485 if (ret) 487 486 dev_err(rtd->dev, "fail to add dapm routes, ret=%d\n", ret);
+4 -3
sound/soc/mediatek/common/mtk-afe-platform-driver.c
··· 48 48 49 49 int mtk_afe_add_sub_dai_control(struct snd_soc_component *component) 50 50 { 51 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 51 52 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(component); 52 53 struct mtk_base_afe_dai *dai; 53 54 ··· 59 58 dai->num_controls); 60 59 61 60 if (dai->dapm_widgets) 62 - snd_soc_dapm_new_controls(&component->dapm, 61 + snd_soc_dapm_new_controls(dapm, 63 62 dai->dapm_widgets, 64 63 dai->num_dapm_widgets); 65 64 } 66 65 /* add routes after all widgets are added */ 67 66 list_for_each_entry(dai, &afe->sub_dais, list) { 68 67 if (dai->dapm_routes) 69 - snd_soc_dapm_add_routes(&component->dapm, 68 + snd_soc_dapm_add_routes(dapm, 70 69 dai->dapm_routes, 71 70 dai->num_dapm_routes); 72 71 } 73 72 74 - snd_soc_dapm_new_widgets(component->dapm.card); 73 + snd_soc_dapm_new_widgets(component->card); 75 74 76 75 return 0; 77 76
+3 -2
sound/soc/mediatek/common/mtk-dsp-sof-common.c
··· 139 139 140 140 int mtk_sof_card_late_probe(struct snd_soc_card *card) 141 141 { 142 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 142 143 struct snd_soc_pcm_runtime *rtd; 143 144 struct snd_soc_component *sof_comp = NULL; 144 145 struct mtk_soc_card_data *soc_card_data = ··· 205 204 snd_soc_dapm_widget_for_each_sink_path(widget, p) { 206 205 route.source = conn->sof_dma; 207 206 route.sink = p->sink->name; 208 - snd_soc_dapm_add_routes(&card->dapm, &route, 1); 207 + snd_soc_dapm_add_routes(dapm, &route, 1); 209 208 } 210 209 } else if (conn->stream_dir == SNDRV_PCM_STREAM_PLAYBACK && widget) { 211 210 snd_soc_dapm_widget_for_each_source_path(widget, p) { 212 211 route.source = p->source->name; 213 212 route.sink = conn->sof_dma; 214 - snd_soc_dapm_add_routes(&card->dapm, &route, 1); 213 + snd_soc_dapm_add_routes(dapm, &route, 1); 215 214 } 216 215 } else { 217 216 dev_err(cpu_dai->dev, "stream dir and widget not pair\n");
+1 -1
sound/soc/mediatek/mt8186/mt8186-mt6366-common.c
··· 21 21 snd_soc_rtd_to_codec(rtd, 0)->component; 22 22 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt_afe); 23 23 struct mt8186_afe_private *afe_priv = afe->platform_priv; 24 - struct snd_soc_dapm_context *dapm = &rtd->card->dapm; 24 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(rtd->card); 25 25 int ret; 26 26 27 27 /* set mtkaif protocol */
+10 -9
sound/soc/mediatek/mt8186/mt8186-mt6366.c
··· 88 88 static int dmic_get(struct snd_kcontrol *kcontrol, 89 89 struct snd_ctl_elem_value *ucontrol) 90 90 { 91 - struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_dapm(kcontrol); 92 - struct mtk_soc_card_data *soc_card_data = 93 - snd_soc_card_get_drvdata(dapm->card); 91 + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol); 92 + struct snd_soc_card *card = snd_soc_dapm_to_card(dapm); 93 + struct mtk_soc_card_data *soc_card_data = snd_soc_card_get_drvdata(card); 94 94 struct mt8186_mt6366_rt1019_rt5682s_priv *priv = soc_card_data->mach_priv; 95 95 96 96 ucontrol->value.integer.value[0] = priv->dmic_switch; ··· 100 100 static int dmic_set(struct snd_kcontrol *kcontrol, 101 101 struct snd_ctl_elem_value *ucontrol) 102 102 { 103 - struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_dapm(kcontrol); 104 - struct mtk_soc_card_data *soc_card_data = 105 - snd_soc_card_get_drvdata(dapm->card); 103 + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol); 104 + struct snd_soc_card *card = snd_soc_dapm_to_card(dapm); 105 + struct mtk_soc_card_data *soc_card_data = snd_soc_card_get_drvdata(card); 106 106 struct mt8186_mt6366_rt1019_rt5682s_priv *priv = soc_card_data->mach_priv; 107 107 108 108 priv->dmic_switch = ucontrol->value.integer.value[0]; 109 109 if (priv->dmic_sel) { 110 110 gpiod_set_value(priv->dmic_sel, priv->dmic_switch); 111 - dev_dbg(dapm->card->dev, "dmic_set_value %d\n", 111 + dev_dbg(card->dev, "dmic_set_value %d\n", 112 112 priv->dmic_switch); 113 113 } 114 114 return 0; ··· 140 140 static int primary_codec_init(struct snd_soc_pcm_runtime *rtd) 141 141 { 142 142 struct snd_soc_card *card = rtd->card; 143 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 143 144 struct mtk_soc_card_data *soc_card_data = snd_soc_card_get_drvdata(card); 144 145 struct mt8186_mt6366_rt1019_rt5682s_priv *priv = soc_card_data->mach_priv; 145 146 int ret; ··· 157 156 return 0; 158 157 } 159 158 160 - ret = snd_soc_dapm_new_controls(&card->dapm, dmic_widgets, 159 + ret = snd_soc_dapm_new_controls(dapm, dmic_widgets, 161 160 ARRAY_SIZE(dmic_widgets)); 162 161 if (ret) { 163 162 dev_err(card->dev, "DMic widget addition failed: %d\n", ret); ··· 165 164 return ret; 166 165 } 167 166 168 - ret = snd_soc_dapm_add_routes(&card->dapm, dmic_map, 167 + ret = snd_soc_dapm_add_routes(dapm, dmic_map, 169 168 ARRAY_SIZE(dmic_map)); 170 169 171 170 if (ret)
+10 -7
sound/soc/mediatek/mt8188/mt8188-mt6359.c
··· 684 684 static int mt8188_dumb_amp_init(struct snd_soc_pcm_runtime *rtd) 685 685 { 686 686 struct snd_soc_card *card = rtd->card; 687 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 687 688 int ret = 0; 688 689 689 - ret = snd_soc_dapm_new_controls(&card->dapm, mt8188_dumb_spk_widgets, 690 + ret = snd_soc_dapm_new_controls(dapm, mt8188_dumb_spk_widgets, 690 691 ARRAY_SIZE(mt8188_dumb_spk_widgets)); 691 692 if (ret) { 692 693 dev_err(rtd->dev, "unable to add Dumb Speaker dapm, ret %d\n", ret); ··· 738 737 static int mt8188_max98390_codec_init(struct snd_soc_pcm_runtime *rtd) 739 738 { 740 739 struct snd_soc_card *card = rtd->card; 740 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 741 741 int ret; 742 742 743 743 /* add regular speakers dapm route */ 744 - ret = snd_soc_dapm_new_controls(&card->dapm, mt8188_dual_spk_widgets, 744 + ret = snd_soc_dapm_new_controls(dapm, mt8188_dual_spk_widgets, 745 745 ARRAY_SIZE(mt8188_dual_spk_widgets)); 746 746 if (ret) { 747 747 dev_err(rtd->dev, "unable to add Left/Right Speaker widget, ret %d\n", ret); ··· 760 758 return 0; 761 759 762 760 /* add widgets/controls/dapm for rear speakers */ 763 - ret = snd_soc_dapm_new_controls(&card->dapm, mt8188_rear_spk_widgets, 761 + ret = snd_soc_dapm_new_controls(dapm, mt8188_rear_spk_widgets, 764 762 ARRAY_SIZE(mt8188_rear_spk_widgets)); 765 763 if (ret) { 766 764 dev_err(rtd->dev, "unable to add Rear Speaker widget, ret %d\n", ret); ··· 781 779 static int mt8188_headset_codec_init(struct snd_soc_pcm_runtime *rtd) 782 780 { 783 781 struct snd_soc_card *card = rtd->card; 782 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 784 783 struct mtk_soc_card_data *soc_card_data = snd_soc_card_get_drvdata(rtd->card); 785 784 struct snd_soc_jack *jack = &soc_card_data->card_data->jacks[MT8188_JACK_HEADSET]; 786 785 struct snd_soc_component *component = snd_soc_rtd_to_codec(rtd, 0)->component; 787 786 struct mtk_platform_card_data *card_data = soc_card_data->card_data; 788 787 int ret; 789 788 790 - ret = snd_soc_dapm_new_controls(&card->dapm, mt8188_nau8825_widgets, 789 + ret = snd_soc_dapm_new_controls(dapm, mt8188_nau8825_widgets, 791 790 ARRAY_SIZE(mt8188_nau8825_widgets)); 792 791 if (ret) { 793 792 dev_err(rtd->dev, "unable to add nau8825 card widget, ret %d\n", ret); ··· 818 815 snd_jack_set_key(jack->jack, SND_JACK_BTN_0, KEY_PLAYPAUSE); 819 816 snd_jack_set_key(jack->jack, SND_JACK_BTN_1, KEY_VOLUMEUP); 820 817 snd_jack_set_key(jack->jack, SND_JACK_BTN_2, KEY_VOLUMEDOWN); 821 - snd_jack_set_key(jack->jack, SND_JACK_BTN_3, KEY_VOICECOMMAND); 818 + snd_jack_set_key(jack->jack, SND_JACK_BTN_3, KEY_VOICECOMMAND); 822 819 } else { 823 820 snd_jack_set_key(jack->jack, SND_JACK_BTN_0, KEY_PLAYPAUSE); 824 821 snd_jack_set_key(jack->jack, SND_JACK_BTN_1, KEY_VOICECOMMAND); 825 822 snd_jack_set_key(jack->jack, SND_JACK_BTN_2, KEY_VOLUMEUP); 826 - snd_jack_set_key(jack->jack, SND_JACK_BTN_3, KEY_VOLUMEDOWN); 823 + snd_jack_set_key(jack->jack, SND_JACK_BTN_3, KEY_VOLUMEDOWN); 827 824 } 828 - 825 + 829 826 ret = snd_soc_component_set_jack(component, jack, NULL); 830 827 831 828 if (ret) {
+13 -8
sound/soc/mediatek/mt8195/mt8195-mt6359.c
··· 451 451 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt_afe); 452 452 struct mt8195_afe_private *afe_priv = afe->platform_priv; 453 453 struct snd_soc_card *card = rtd->card; 454 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 454 455 int ret; 455 456 456 457 priv->i2so1_mclk = afe_priv->clk[MT8195_CLK_TOP_APLL12_DIV2]; ··· 478 477 return ret; 479 478 } 480 479 481 - ret = snd_soc_dapm_add_routes(&card->dapm, mt8195_rt5682_routes, 480 + ret = snd_soc_dapm_add_routes(dapm, mt8195_rt5682_routes, 482 481 ARRAY_SIZE(mt8195_rt5682_routes)); 483 482 if (ret) 484 483 dev_err(rtd->dev, "unable to add dapm routes, ret %d\n", ret); ··· 548 547 static int mt8195_rt1011_init(struct snd_soc_pcm_runtime *rtd) 549 548 { 550 549 struct snd_soc_card *card = rtd->card; 550 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 551 551 int ret; 552 552 553 - ret = snd_soc_dapm_new_controls(&card->dapm, mt8195_dual_speaker_widgets, 553 + ret = snd_soc_dapm_new_controls(dapm, mt8195_dual_speaker_widgets, 554 554 ARRAY_SIZE(mt8195_dual_speaker_widgets)); 555 555 if (ret) { 556 556 dev_err(rtd->dev, "unable to add dapm controls, ret %d\n", ret); ··· 566 564 return ret; 567 565 } 568 566 569 - ret = snd_soc_dapm_add_routes(&card->dapm, mt8195_rt1011_routes, 567 + ret = snd_soc_dapm_add_routes(dapm, mt8195_rt1011_routes, 570 568 ARRAY_SIZE(mt8195_rt1011_routes)); 571 569 if (ret) 572 570 dev_err(rtd->dev, "unable to add dapm routes, ret %d\n", ret); ··· 577 575 static int mt8195_dumb_amp_init(struct snd_soc_pcm_runtime *rtd) 578 576 { 579 577 struct snd_soc_card *card = rtd->card; 578 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 580 579 int ret; 581 580 582 - ret = snd_soc_dapm_new_controls(&card->dapm, mt8195_speaker_widgets, 581 + ret = snd_soc_dapm_new_controls(dapm, mt8195_speaker_widgets, 583 582 ARRAY_SIZE(mt8195_speaker_widgets)); 584 583 if (ret) { 585 584 dev_err(rtd->dev, "unable to add dapm controls, ret %d\n", ret); ··· 601 598 static int mt8195_rt1019_init(struct snd_soc_pcm_runtime *rtd) 602 599 { 603 600 struct snd_soc_card *card = rtd->card; 601 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 604 602 int ret; 605 603 606 604 ret = mt8195_dumb_amp_init(rtd); 607 605 if (ret) 608 606 return ret; 609 607 610 - ret = snd_soc_dapm_add_routes(&card->dapm, mt8195_rt1019_routes, 608 + ret = snd_soc_dapm_add_routes(dapm, mt8195_rt1019_routes, 611 609 ARRAY_SIZE(mt8195_rt1019_routes)); 612 610 if (ret) 613 611 dev_err(rtd->dev, "unable to add dapm routes, ret %d\n", ret); ··· 619 615 static int mt8195_max98390_init(struct snd_soc_pcm_runtime *rtd) 620 616 { 621 617 struct snd_soc_card *card = rtd->card; 618 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 622 619 int ret; 623 620 624 - ret = snd_soc_dapm_new_controls(&card->dapm, mt8195_dual_speaker_widgets, 621 + ret = snd_soc_dapm_new_controls(dapm, mt8195_dual_speaker_widgets, 625 622 ARRAY_SIZE(mt8195_dual_speaker_widgets)); 626 623 if (ret) { 627 624 dev_err(rtd->dev, "unable to add dapm controls, ret %d\n", ret); ··· 637 632 return ret; 638 633 } 639 634 640 - ret = snd_soc_dapm_add_routes(&card->dapm, mt8195_max98390_routes, 635 + ret = snd_soc_dapm_add_routes(dapm, mt8195_max98390_routes, 641 636 ARRAY_SIZE(mt8195_max98390_routes)); 642 637 if (ret) 643 638 dev_err(rtd->dev, "unable to add dapm routes, ret %d\n", ret); ··· 660 655 static int mt8195_set_bias_level_post(struct snd_soc_card *card, 661 656 struct snd_soc_dapm_context *dapm, enum snd_soc_bias_level level) 662 657 { 663 - struct snd_soc_component *component = dapm->component; 658 + struct snd_soc_component *component = snd_soc_dapm_to_component(dapm); 664 659 struct mtk_soc_card_data *soc_card_data = snd_soc_card_get_drvdata(card); 665 660 struct mt8195_mt6359_priv *priv = soc_card_data->mach_priv; 666 661 int ret;
+1 -2
sound/soc/mediatek/mt8365/mt8365-afe-pcm.c
··· 1256 1256 static int mt8365_afe_cm2_io_input_mux_put(struct snd_kcontrol *kcontrol, 1257 1257 struct snd_ctl_elem_value *ucontrol) 1258 1258 { 1259 - struct snd_soc_dapm_context *dapm = 1260 - snd_soc_dapm_kcontrol_dapm(kcontrol); 1259 + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol); 1261 1260 struct snd_soc_component *comp = snd_soc_dapm_to_component(dapm); 1262 1261 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(comp); 1263 1262 struct mt8365_afe_private *afe_priv = afe->platform_priv;
+2 -4
sound/soc/meson/aiu-acodec-ctrl.c
··· 31 31 static int aiu_acodec_ctrl_mux_put_enum(struct snd_kcontrol *kcontrol, 32 32 struct snd_ctl_elem_value *ucontrol) 33 33 { 34 - struct snd_soc_component *component = 35 - snd_soc_dapm_kcontrol_component(kcontrol); 36 - struct snd_soc_dapm_context *dapm = 37 - snd_soc_dapm_kcontrol_dapm(kcontrol); 34 + struct snd_soc_component *component = snd_soc_dapm_kcontrol_to_component(kcontrol); 35 + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol); 38 36 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; 39 37 unsigned int mux, changed; 40 38
+2 -4
sound/soc/meson/aiu-codec-ctrl.c
··· 23 23 static int aiu_codec_ctrl_mux_put_enum(struct snd_kcontrol *kcontrol, 24 24 struct snd_ctl_elem_value *ucontrol) 25 25 { 26 - struct snd_soc_component *component = 27 - snd_soc_dapm_kcontrol_component(kcontrol); 28 - struct snd_soc_dapm_context *dapm = 29 - snd_soc_dapm_kcontrol_dapm(kcontrol); 26 + struct snd_soc_component *component = snd_soc_dapm_kcontrol_to_component(kcontrol); 27 + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol); 30 28 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; 31 29 unsigned int mux, changed; 32 30
+2 -2
sound/soc/meson/axg-spdifout.c
··· 352 352 enum snd_soc_bias_level level) 353 353 { 354 354 struct axg_spdifout *priv = snd_soc_component_get_drvdata(component); 355 - enum snd_soc_bias_level now = 356 - snd_soc_component_get_bias_level(component); 355 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 356 + enum snd_soc_bias_level now = snd_soc_dapm_get_bias_level(dapm); 357 357 int ret = 0; 358 358 359 359 switch (level) {
+2 -2
sound/soc/meson/axg-tdm-interface.c
··· 479 479 enum snd_soc_bias_level level) 480 480 { 481 481 struct axg_tdm_iface *iface = snd_soc_component_get_drvdata(component); 482 - enum snd_soc_bias_level now = 483 - snd_soc_component_get_bias_level(component); 482 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 483 + enum snd_soc_bias_level now = snd_soc_dapm_get_bias_level(dapm); 484 484 int ret = 0; 485 485 486 486 switch (level) {
+2 -4
sound/soc/meson/g12a-toacodec.c
··· 63 63 static int g12a_toacodec_mux_put_enum(struct snd_kcontrol *kcontrol, 64 64 struct snd_ctl_elem_value *ucontrol) 65 65 { 66 - struct snd_soc_component *component = 67 - snd_soc_dapm_kcontrol_component(kcontrol); 66 + struct snd_soc_component *component = snd_soc_dapm_kcontrol_to_component(kcontrol); 68 67 struct g12a_toacodec *priv = snd_soc_component_get_drvdata(component); 69 - struct snd_soc_dapm_context *dapm = 70 - snd_soc_dapm_kcontrol_dapm(kcontrol); 68 + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol); 71 69 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; 72 70 unsigned int mux, reg; 73 71
+4 -8
sound/soc/meson/g12a-tohdmitx.c
··· 38 38 static int g12a_tohdmitx_i2s_mux_put_enum(struct snd_kcontrol *kcontrol, 39 39 struct snd_ctl_elem_value *ucontrol) 40 40 { 41 - struct snd_soc_component *component = 42 - snd_soc_dapm_kcontrol_component(kcontrol); 43 - struct snd_soc_dapm_context *dapm = 44 - snd_soc_dapm_kcontrol_dapm(kcontrol); 41 + struct snd_soc_component *component = snd_soc_dapm_kcontrol_to_component(kcontrol); 42 + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol); 45 43 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; 46 44 unsigned int mux, changed; 47 45 ··· 87 89 static int g12a_tohdmitx_spdif_mux_put_enum(struct snd_kcontrol *kcontrol, 88 90 struct snd_ctl_elem_value *ucontrol) 89 91 { 90 - struct snd_soc_component *component = 91 - snd_soc_dapm_kcontrol_component(kcontrol); 92 - struct snd_soc_dapm_context *dapm = 93 - snd_soc_dapm_kcontrol_dapm(kcontrol); 92 + struct snd_soc_component *component = snd_soc_dapm_kcontrol_to_component(kcontrol); 93 + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol); 94 94 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; 95 95 unsigned int mux, changed; 96 96
+2 -2
sound/soc/meson/t9015.c
··· 177 177 enum snd_soc_bias_level level) 178 178 { 179 179 struct t9015 *priv = snd_soc_component_get_drvdata(component); 180 - enum snd_soc_bias_level now = 181 - snd_soc_component_get_bias_level(component); 180 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 181 + enum snd_soc_bias_level now = snd_soc_dapm_get_bias_level(dapm); 182 182 int ret; 183 183 184 184 switch (level) {
+6 -3
sound/soc/pxa/spitz.c
··· 105 105 static int spitz_startup(struct snd_pcm_substream *substream) 106 106 { 107 107 struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); 108 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(rtd->card); 108 109 109 110 /* check the jack status at stream startup */ 110 - spitz_ext_control(&rtd->card->dapm); 111 + spitz_ext_control(dapm); 111 112 112 113 return 0; 113 114 } ··· 167 166 struct snd_ctl_elem_value *ucontrol) 168 167 { 169 168 struct snd_soc_card *card = snd_kcontrol_chip(kcontrol); 169 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 170 170 171 171 if (spitz_jack_func == ucontrol->value.enumerated.item[0]) 172 172 return 0; 173 173 174 174 spitz_jack_func = ucontrol->value.enumerated.item[0]; 175 - spitz_ext_control(&card->dapm); 175 + spitz_ext_control(dapm); 176 176 return 1; 177 177 } 178 178 ··· 188 186 struct snd_ctl_elem_value *ucontrol) 189 187 { 190 188 struct snd_soc_card *card = snd_kcontrol_chip(kcontrol); 189 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 191 190 192 191 if (spitz_spk_func == ucontrol->value.enumerated.item[0]) 193 192 return 0; 194 193 195 194 spitz_spk_func = ucontrol->value.enumerated.item[0]; 196 - spitz_ext_control(&card->dapm); 195 + spitz_ext_control(dapm); 197 196 return 1; 198 197 } 199 198
+2 -4
sound/soc/qcom/qdsp6/q6routing.c
··· 468 468 static int msm_routing_get_audio_mixer(struct snd_kcontrol *kcontrol, 469 469 struct snd_ctl_elem_value *ucontrol) 470 470 { 471 - struct snd_soc_dapm_context *dapm = 472 - snd_soc_dapm_kcontrol_dapm(kcontrol); 471 + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol); 473 472 struct soc_mixer_control *mc = 474 473 (struct soc_mixer_control *)kcontrol->private_value; 475 474 int session_id = mc->shift; ··· 487 488 static int msm_routing_put_audio_mixer(struct snd_kcontrol *kcontrol, 488 489 struct snd_ctl_elem_value *ucontrol) 489 490 { 490 - struct snd_soc_dapm_context *dapm = 491 - snd_soc_dapm_kcontrol_dapm(kcontrol); 491 + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol); 492 492 struct snd_soc_component *c = snd_soc_dapm_to_component(dapm); 493 493 struct msm_routing_data *data = dev_get_drvdata(c->dev); 494 494 struct soc_mixer_control *mc =
+2 -1
sound/soc/qcom/qdsp6/q6usb.c
··· 138 138 139 139 static int q6usb_get_pcm_id_from_widget(struct snd_soc_dapm_widget *w) 140 140 { 141 + struct snd_soc_card *card = snd_soc_dapm_to_card(w->dapm); 141 142 struct snd_soc_pcm_runtime *rtd; 142 143 struct snd_soc_dai *dai; 143 144 144 - for_each_card_rtds(w->dapm->card, rtd) { 145 + for_each_card_rtds(card, rtd) { 145 146 dai = snd_soc_rtd_to_cpu(rtd, 0); 146 147 /* 147 148 * Only look for playback widget. RTD number carries the assigned
+6 -6
sound/soc/qcom/qdsp6/topology.c
··· 1143 1143 struct snd_ctl_elem_value *ucontrol) 1144 1144 { 1145 1145 struct soc_mixer_control *mc = (struct soc_mixer_control *)kcontrol->private_value; 1146 - struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_dapm(kcontrol); 1147 - struct snd_soc_dapm_widget *dw = snd_soc_dapm_kcontrol_widget(kcontrol); 1146 + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol); 1147 + struct snd_soc_dapm_widget *dw = snd_soc_dapm_kcontrol_to_widget(kcontrol); 1148 1148 struct snd_soc_component *c = snd_soc_dapm_to_component(dapm); 1149 1149 struct snd_ar_control *dapm_scontrol = dw->dobj.private; 1150 1150 struct snd_ar_control *scontrol = mc->dobj.private; ··· 1164 1164 struct snd_ctl_elem_value *ucontrol) 1165 1165 { 1166 1166 struct soc_mixer_control *mc = (struct soc_mixer_control *)kcontrol->private_value; 1167 - struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_dapm(kcontrol); 1168 - struct snd_soc_dapm_widget *dw = snd_soc_dapm_kcontrol_widget(kcontrol); 1167 + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol); 1168 + struct snd_soc_dapm_widget *dw = snd_soc_dapm_kcontrol_to_widget(kcontrol); 1169 1169 struct snd_soc_component *c = snd_soc_dapm_to_component(dapm); 1170 1170 struct snd_ar_control *dapm_scontrol = dw->dobj.private; 1171 1171 struct snd_ar_control *scontrol = mc->dobj.private; ··· 1184 1184 static int audioreach_get_vol_ctrl_audio_mixer(struct snd_kcontrol *kcontrol, 1185 1185 struct snd_ctl_elem_value *ucontrol) 1186 1186 { 1187 - struct snd_soc_dapm_widget *dw = snd_soc_dapm_kcontrol_widget(kcontrol); 1187 + struct snd_soc_dapm_widget *dw = snd_soc_dapm_kcontrol_to_widget(kcontrol); 1188 1188 struct audioreach_module *mod = dw->dobj.private; 1189 1189 1190 1190 ucontrol->value.integer.value[0] = mod->gain; ··· 1195 1195 static int audioreach_put_vol_ctrl_audio_mixer(struct snd_kcontrol *kcontrol, 1196 1196 struct snd_ctl_elem_value *ucontrol) 1197 1197 { 1198 - struct snd_soc_dapm_widget *dw = snd_soc_dapm_kcontrol_widget(kcontrol); 1198 + struct snd_soc_dapm_widget *dw = snd_soc_dapm_kcontrol_to_widget(kcontrol); 1199 1199 struct audioreach_module *mod = dw->dobj.private; 1200 1200 1201 1201 mod->gain = ucontrol->value.integer.value[0];
+6 -4
sound/soc/qcom/sc7180.c
··· 287 287 static int dmic_get(struct snd_kcontrol *kcontrol, 288 288 struct snd_ctl_elem_value *ucontrol) 289 289 { 290 - struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_dapm(kcontrol); 291 - struct sc7180_snd_data *data = snd_soc_card_get_drvdata(dapm->card); 290 + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol); 291 + struct snd_soc_card *card = snd_soc_dapm_to_card(dapm); 292 + struct sc7180_snd_data *data = snd_soc_card_get_drvdata(card); 292 293 293 294 ucontrol->value.integer.value[0] = data->dmic_switch; 294 295 return 0; ··· 298 297 static int dmic_set(struct snd_kcontrol *kcontrol, 299 298 struct snd_ctl_elem_value *ucontrol) 300 299 { 301 - struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_dapm(kcontrol); 302 - struct sc7180_snd_data *data = snd_soc_card_get_drvdata(dapm->card); 300 + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol); 301 + struct snd_soc_card *card = snd_soc_dapm_to_card(dapm); 302 + struct sc7180_snd_data *data = snd_soc_card_get_drvdata(card); 303 303 304 304 data->dmic_switch = ucontrol->value.integer.value[0]; 305 305 gpiod_set_value(data->dmic_sel, data->dmic_switch);
+2 -1
sound/soc/rockchip/rk3288_hdmi_analog.c
··· 31 31 static int rk_hp_power(struct snd_soc_dapm_widget *w, 32 32 struct snd_kcontrol *k, int event) 33 33 { 34 - struct rk_drvdata *machine = snd_soc_card_get_drvdata(w->dapm->card); 34 + struct snd_soc_card *card = snd_soc_dapm_to_card(w->dapm); 35 + struct rk_drvdata *machine = snd_soc_card_get_drvdata(card); 35 36 36 37 gpiod_set_value_cansleep(machine->gpio_hp_en, 37 38 SND_SOC_DAPM_EVENT_ON(event));
+1 -1
sound/soc/rockchip/rockchip_max98090.c
··· 108 108 void *data) 109 109 { 110 110 struct snd_soc_jack *jack = (struct snd_soc_jack *)data; 111 - struct snd_soc_dapm_context *dapm = &jack->card->dapm; 111 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(jack->card); 112 112 113 113 if (event & SND_JACK_MICROPHONE) { 114 114 snd_soc_dapm_force_enable_pin(dapm, "MICBIAS");
+3 -3
sound/soc/samsung/aries_wm8994.c
··· 159 159 static int aries_spk_cfg(struct snd_soc_dapm_widget *w, 160 160 struct snd_kcontrol *kcontrol, int event) 161 161 { 162 - struct snd_soc_card *card = w->dapm->card; 162 + struct snd_soc_card *card = snd_soc_dapm_to_card(w->dapm); 163 163 struct snd_soc_pcm_runtime *rtd; 164 164 struct snd_soc_component *component; 165 165 int ret = 0; ··· 194 194 static int aries_main_bias(struct snd_soc_dapm_widget *w, 195 195 struct snd_kcontrol *kcontrol, int event) 196 196 { 197 - struct snd_soc_card *card = w->dapm->card; 197 + struct snd_soc_card *card = snd_soc_dapm_to_card(w->dapm); 198 198 struct aries_wm8994_data *priv = snd_soc_card_get_drvdata(card); 199 199 int ret = 0; 200 200 ··· 213 213 static int aries_headset_bias(struct snd_soc_dapm_widget *w, 214 214 struct snd_kcontrol *kcontrol, int event) 215 215 { 216 - struct snd_soc_card *card = w->dapm->card; 216 + struct snd_soc_card *card = snd_soc_dapm_to_card(w->dapm); 217 217 struct aries_wm8994_data *priv = snd_soc_card_get_drvdata(card); 218 218 int ret = 0; 219 219
+3 -3
sound/soc/samsung/bells.c
··· 62 62 codec_dai = snd_soc_rtd_to_codec(rtd, 0); 63 63 component = codec_dai->component; 64 64 65 - if (dapm->dev != codec_dai->dev) 65 + if (snd_soc_dapm_to_dev(dapm) != codec_dai->dev) 66 66 return 0; 67 67 68 68 switch (level) { 69 69 case SND_SOC_BIAS_PREPARE: 70 - if (dapm->bias_level != SND_SOC_BIAS_STANDBY) 70 + if (snd_soc_dapm_get_bias_level(dapm) != SND_SOC_BIAS_STANDBY) 71 71 break; 72 72 73 73 ret = snd_soc_component_set_pll(component, WM5102_FLL1, ··· 108 108 codec_dai = snd_soc_rtd_to_codec(rtd, 0); 109 109 component = codec_dai->component; 110 110 111 - if (dapm->dev != codec_dai->dev) 111 + if (snd_soc_dapm_to_dev(dapm) != codec_dai->dev) 112 112 return 0; 113 113 114 114 switch (level) {
+4 -4
sound/soc/samsung/littlemill.c
··· 24 24 rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[0]); 25 25 aif1_dai = snd_soc_rtd_to_codec(rtd, 0); 26 26 27 - if (dapm->dev != aif1_dai->dev) 27 + if (snd_soc_dapm_to_dev(dapm) != aif1_dai->dev) 28 28 return 0; 29 29 30 30 switch (level) { ··· 33 33 * If we've not already clocked things via hw_params() 34 34 * then do so now, otherwise these are noops. 35 35 */ 36 - if (dapm->bias_level == SND_SOC_BIAS_STANDBY) { 36 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_STANDBY) { 37 37 ret = snd_soc_dai_set_pll(aif1_dai, WM8994_FLL1, 38 38 WM8994_FLL_SRC_MCLK2, 32768, 39 39 sample_rate * 512); ··· 71 71 rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[0]); 72 72 aif1_dai = snd_soc_rtd_to_codec(rtd, 0); 73 73 74 - if (dapm->dev != aif1_dai->dev) 74 + if (snd_soc_dapm_to_dev(dapm) != aif1_dai->dev) 75 75 return 0; 76 76 77 77 switch (level) { ··· 173 173 static int bbclk_ev(struct snd_soc_dapm_widget *w, 174 174 struct snd_kcontrol *kcontrol, int event) 175 175 { 176 - struct snd_soc_card *card = w->dapm->card; 176 + struct snd_soc_card *card = snd_soc_dapm_to_card(w->dapm); 177 177 struct snd_soc_pcm_runtime *rtd; 178 178 struct snd_soc_dai *aif2_dai; 179 179 int ret;
+2 -1
sound/soc/samsung/lowland.c
··· 70 70 static int lowland_wm9081_init(struct snd_soc_pcm_runtime *rtd) 71 71 { 72 72 struct snd_soc_component *component = snd_soc_rtd_to_codec(rtd, 0)->component; 73 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(rtd->card); 73 74 74 - snd_soc_dapm_nc_pin(&rtd->card->dapm, "LINEOUT"); 75 + snd_soc_dapm_disable_pin(dapm, "LINEOUT"); 75 76 76 77 /* At any time the WM9081 is active it will have this clock */ 77 78 return snd_soc_component_set_sysclk(component, WM9081_SYSCLK_MCLK, 0,
+4 -4
sound/soc/samsung/midas_wm1811.c
··· 73 73 static int headset_jack_check(void *data) 74 74 { 75 75 struct snd_soc_component *codec = data; 76 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(codec); 76 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(codec); 77 77 struct midas_priv *priv = snd_soc_card_get_drvdata(codec->card); 78 78 int adc, ret; 79 79 int jack_type = 0; ··· 285 285 static int midas_fm_set(struct snd_soc_dapm_widget *w, 286 286 struct snd_kcontrol *kcontrol, int event) 287 287 { 288 - struct snd_soc_card *card = w->dapm->card; 288 + struct snd_soc_card *card = snd_soc_dapm_to_card(w->dapm); 289 289 struct midas_priv *priv = snd_soc_card_get_drvdata(card); 290 290 291 291 if (!priv->gpio_fm_sel) ··· 306 306 static int midas_line_set(struct snd_soc_dapm_widget *w, 307 307 struct snd_kcontrol *kcontrol, int event) 308 308 { 309 - struct snd_soc_card *card = w->dapm->card; 309 + struct snd_soc_card *card = snd_soc_dapm_to_card(w->dapm); 310 310 struct midas_priv *priv = snd_soc_card_get_drvdata(card); 311 311 312 312 if (!priv->gpio_lineout_sel) ··· 376 376 &card->dai_link[0]); 377 377 struct snd_soc_dai *aif1_dai = snd_soc_rtd_to_codec(rtd, 0); 378 378 379 - if (dapm->dev != aif1_dai->dev) 379 + if (snd_soc_dapm_to_dev(dapm) != aif1_dai->dev) 380 380 return 0; 381 381 382 382 switch (level) {
+15 -15
sound/soc/samsung/smdk_wm8994.c
··· 69 69 70 70 static int smdk_wm8994_init_paiftx(struct snd_soc_pcm_runtime *rtd) 71 71 { 72 - struct snd_soc_dapm_context *dapm = &rtd->card->dapm; 72 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(rtd->card); 73 73 74 74 /* Other pins NC */ 75 - snd_soc_dapm_nc_pin(dapm, "HPOUT2P"); 76 - snd_soc_dapm_nc_pin(dapm, "HPOUT2N"); 77 - snd_soc_dapm_nc_pin(dapm, "SPKOUTLN"); 78 - snd_soc_dapm_nc_pin(dapm, "SPKOUTLP"); 79 - snd_soc_dapm_nc_pin(dapm, "SPKOUTRP"); 80 - snd_soc_dapm_nc_pin(dapm, "SPKOUTRN"); 81 - snd_soc_dapm_nc_pin(dapm, "LINEOUT1N"); 82 - snd_soc_dapm_nc_pin(dapm, "LINEOUT1P"); 83 - snd_soc_dapm_nc_pin(dapm, "LINEOUT2N"); 84 - snd_soc_dapm_nc_pin(dapm, "LINEOUT2P"); 85 - snd_soc_dapm_nc_pin(dapm, "IN1LP"); 86 - snd_soc_dapm_nc_pin(dapm, "IN2LP:VXRN"); 87 - snd_soc_dapm_nc_pin(dapm, "IN1RP"); 88 - snd_soc_dapm_nc_pin(dapm, "IN2RP:VXRP"); 75 + snd_soc_dapm_disable_pin(dapm, "HPOUT2P"); 76 + snd_soc_dapm_disable_pin(dapm, "HPOUT2N"); 77 + snd_soc_dapm_disable_pin(dapm, "SPKOUTLN"); 78 + snd_soc_dapm_disable_pin(dapm, "SPKOUTLP"); 79 + snd_soc_dapm_disable_pin(dapm, "SPKOUTRP"); 80 + snd_soc_dapm_disable_pin(dapm, "SPKOUTRN"); 81 + snd_soc_dapm_disable_pin(dapm, "LINEOUT1N"); 82 + snd_soc_dapm_disable_pin(dapm, "LINEOUT1P"); 83 + snd_soc_dapm_disable_pin(dapm, "LINEOUT2N"); 84 + snd_soc_dapm_disable_pin(dapm, "LINEOUT2P"); 85 + snd_soc_dapm_disable_pin(dapm, "IN1LP"); 86 + snd_soc_dapm_disable_pin(dapm, "IN2LP:VXRN"); 87 + snd_soc_dapm_disable_pin(dapm, "IN1RP"); 88 + snd_soc_dapm_disable_pin(dapm, "IN2RP:VXRP"); 89 89 90 90 return 0; 91 91 }
+13 -11
sound/soc/samsung/speyside.c
··· 27 27 rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[1]); 28 28 codec_dai = snd_soc_rtd_to_codec(rtd, 0); 29 29 30 - if (dapm->dev != codec_dai->dev) 30 + if (snd_soc_dapm_to_dev(dapm) != codec_dai->dev) 31 31 return 0; 32 32 33 33 switch (level) { ··· 63 63 rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[1]); 64 64 codec_dai = snd_soc_rtd_to_codec(rtd, 0); 65 65 66 - if (dapm->dev != codec_dai->dev) 66 + if (snd_soc_dapm_to_dev(dapm) != codec_dai->dev) 67 67 return 0; 68 68 69 69 switch (level) { 70 70 case SND_SOC_BIAS_PREPARE: 71 - if (card->dapm.bias_level == SND_SOC_BIAS_STANDBY) { 71 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_STANDBY) { 72 72 ret = snd_soc_dai_set_pll(codec_dai, 0, 73 73 WM8996_FLL_MCLK2, 74 74 32768, MCLK_AUDIO_RATE); ··· 125 125 gpiod_direction_output(speyside_hpsel_gpio, speyside_jack_polarity); 126 126 127 127 /* Re-run DAPM to make sure we're using the correct mic bias */ 128 - snd_soc_dapm_sync(snd_soc_component_get_dapm(component)); 128 + snd_soc_dapm_sync(snd_soc_component_to_dapm(component)); 129 129 } 130 130 131 131 static int speyside_wm0010_init(struct snd_soc_pcm_runtime *rtd) ··· 177 177 178 178 static int speyside_late_probe(struct snd_soc_card *card) 179 179 { 180 - snd_soc_dapm_ignore_suspend(&card->dapm, "Headphone"); 181 - snd_soc_dapm_ignore_suspend(&card->dapm, "Headset Mic"); 182 - snd_soc_dapm_ignore_suspend(&card->dapm, "Main AMIC"); 183 - snd_soc_dapm_ignore_suspend(&card->dapm, "Main DMIC"); 184 - snd_soc_dapm_ignore_suspend(&card->dapm, "Main Speaker"); 185 - snd_soc_dapm_ignore_suspend(&card->dapm, "WM1250 Output"); 186 - snd_soc_dapm_ignore_suspend(&card->dapm, "WM1250 Input"); 180 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 181 + 182 + snd_soc_dapm_ignore_suspend(dapm, "Headphone"); 183 + snd_soc_dapm_ignore_suspend(dapm, "Headset Mic"); 184 + snd_soc_dapm_ignore_suspend(dapm, "Main AMIC"); 185 + snd_soc_dapm_ignore_suspend(dapm, "Main DMIC"); 186 + snd_soc_dapm_ignore_suspend(dapm, "Main Speaker"); 187 + snd_soc_dapm_ignore_suspend(dapm, "WM1250 Output"); 188 + snd_soc_dapm_ignore_suspend(dapm, "WM1250 Input"); 187 189 188 190 return 0; 189 191 }
+4 -3
sound/soc/samsung/tm2_wm5110.c
··· 260 260 static int tm2_mic_bias(struct snd_soc_dapm_widget *w, 261 261 struct snd_kcontrol *kcontrol, int event) 262 262 { 263 - struct snd_soc_card *card = w->dapm->card; 263 + struct snd_soc_card *card = snd_soc_dapm_to_card(w->dapm); 264 264 struct tm2_machine_priv *priv = snd_soc_card_get_drvdata(card); 265 265 266 266 switch (event) { ··· 279 279 struct snd_soc_dapm_context *dapm, 280 280 enum snd_soc_bias_level level) 281 281 { 282 + struct snd_soc_dapm_context *card_dapm = snd_soc_card_to_dapm(card); 282 283 struct snd_soc_pcm_runtime *rtd; 283 284 284 285 rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[0]); 285 286 286 - if (dapm->dev != snd_soc_rtd_to_codec(rtd, 0)->dev) 287 + if (snd_soc_dapm_to_dev(dapm) != snd_soc_rtd_to_codec(rtd, 0)->dev) 287 288 return 0; 288 289 289 290 switch (level) { 290 291 case SND_SOC_BIAS_STANDBY: 291 - if (card->dapm.bias_level == SND_SOC_BIAS_OFF) 292 + if (snd_soc_dapm_get_bias_level(card_dapm) == SND_SOC_BIAS_OFF) 292 293 tm2_start_sysclk(card); 293 294 break; 294 295 case SND_SOC_BIAS_OFF:
+3 -3
sound/soc/samsung/tobermory.c
··· 24 24 rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[0]); 25 25 codec_dai = snd_soc_rtd_to_codec(rtd, 0); 26 26 27 - if (dapm->dev != codec_dai->dev) 27 + if (snd_soc_dapm_to_dev(dapm) != codec_dai->dev) 28 28 return 0; 29 29 30 30 switch (level) { 31 31 case SND_SOC_BIAS_PREPARE: 32 - if (dapm->bias_level == SND_SOC_BIAS_STANDBY) { 32 + if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_STANDBY) { 33 33 ret = snd_soc_dai_set_pll(codec_dai, WM8962_FLL, 34 34 WM8962_FLL_MCLK, 32768, 35 35 sample_rate * 512); ··· 67 67 rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[0]); 68 68 codec_dai = snd_soc_rtd_to_codec(rtd, 0); 69 69 70 - if (dapm->dev != codec_dai->dev) 70 + if (snd_soc_dapm_to_dev(dapm) != codec_dai->dev) 71 71 return 0; 72 72 73 73 switch (level) {
+2 -2
sound/soc/sdca/sdca_asoc.c
··· 337 337 static int entity_pde_event(struct snd_soc_dapm_widget *widget, 338 338 struct snd_kcontrol *kctl, int event) 339 339 { 340 - struct snd_soc_component *component = widget->dapm->component; 340 + struct snd_soc_component *component = snd_soc_dapm_to_component(widget->dapm); 341 341 struct sdca_entity *entity = widget->priv; 342 342 static const int polls = 100; 343 343 unsigned int reg, val; ··· 655 655 static int entity_cs_event(struct snd_soc_dapm_widget *widget, 656 656 struct snd_kcontrol *kctl, int event) 657 657 { 658 - struct snd_soc_component *component = widget->dapm->component; 658 + struct snd_soc_component *component = snd_soc_dapm_to_component(widget->dapm); 659 659 struct sdca_entity *entity = widget->priv; 660 660 661 661 if (!component)
+3 -2
sound/soc/sdw_utils/soc_sdw_bridge_cs35l56.c
··· 33 33 static int asoc_sdw_bridge_cs35l56_asp_init(struct snd_soc_pcm_runtime *rtd) 34 34 { 35 35 struct snd_soc_card *card = rtd->card; 36 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 36 37 int i, ret; 37 38 unsigned int rx_mask = 3; // ASP RX1, RX2 38 39 unsigned int tx_mask = 3; // ASP TX1, TX2 ··· 46 45 if (!card->components) 47 46 return -ENOMEM; 48 47 49 - ret = snd_soc_dapm_new_controls(&card->dapm, bridge_widgets, 48 + ret = snd_soc_dapm_new_controls(dapm, bridge_widgets, 50 49 ARRAY_SIZE(bridge_widgets)); 51 50 if (ret) { 52 51 dev_err(card->dev, "widgets addition failed: %d\n", ret); 53 52 return ret; 54 53 } 55 54 56 - ret = snd_soc_dapm_add_routes(&card->dapm, bridge_map, ARRAY_SIZE(bridge_map)); 55 + ret = snd_soc_dapm_add_routes(dapm, bridge_map, ARRAY_SIZE(bridge_map)); 57 56 if (ret) { 58 57 dev_err(card->dev, "map addition failed: %d\n", ret); 59 58 return ret;
+2 -1
sound/soc/sdw_utils/soc_sdw_cs42l42.c
··· 40 40 int asoc_sdw_cs42l42_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai) 41 41 { 42 42 struct snd_soc_card *card = rtd->card; 43 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 43 44 struct asoc_sdw_mc_private *ctx = snd_soc_card_get_drvdata(card); 44 45 struct snd_soc_component *component; 45 46 struct snd_soc_jack *jack; ··· 53 52 if (!card->components) 54 53 return -ENOMEM; 55 54 56 - ret = snd_soc_dapm_add_routes(&card->dapm, cs42l42_map, 55 + ret = snd_soc_dapm_add_routes(dapm, cs42l42_map, 57 56 ARRAY_SIZE(cs42l42_map)); 58 57 59 58 if (ret) {
+6 -3
sound/soc/sdw_utils/soc_sdw_cs42l43.c
··· 58 58 struct asoc_sdw_mc_private *ctx = snd_soc_card_get_drvdata(rtd->card); 59 59 struct snd_soc_jack *jack = &ctx->sdw_headset; 60 60 struct snd_soc_card *card = rtd->card; 61 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 61 62 int ret; 62 63 63 64 card->components = devm_kasprintf(card->dev, GFP_KERNEL, "%s hs:cs42l43", ··· 66 65 if (!card->components) 67 66 return -ENOMEM; 68 67 69 - ret = snd_soc_dapm_add_routes(&card->dapm, cs42l43_hs_map, 68 + ret = snd_soc_dapm_add_routes(dapm, cs42l43_hs_map, 70 69 ARRAY_SIZE(cs42l43_hs_map)); 71 70 if (ret) { 72 71 dev_err(card->dev, "cs42l43 hs map addition failed: %d\n", ret); ··· 108 107 int asoc_sdw_cs42l43_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai) 109 108 { 110 109 struct snd_soc_card *card = rtd->card; 110 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 111 111 struct asoc_sdw_mc_private *ctx = snd_soc_card_get_drvdata(card); 112 112 int ret; 113 113 ··· 129 127 dev_info(card->dev, "Setting CS42L43 Speaker volume limit to %d\n", 130 128 CS42L43_SPK_VOLUME_0DB); 131 129 132 - ret = snd_soc_dapm_add_routes(&card->dapm, cs42l43_spk_map, 130 + ret = snd_soc_dapm_add_routes(dapm, cs42l43_spk_map, 133 131 ARRAY_SIZE(cs42l43_spk_map)); 134 132 if (ret) 135 133 dev_err(card->dev, "cs42l43 speaker map addition failed: %d\n", ret); ··· 156 154 int asoc_sdw_cs42l43_dmic_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai) 157 155 { 158 156 struct snd_soc_card *card = rtd->card; 157 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 159 158 int ret; 160 159 161 160 card->components = devm_kasprintf(card->dev, GFP_KERNEL, "%s mic:cs42l43-dmic", ··· 164 161 if (!card->components) 165 162 return -ENOMEM; 166 163 167 - ret = snd_soc_dapm_add_routes(&card->dapm, cs42l43_dmic_map, 164 + ret = snd_soc_dapm_add_routes(dapm, cs42l43_dmic_map, 168 165 ARRAY_SIZE(cs42l43_dmic_map)); 169 166 if (ret) 170 167 dev_err(card->dev, "cs42l43 dmic map addition failed: %d\n", ret);
+2 -1
sound/soc/sdw_utils/soc_sdw_cs_amp.c
··· 38 38 int asoc_sdw_cs_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai) 39 39 { 40 40 struct snd_soc_card *card = rtd->card; 41 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 41 42 char widget_name[16]; 42 43 struct snd_soc_dapm_route route = { "Speaker", NULL, widget_name }; 43 44 struct snd_soc_dai *codec_dai; ··· 55 54 if (ret) 56 55 return ret; 57 56 58 - ret = snd_soc_dapm_add_routes(&card->dapm, &route, 1); 57 + ret = snd_soc_dapm_add_routes(dapm, &route, 1); 59 58 if (ret) 60 59 return ret; 61 60 }
+3 -2
sound/soc/sdw_utils/soc_sdw_dmic.c
··· 24 24 int asoc_sdw_dmic_init(struct snd_soc_pcm_runtime *rtd) 25 25 { 26 26 struct snd_soc_card *card = rtd->card; 27 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 27 28 int ret; 28 29 29 - ret = snd_soc_dapm_new_controls(&card->dapm, dmic_widgets, 30 + ret = snd_soc_dapm_new_controls(dapm, dmic_widgets, 30 31 ARRAY_SIZE(dmic_widgets)); 31 32 if (ret) { 32 33 dev_err(card->dev, "DMic widget addition failed: %d\n", ret); ··· 35 34 return ret; 36 35 } 37 36 38 - ret = snd_soc_dapm_add_routes(&card->dapm, dmic_map, 37 + ret = snd_soc_dapm_add_routes(dapm, dmic_map, 39 38 ARRAY_SIZE(dmic_map)); 40 39 41 40 if (ret)
+4 -4
sound/soc/sdw_utils/soc_sdw_maxim.c
··· 26 26 int asoc_sdw_maxim_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai) 27 27 { 28 28 struct snd_soc_card *card = rtd->card; 29 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 29 30 int ret; 30 31 31 - ret = snd_soc_dapm_add_routes(&card->dapm, max_98373_dapm_routes, 2); 32 + ret = snd_soc_dapm_add_routes(dapm, max_98373_dapm_routes, 2); 32 33 if (ret) 33 34 dev_err(rtd->dev, "failed to add first SPK map: %d\n", ret); 34 35 ··· 51 50 52 51 cpu_dai = snd_soc_rtd_to_cpu(rtd, 0); 53 52 for_each_rtd_codec_dais(rtd, j, codec_dai) { 54 - struct snd_soc_dapm_context *dapm = 55 - snd_soc_component_get_dapm(cpu_dai->component); 53 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(cpu_dai->component); 56 54 char pin_name[16]; 57 55 58 56 snprintf(pin_name, ARRAY_SIZE(pin_name), "%s Spk", ··· 104 104 105 105 static int asoc_sdw_mx8373_sdw_late_probe(struct snd_soc_card *card) 106 106 { 107 - struct snd_soc_dapm_context *dapm = &card->dapm; 107 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 108 108 109 109 /* Disable Left and Right Spk pin after boot */ 110 110 snd_soc_dapm_disable_pin(dapm, "Left Spk");
+2 -1
sound/soc/sdw_utils/soc_sdw_rt5682.c
··· 40 40 int asoc_sdw_rt5682_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai) 41 41 { 42 42 struct snd_soc_card *card = rtd->card; 43 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 43 44 struct asoc_sdw_mc_private *ctx = snd_soc_card_get_drvdata(card); 44 45 struct snd_soc_component *component; 45 46 struct snd_soc_jack *jack; ··· 53 52 if (!card->components) 54 53 return -ENOMEM; 55 54 56 - ret = snd_soc_dapm_add_routes(&card->dapm, rt5682_map, 55 + ret = snd_soc_dapm_add_routes(dapm, rt5682_map, 57 56 ARRAY_SIZE(rt5682_map)); 58 57 59 58 if (ret) {
+2 -1
sound/soc/sdw_utils/soc_sdw_rt700.c
··· 38 38 int asoc_sdw_rt700_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai) 39 39 { 40 40 struct snd_soc_card *card = rtd->card; 41 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 41 42 struct asoc_sdw_mc_private *ctx = snd_soc_card_get_drvdata(card); 42 43 struct snd_soc_component *component; 43 44 struct snd_soc_jack *jack; ··· 51 50 if (!card->components) 52 51 return -ENOMEM; 53 52 54 - ret = snd_soc_dapm_add_routes(&card->dapm, rt700_map, 53 + ret = snd_soc_dapm_add_routes(dapm, rt700_map, 55 54 ARRAY_SIZE(rt700_map)); 56 55 57 56 if (ret) {
+2 -1
sound/soc/sdw_utils/soc_sdw_rt711.c
··· 64 64 int asoc_sdw_rt711_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai) 65 65 { 66 66 struct snd_soc_card *card = rtd->card; 67 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 67 68 struct asoc_sdw_mc_private *ctx = snd_soc_card_get_drvdata(card); 68 69 struct snd_soc_component *component; 69 70 struct snd_soc_jack *jack; ··· 77 76 if (!card->components) 78 77 return -ENOMEM; 79 78 80 - ret = snd_soc_dapm_add_routes(&card->dapm, rt711_map, 79 + ret = snd_soc_dapm_add_routes(dapm, rt711_map, 81 80 ARRAY_SIZE(rt711_map)); 82 81 83 82 if (ret) {
+3 -2
sound/soc/sdw_utils/soc_sdw_rt_amp.c
··· 187 187 int asoc_sdw_rt_amp_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai) 188 188 { 189 189 struct snd_soc_card *card = rtd->card; 190 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 190 191 const struct snd_soc_dapm_route *rt_amp_map; 191 192 char codec_name[CODEC_NAME_SIZE]; 192 193 struct snd_soc_dai *codec_dai; ··· 198 197 199 198 for_each_rtd_codec_dais(rtd, i, codec_dai) { 200 199 if (strstr(codec_dai->component->name_prefix, "-1")) 201 - ret = snd_soc_dapm_add_routes(&card->dapm, rt_amp_map, 2); 200 + ret = snd_soc_dapm_add_routes(dapm, rt_amp_map, 2); 202 201 else if (strstr(codec_dai->component->name_prefix, "-2")) 203 - ret = snd_soc_dapm_add_routes(&card->dapm, rt_amp_map + 2, 2); 202 + ret = snd_soc_dapm_add_routes(dapm, rt_amp_map + 2, 2); 204 203 } 205 204 206 205 return ret;
+2 -1
sound/soc/sdw_utils/soc_sdw_rt_mf_sdca.c
··· 59 59 int asoc_sdw_rt_mf_sdca_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai) 60 60 { 61 61 struct snd_soc_card *card = rtd->card; 62 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 62 63 char codec_name[CODEC_NAME_SIZE]; 63 64 int ret; 64 65 ··· 75 74 } 76 75 77 76 /* Add routes */ 78 - ret = snd_soc_dapm_add_routes(&card->dapm, route_map->route_map, route_map->route_size); 77 + ret = snd_soc_dapm_add_routes(dapm, route_map->route_map, route_map->route_size); 79 78 if (ret) 80 79 dev_err(rtd->dev, "failed to add rt sdca spk map: %d\n", ret); 81 80
+6 -5
sound/soc/sdw_utils/soc_sdw_rt_sdca_jack_common.c
··· 93 93 int asoc_sdw_rt_sdca_jack_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai) 94 94 { 95 95 struct snd_soc_card *card = rtd->card; 96 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 96 97 struct asoc_sdw_mc_private *ctx = snd_soc_card_get_drvdata(card); 97 98 struct snd_soc_component *component; 98 99 struct snd_soc_jack *jack; ··· 119 118 } 120 119 121 120 if (strstr(component->name_prefix, "rt711")) { 122 - ret = snd_soc_dapm_add_routes(&card->dapm, rt711_sdca_map, 121 + ret = snd_soc_dapm_add_routes(dapm, rt711_sdca_map, 123 122 ARRAY_SIZE(rt711_sdca_map)); 124 123 } else if (strstr(component->name_prefix, "rt712")) { 125 - ret = snd_soc_dapm_add_routes(&card->dapm, rt712_sdca_map, 124 + ret = snd_soc_dapm_add_routes(dapm, rt712_sdca_map, 126 125 ARRAY_SIZE(rt712_sdca_map)); 127 126 } else if (strstr(component->name_prefix, "rt713")) { 128 - ret = snd_soc_dapm_add_routes(&card->dapm, rt713_sdca_map, 127 + ret = snd_soc_dapm_add_routes(dapm, rt713_sdca_map, 129 128 ARRAY_SIZE(rt713_sdca_map)); 130 129 } else if (strstr(component->name_prefix, "rt721")) { 131 - ret = snd_soc_dapm_add_routes(&card->dapm, rt721_sdca_map, 130 + ret = snd_soc_dapm_add_routes(dapm, rt721_sdca_map, 132 131 ARRAY_SIZE(rt721_sdca_map)); 133 132 } else if (strstr(component->name_prefix, "rt722")) { 134 - ret = snd_soc_dapm_add_routes(&card->dapm, rt722_sdca_map, 133 + ret = snd_soc_dapm_add_routes(dapm, rt722_sdca_map, 135 134 ARRAY_SIZE(rt722_sdca_map)); 136 135 } else { 137 136 dev_err(card->dev, "%s is not supported\n", component->name_prefix);
+2 -1
sound/soc/sdw_utils/soc_sdw_ti_amp.c
··· 41 41 struct snd_soc_dai *dai) 42 42 { 43 43 struct snd_soc_card *card = rtd->card; 44 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 44 45 char widget_name[16]; 45 46 char speaker[16]; 46 47 struct snd_soc_dapm_route route = {speaker, NULL, widget_name}; ··· 69 68 if (ret) 70 69 return ret; 71 70 72 - ret = snd_soc_dapm_add_routes(&card->dapm, &route, 1); 71 + ret = snd_soc_dapm_add_routes(dapm, &route, 1); 73 72 if (ret) 74 73 return ret; 75 74 }
+2 -1
sound/soc/sdw_utils/soc_sdw_utils.c
··· 837 837 int asoc_sdw_rtd_init(struct snd_soc_pcm_runtime *rtd) 838 838 { 839 839 struct snd_soc_card *card = rtd->card; 840 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 840 841 struct asoc_sdw_codec_info *codec_info; 841 842 struct snd_soc_dai *dai; 842 843 const char *spk_components=""; ··· 877 876 } 878 877 } 879 878 if (codec_info->dais[dai_index].widgets) { 880 - ret = snd_soc_dapm_new_controls(&card->dapm, 879 + ret = snd_soc_dapm_new_controls(dapm, 881 880 codec_info->dais[dai_index].widgets, 882 881 codec_info->dais[dai_index].num_widgets); 883 882 if (ret) {
+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)
+116 -80
sound/soc/soc-dapm.c
··· 193 193 194 194 static void dapm_mark_dirty(struct snd_soc_dapm_widget *w, const char *reason) 195 195 { 196 + struct device *dev = snd_soc_dapm_to_dev(w->dapm); 197 + 196 198 dapm_assert_locked(w->dapm); 197 199 198 200 if (!dapm_dirty_widget(w)) { 199 - dev_vdbg(w->dapm->dev, "Marking %s dirty due to %s\n", 201 + dev_vdbg(dev, "Marking %s dirty due to %s\n", 200 202 w->name, reason); 201 203 list_add_tail(&w->dirty, &w->dapm->card->dapm_dirty); 202 204 } ··· 534 532 struct snd_soc_dapm_widget *source, struct snd_soc_dapm_widget *sink, 535 533 const char *control) 536 534 { 535 + struct device *dev = snd_soc_dapm_to_dev(dapm); 537 536 bool dynamic_source = false; 538 537 bool dynamic_sink = false; 539 538 ··· 561 558 } 562 559 563 560 if (dynamic_source && dynamic_sink) { 564 - dev_err(dapm->dev, 561 + dev_err(dev, 565 562 "Direct connection between demux and mixer/mux not supported for path %s -> [%s] -> %s\n", 566 563 source->name, control, sink->name); 567 564 return -EINVAL; 568 565 } else if (!dynamic_source && !dynamic_sink) { 569 - dev_err(dapm->dev, 566 + dev_err(dev, 570 567 "Control not supported for path %s -> [%s] -> %s\n", 571 568 source->name, control, sink->name); 572 569 return -EINVAL; ··· 582 579 int (*connected)(struct snd_soc_dapm_widget *source, 583 580 struct snd_soc_dapm_widget *sink)) 584 581 { 582 + struct device *dev = snd_soc_dapm_to_dev(dapm); 585 583 enum snd_soc_dapm_direction dir; 586 584 struct snd_soc_dapm_path *path; 587 585 int ret; 588 586 589 587 if (wsink->is_supply && !wsource->is_supply) { 590 - dev_err(dapm->dev, 588 + dev_err(dev, 591 589 "Connecting non-supply widget to supply widget is not supported (%s -> %s)\n", 592 590 wsource->name, wsink->name); 593 591 return -EINVAL; 594 592 } 595 593 596 594 if (connected && !wsource->is_supply) { 597 - dev_err(dapm->dev, 595 + dev_err(dev, 598 596 "connected() callback only supported for supply widgets (%s -> %s)\n", 599 597 wsource->name, wsink->name); 600 598 return -EINVAL; 601 599 } 602 600 603 601 if (wsource->is_supply && control) { 604 - dev_err(dapm->dev, 602 + dev_err(dev, 605 603 "Conditional paths are not supported for supply widgets (%s -> [%s] -> %s)\n", 606 604 wsource->name, control, wsink->name); 607 605 return -EINVAL; ··· 680 676 static int dapm_kcontrol_data_alloc(struct snd_soc_dapm_widget *widget, 681 677 struct snd_kcontrol *kcontrol, const char *ctrl_name) 682 678 { 679 + struct device *dev = snd_soc_dapm_to_dev(widget->dapm); 683 680 struct dapm_kcontrol_data *data; 684 681 struct soc_mixer_control *mc; 685 682 struct soc_enum *e; ··· 703 698 struct snd_soc_dapm_widget template; 704 699 705 700 if (snd_soc_volsw_is_stereo(mc)) 706 - dev_warn(widget->dapm->dev, 701 + dev_warn(dev, 707 702 "ASoC: Unsupported stereo autodisable control '%s'\n", 708 703 ctrl_name); 709 704 ··· 1138 1133 int kci) 1139 1134 { 1140 1135 struct snd_soc_dapm_context *dapm = w->dapm; 1136 + struct device *dev = snd_soc_dapm_to_dev(dapm); 1141 1137 struct snd_card *card = dapm->card->snd_card; 1142 1138 const char *prefix; 1143 1139 size_t prefix_len; ··· 1227 1221 1228 1222 ret = snd_ctl_add(card, kcontrol); 1229 1223 if (ret < 0) { 1230 - dev_err(dapm->dev, 1224 + dev_err(dev, 1231 1225 "ASoC: failed to add widget %s dapm kcontrol %s: %d\n", 1232 1226 w->name, name, ret); 1233 1227 goto exit_free; ··· 1283 1277 static int dapm_new_mux(struct snd_soc_dapm_widget *w) 1284 1278 { 1285 1279 struct snd_soc_dapm_context *dapm = w->dapm; 1280 + struct device *dev = snd_soc_dapm_to_dev(dapm); 1286 1281 enum snd_soc_dapm_direction dir; 1287 1282 struct snd_soc_dapm_path *path; 1288 1283 const char *type; ··· 1303 1296 } 1304 1297 1305 1298 if (w->num_kcontrols != 1) { 1306 - dev_err(dapm->dev, 1299 + dev_err(dev, 1307 1300 "ASoC: %s %s has incorrect number of controls\n", type, 1308 1301 w->name); 1309 1302 return -EINVAL; 1310 1303 } 1311 1304 1312 1305 if (list_empty(&w->edges[dir])) { 1313 - dev_err(dapm->dev, "ASoC: %s %s has no paths\n", type, w->name); 1306 + dev_err(dev, "ASoC: %s %s has no paths\n", type, w->name); 1314 1307 return -EINVAL; 1315 1308 } 1316 1309 ··· 1353 1346 /* add kcontrol */ 1354 1347 for (i = 0; i < w->num_kcontrols; i++) { 1355 1348 struct snd_soc_dapm_context *dapm = w->dapm; 1349 + struct device *dev = snd_soc_dapm_to_dev(dapm); 1356 1350 struct snd_card *card = dapm->card->snd_card; 1357 1351 struct snd_kcontrol *kcontrol = snd_soc_cnew(&w->kcontrol_news[i], 1358 1352 w, w->name, NULL); 1359 1353 int ret = snd_ctl_add(card, kcontrol); 1360 1354 1361 1355 if (ret < 0) { 1362 - dev_err(dapm->dev, 1356 + dev_err(dev, 1363 1357 "ASoC: failed to add widget %s dapm kcontrol %s: %d\n", 1364 1358 w->name, w->kcontrol_news[i].name, ret); 1365 1359 return ret; ··· 1378 1370 */ 1379 1371 static int snd_soc_dapm_suspend_check(struct snd_soc_dapm_widget *widget) 1380 1372 { 1373 + struct device *dev = snd_soc_dapm_to_dev(widget->dapm); 1381 1374 int level = snd_power_get_state(widget->dapm->card->snd_card); 1382 1375 1383 1376 switch (level) { 1384 1377 case SNDRV_CTL_POWER_D3hot: 1385 1378 case SNDRV_CTL_POWER_D3cold: 1386 1379 if (widget->ignore_suspend) 1387 - dev_dbg(widget->dapm->dev, "ASoC: %s ignoring suspend\n", 1380 + dev_dbg(dev, "ASoC: %s ignoring suspend\n", 1388 1381 widget->name); 1389 1382 return widget->ignore_suspend; 1390 1383 default: ··· 1616 1607 int snd_soc_dapm_regulator_event(struct snd_soc_dapm_widget *w, 1617 1608 struct snd_kcontrol *kcontrol, int event) 1618 1609 { 1610 + struct device *dev = snd_soc_dapm_to_dev(w->dapm); 1619 1611 int ret; 1620 1612 1621 1613 soc_dapm_async_complete(w->dapm); ··· 1625 1615 if (w->on_val & SND_SOC_DAPM_REGULATOR_BYPASS) { 1626 1616 ret = regulator_allow_bypass(w->regulator, false); 1627 1617 if (ret != 0) 1628 - dev_warn(w->dapm->dev, 1618 + dev_warn(dev, 1629 1619 "ASoC: Failed to unbypass %s: %d\n", 1630 1620 w->name, ret); 1631 1621 } ··· 1635 1625 if (w->on_val & SND_SOC_DAPM_REGULATOR_BYPASS) { 1636 1626 ret = regulator_allow_bypass(w->regulator, true); 1637 1627 if (ret != 0) 1638 - dev_warn(w->dapm->dev, 1628 + dev_warn(dev, 1639 1629 "ASoC: Failed to bypass %s: %d\n", 1640 1630 w->name, ret); 1641 1631 } ··· 1798 1788 static void dapm_seq_check_event(struct snd_soc_card *card, 1799 1789 struct snd_soc_dapm_widget *w, int event) 1800 1790 { 1791 + struct device *dev = card->dev; 1801 1792 const char *ev_name; 1802 1793 int power; 1803 1794 ··· 1838 1827 if (w->event && (w->event_flags & event)) { 1839 1828 int ret; 1840 1829 1841 - pop_dbg(w->dapm->dev, card->pop_time, "pop test : %s %s\n", 1830 + pop_dbg(dev, card->pop_time, "pop test : %s %s\n", 1842 1831 w->name, ev_name); 1843 1832 soc_dapm_async_complete(w->dapm); 1844 1833 trace_snd_soc_dapm_widget_event_start(w, event); 1845 1834 ret = w->event(w, NULL, event); 1846 1835 trace_snd_soc_dapm_widget_event_done(w, event); 1847 1836 if (ret < 0) 1848 - dev_err(w->dapm->dev, "ASoC: %s: %s event failed: %d\n", 1837 + dev_err(dev, "ASoC: %s: %s event failed: %d\n", 1849 1838 ev_name, w->name, ret); 1850 1839 } 1851 1840 } ··· 1854 1843 static void dapm_seq_run_coalesced(struct snd_soc_card *card, 1855 1844 struct list_head *pending) 1856 1845 { 1846 + struct device *dev = card->dev; 1857 1847 struct snd_soc_dapm_context *dapm; 1858 1848 struct snd_soc_dapm_widget *w; 1859 1849 int reg; ··· 1875 1863 else 1876 1864 value |= w->off_val << w->shift; 1877 1865 1878 - pop_dbg(dapm->dev, card->pop_time, 1866 + pop_dbg(dev, card->pop_time, 1879 1867 "pop test : Queue %s: reg=0x%x, 0x%x/0x%x\n", 1880 1868 w->name, reg, value, mask); 1881 1869 ··· 1889 1877 * same register. 1890 1878 */ 1891 1879 1892 - pop_dbg(dapm->dev, card->pop_time, 1880 + pop_dbg(dev, card->pop_time, 1893 1881 "pop test : Applying 0x%x/0x%x to %x in %dms\n", 1894 1882 value, mask, reg, card->pop_time); 1895 1883 pop_wait(card->pop_time); ··· 1913 1901 static void dapm_seq_run(struct snd_soc_card *card, 1914 1902 struct list_head *list, int event, bool power_up) 1915 1903 { 1904 + struct device *dev = card->dev; 1916 1905 struct snd_soc_dapm_widget *w, *n; 1917 1906 struct snd_soc_dapm_context *d; 1918 1907 LIST_HEAD(pending); ··· 1992 1979 } 1993 1980 1994 1981 if (ret < 0) 1995 - dev_err(w->dapm->dev, 1982 + dev_err(dev, 1996 1983 "ASoC: Failed to apply widget power: %d\n", ret); 1997 1984 } 1998 1985 ··· 2013 2000 2014 2001 static void dapm_widget_update(struct snd_soc_card *card, struct snd_soc_dapm_update *update) 2015 2002 { 2003 + struct device *dev = card->dev; 2016 2004 struct snd_soc_dapm_widget_list *wlist; 2017 2005 struct snd_soc_dapm_widget *w = NULL; 2018 2006 unsigned int wi; ··· 2028 2014 if (w->event && (w->event_flags & SND_SOC_DAPM_PRE_REG)) { 2029 2015 ret = w->event(w, update->kcontrol, SND_SOC_DAPM_PRE_REG); 2030 2016 if (ret != 0) 2031 - dev_err(w->dapm->dev, "ASoC: %s DAPM pre-event failed: %d\n", 2017 + dev_err(dev, "ASoC: %s DAPM pre-event failed: %d\n", 2032 2018 w->name, ret); 2033 2019 } 2034 2020 } ··· 2039 2025 ret = soc_dapm_update_bits(w->dapm, update->reg, update->mask, 2040 2026 update->val); 2041 2027 if (ret < 0) 2042 - dev_err(w->dapm->dev, "ASoC: %s DAPM update failed: %d\n", 2028 + dev_err(dev, "ASoC: %s DAPM update failed: %d\n", 2043 2029 w->name, ret); 2044 2030 2045 2031 if (update->has_second_set) { 2046 2032 ret = soc_dapm_update_bits(w->dapm, update->reg2, 2047 2033 update->mask2, update->val2); 2048 2034 if (ret < 0) 2049 - dev_err(w->dapm->dev, 2035 + dev_err(dev, 2050 2036 "ASoC: %s DAPM update failed: %d\n", 2051 2037 w->name, ret); 2052 2038 } ··· 2055 2041 if (w->event && (w->event_flags & SND_SOC_DAPM_POST_REG)) { 2056 2042 ret = w->event(w, update->kcontrol, SND_SOC_DAPM_POST_REG); 2057 2043 if (ret != 0) 2058 - dev_err(w->dapm->dev, "ASoC: %s DAPM post-event failed: %d\n", 2044 + dev_err(dev, "ASoC: %s DAPM post-event failed: %d\n", 2059 2045 w->name, ret); 2060 2046 } 2061 2047 } ··· 2067 2053 static void dapm_pre_sequence_async(void *data, async_cookie_t cookie) 2068 2054 { 2069 2055 struct snd_soc_dapm_context *dapm = data; 2056 + struct device *dev = snd_soc_dapm_to_dev(dapm); 2070 2057 int ret; 2071 2058 2072 2059 /* If we're off and we're not supposed to go into STANDBY */ 2073 2060 if (dapm->bias_level == SND_SOC_BIAS_OFF && 2074 2061 dapm->target_bias_level != SND_SOC_BIAS_OFF) { 2075 - if (dapm->dev && cookie) 2076 - pm_runtime_get_sync(dapm->dev); 2062 + if (dev && cookie) 2063 + pm_runtime_get_sync(dev); 2077 2064 2078 2065 ret = snd_soc_dapm_set_bias_level(dapm, SND_SOC_BIAS_STANDBY); 2079 2066 if (ret != 0) 2080 - dev_err(dapm->dev, 2067 + dev_err(dev, 2081 2068 "ASoC: Failed to turn on bias: %d\n", ret); 2082 2069 } 2083 2070 ··· 2089 2074 dapm->bias_level == SND_SOC_BIAS_ON)) { 2090 2075 ret = snd_soc_dapm_set_bias_level(dapm, SND_SOC_BIAS_PREPARE); 2091 2076 if (ret != 0) 2092 - dev_err(dapm->dev, 2077 + dev_err(dev, 2093 2078 "ASoC: Failed to prepare bias: %d\n", ret); 2094 2079 } 2095 2080 } ··· 2100 2085 static void dapm_post_sequence_async(void *data, async_cookie_t cookie) 2101 2086 { 2102 2087 struct snd_soc_dapm_context *dapm = data; 2088 + struct device *dev = snd_soc_dapm_to_dev(dapm); 2103 2089 int ret; 2104 2090 2105 2091 /* If we just powered the last thing off drop to standby bias */ ··· 2109 2093 dapm->target_bias_level == SND_SOC_BIAS_OFF)) { 2110 2094 ret = snd_soc_dapm_set_bias_level(dapm, SND_SOC_BIAS_STANDBY); 2111 2095 if (ret != 0) 2112 - dev_err(dapm->dev, "ASoC: Failed to apply standby bias: %d\n", 2113 - ret); 2096 + dev_err(dev, "ASoC: Failed to apply standby bias: %d\n", ret); 2114 2097 } 2115 2098 2116 2099 /* If we're in standby and can support bias off then do that */ ··· 2117 2102 dapm->target_bias_level == SND_SOC_BIAS_OFF) { 2118 2103 ret = snd_soc_dapm_set_bias_level(dapm, SND_SOC_BIAS_OFF); 2119 2104 if (ret != 0) 2120 - dev_err(dapm->dev, "ASoC: Failed to turn off bias: %d\n", 2121 - ret); 2105 + dev_err(dev, "ASoC: Failed to turn off bias: %d\n", ret); 2122 2106 2123 - if (dapm->dev && cookie) 2124 - pm_runtime_put(dapm->dev); 2107 + if (dev && cookie) 2108 + pm_runtime_put(dev); 2125 2109 } 2126 2110 2127 2111 /* If we just powered up then move to active bias */ ··· 2128 2114 dapm->target_bias_level == SND_SOC_BIAS_ON) { 2129 2115 ret = snd_soc_dapm_set_bias_level(dapm, SND_SOC_BIAS_ON); 2130 2116 if (ret != 0) 2131 - dev_err(dapm->dev, "ASoC: Failed to apply active bias: %d\n", 2132 - ret); 2117 + dev_err(dev, "ASoC: Failed to apply active bias: %d\n", ret); 2133 2118 } 2134 2119 } 2135 2120 ··· 2226 2213 static int dapm_power_widgets(struct snd_soc_card *card, int event, 2227 2214 struct snd_soc_dapm_update *update) 2228 2215 { 2216 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 2229 2217 struct snd_soc_dapm_widget *w; 2230 2218 struct snd_soc_dapm_context *d; 2231 2219 LIST_HEAD(up_list); ··· 2313 2299 trace_snd_soc_dapm_walk_done(card); 2314 2300 2315 2301 /* Run card bias changes at first */ 2316 - dapm_pre_sequence_async(&card->dapm, 0); 2302 + dapm_pre_sequence_async(dapm, 0); 2317 2303 /* Run other bias changes in parallel */ 2318 2304 for_each_card_dapms(card, d) { 2319 - if (d != &card->dapm && d->bias_level != d->target_bias_level) 2305 + if (d != dapm && d->bias_level != d->target_bias_level) 2320 2306 async_schedule_domain(dapm_pre_sequence_async, d, 2321 2307 &async_domain); 2322 2308 } ··· 2340 2326 2341 2327 /* Run all the bias changes in parallel */ 2342 2328 for_each_card_dapms(card, d) { 2343 - if (d != &card->dapm && d->bias_level != d->target_bias_level) 2329 + if (d != dapm && d->bias_level != d->target_bias_level) 2344 2330 async_schedule_domain(dapm_post_sequence_async, d, 2345 2331 &async_domain); 2346 2332 } 2347 2333 async_synchronize_full_domain(&async_domain); 2348 2334 /* Run card bias changes at last */ 2349 - dapm_post_sequence_async(&card->dapm, 0); 2335 + dapm_post_sequence_async(dapm, 0); 2350 2336 2351 2337 /* do we need to notify any clients that DAPM event is complete */ 2352 2338 for_each_card_dapms(card, d) { ··· 2717 2703 static ssize_t dapm_widget_show_component(struct snd_soc_component *component, 2718 2704 char *buf, int count) 2719 2705 { 2720 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 2706 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 2721 2707 struct snd_soc_dapm_widget *w; 2722 2708 char *state = "not set"; 2723 2709 ··· 2907 2893 const char *pin, int status) 2908 2894 { 2909 2895 struct snd_soc_dapm_widget *w = dapm_find_widget(dapm, pin, true); 2896 + struct device *dev = snd_soc_dapm_to_dev(dapm); 2910 2897 int ret = 0; 2911 2898 2912 2899 dapm_assert_locked(dapm); 2913 2900 2914 2901 if (!w) { 2915 - dev_err(dapm->dev, "ASoC: DAPM unknown pin %s\n", pin); 2902 + dev_err(dev, "ASoC: DAPM unknown pin %s\n", pin); 2916 2903 return -EINVAL; 2917 2904 } 2918 2905 ··· 2991 2976 struct snd_soc_dapm_widget *w, 2992 2977 int channels) 2993 2978 { 2979 + struct device *dev = snd_soc_dapm_to_dev(w->dapm); 2980 + 2994 2981 switch (w->id) { 2995 2982 case snd_soc_dapm_aif_out: 2996 2983 case snd_soc_dapm_aif_in: ··· 3001 2984 return 0; 3002 2985 } 3003 2986 3004 - dev_dbg(w->dapm->dev, "%s DAI route %s -> %s\n", 2987 + dev_dbg(dev, "%s DAI route %s -> %s\n", 3005 2988 w->channel < channels ? "Connecting" : "Disconnecting", 3006 2989 p->source->name, p->sink->name); 3007 2990 ··· 3076 3059 { 3077 3060 struct snd_soc_dapm_widget *wsource = NULL, *wsink = NULL, *w; 3078 3061 struct snd_soc_dapm_widget *wtsource = NULL, *wtsink = NULL; 3062 + struct device *dev = snd_soc_dapm_to_dev(dapm); 3079 3063 const char *sink; 3080 3064 const char *source; 3081 3065 char prefixed_sink[80]; ··· 3119 3101 } 3120 3102 sink_ref++; 3121 3103 if (sink_ref > 1) 3122 - dev_warn(dapm->dev, 3104 + dev_warn(dev, 3123 3105 "ASoC: sink widget %s overwritten\n", 3124 3106 w->name); 3125 3107 continue; ··· 3133 3115 } 3134 3116 source_ref++; 3135 3117 if (source_ref > 1) 3136 - dev_warn(dapm->dev, 3118 + dev_warn(dev, 3137 3119 "ASoC: source widget %s overwritten\n", 3138 3120 w->name); 3139 3121 } ··· 3159 3141 route->connected); 3160 3142 err: 3161 3143 if (ret) 3162 - dev_err(dapm->dev, "ASoC: Failed to add route %s%s -%s%s%s> %s%s\n", 3144 + dev_err(dev, "ASoC: Failed to add route %s%s -%s%s%s> %s%s\n", 3163 3145 source, !wsource ? "(*)" : "", 3164 3146 !route->control ? "" : "> [", 3165 3147 !route->control ? "" : route->control, ··· 3171 3153 static int snd_soc_dapm_del_route(struct snd_soc_dapm_context *dapm, 3172 3154 const struct snd_soc_dapm_route *route) 3173 3155 { 3156 + struct device *dev = snd_soc_dapm_to_dev(dapm); 3174 3157 struct snd_soc_dapm_path *path, *p; 3175 3158 const char *sink; 3176 3159 const char *source; ··· 3180 3161 const char *prefix; 3181 3162 3182 3163 if (route->control) { 3183 - dev_err(dapm->dev, 3164 + dev_err(dev, 3184 3165 "ASoC: Removal of routes with controls not supported\n"); 3185 3166 return -EINVAL; 3186 3167 } ··· 3223 3204 dapm_update_widget_flags(wsource); 3224 3205 dapm_update_widget_flags(wsink); 3225 3206 } else { 3226 - dev_warn(dapm->dev, "ASoC: Route %s->%s does not exist\n", 3207 + dev_warn(dev, "ASoC: Route %s->%s does not exist\n", 3227 3208 source, sink); 3228 3209 } 3229 3210 ··· 3370 3351 int snd_soc_dapm_get_volsw(struct snd_kcontrol *kcontrol, 3371 3352 struct snd_ctl_elem_value *ucontrol) 3372 3353 { 3373 - struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_dapm(kcontrol); 3354 + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol); 3374 3355 struct soc_mixer_control *mc = 3375 3356 (struct soc_mixer_control *)kcontrol->private_value; 3376 3357 int reg = mc->reg; ··· 3392 3373 if (snd_soc_volsw_is_stereo(mc)) 3393 3374 rval = (reg_val >> mc->rshift) & mask; 3394 3375 } else { 3395 - reg_val = dapm_kcontrol_get_value(kcontrol); 3376 + reg_val = snd_soc_dapm_kcontrol_get_value(kcontrol); 3396 3377 val = reg_val & mask; 3397 3378 3398 3379 if (snd_soc_volsw_is_stereo(mc)) ··· 3428 3409 int snd_soc_dapm_put_volsw(struct snd_kcontrol *kcontrol, 3429 3410 struct snd_ctl_elem_value *ucontrol) 3430 3411 { 3431 - struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_dapm(kcontrol); 3412 + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol); 3413 + struct device *dev = snd_soc_dapm_to_dev(dapm); 3432 3414 struct snd_soc_card *card = dapm->card; 3433 3415 struct soc_mixer_control *mc = 3434 3416 (struct soc_mixer_control *)kcontrol->private_value; ··· 3462 3442 3463 3443 /* This assumes field width < (bits in unsigned int / 2) */ 3464 3444 if (width > sizeof(unsigned int) * 8 / 2) 3465 - dev_warn(dapm->dev, 3445 + dev_warn(dev, 3466 3446 "ASoC: control %s field width limit exceeded\n", 3467 3447 kcontrol->id.name); 3468 3448 change = dapm_kcontrol_set_value(kcontrol, val | (rval << width)); ··· 3517 3497 int snd_soc_dapm_get_enum_double(struct snd_kcontrol *kcontrol, 3518 3498 struct snd_ctl_elem_value *ucontrol) 3519 3499 { 3520 - struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_dapm(kcontrol); 3500 + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol); 3521 3501 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; 3522 3502 unsigned int reg_val, val; 3523 3503 ··· 3525 3505 if (e->reg != SND_SOC_NOPM && dapm_kcontrol_is_powered(kcontrol)) { 3526 3506 reg_val = soc_dapm_read(dapm, e->reg); 3527 3507 } else { 3528 - reg_val = dapm_kcontrol_get_value(kcontrol); 3508 + reg_val = snd_soc_dapm_kcontrol_get_value(kcontrol); 3529 3509 } 3530 3510 snd_soc_dapm_mutex_unlock(dapm); 3531 3511 ··· 3553 3533 int snd_soc_dapm_put_enum_double(struct snd_kcontrol *kcontrol, 3554 3534 struct snd_ctl_elem_value *ucontrol) 3555 3535 { 3556 - struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_dapm(kcontrol); 3536 + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol); 3557 3537 struct snd_soc_card *card = dapm->card; 3558 3538 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; 3559 3539 unsigned int *item = ucontrol->value.enumerated.item; ··· 3646 3626 struct snd_ctl_elem_value *ucontrol) 3647 3627 { 3648 3628 struct snd_soc_card *card = snd_kcontrol_chip(kcontrol); 3629 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 3649 3630 const char *pin = (const char *)kcontrol->private_value; 3650 3631 3651 - return __snd_soc_dapm_get_pin_switch(&card->dapm, pin, ucontrol); 3632 + return __snd_soc_dapm_get_pin_switch(dapm, pin, ucontrol); 3652 3633 } 3653 3634 EXPORT_SYMBOL_GPL(snd_soc_dapm_get_pin_switch); 3654 3635 ··· 3666 3645 struct snd_ctl_elem_value *ucontrol) 3667 3646 { 3668 3647 struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 3648 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 3669 3649 const char *pin = (const char *)kcontrol->private_value; 3670 3650 3671 - return __snd_soc_dapm_get_pin_switch(&component->dapm, pin, ucontrol); 3651 + return __snd_soc_dapm_get_pin_switch(dapm, pin, ucontrol); 3672 3652 } 3673 3653 EXPORT_SYMBOL_GPL(snd_soc_dapm_get_component_pin_switch); 3674 3654 ··· 3701 3679 struct snd_ctl_elem_value *ucontrol) 3702 3680 { 3703 3681 struct snd_soc_card *card = snd_kcontrol_chip(kcontrol); 3682 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 3704 3683 const char *pin = (const char *)kcontrol->private_value; 3705 3684 3706 - return __snd_soc_dapm_put_pin_switch(&card->dapm, pin, ucontrol); 3685 + return __snd_soc_dapm_put_pin_switch(dapm, pin, ucontrol); 3707 3686 } 3708 3687 EXPORT_SYMBOL_GPL(snd_soc_dapm_put_pin_switch); 3709 3688 ··· 3721 3698 struct snd_ctl_elem_value *ucontrol) 3722 3699 { 3723 3700 struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 3701 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 3724 3702 const char *pin = (const char *)kcontrol->private_value; 3725 3703 3726 - return __snd_soc_dapm_put_pin_switch(&component->dapm, pin, ucontrol); 3704 + return __snd_soc_dapm_put_pin_switch(dapm, pin, ucontrol); 3727 3705 } 3728 3706 EXPORT_SYMBOL_GPL(snd_soc_dapm_put_component_pin_switch); 3729 3707 ··· 3732 3708 snd_soc_dapm_new_control_unlocked(struct snd_soc_dapm_context *dapm, 3733 3709 const struct snd_soc_dapm_widget *widget) 3734 3710 { 3711 + struct device *dev = snd_soc_dapm_to_dev(dapm); 3735 3712 enum snd_soc_dapm_direction dir; 3736 3713 struct snd_soc_dapm_widget *w; 3737 3714 int ret = -ENOMEM; ··· 3743 3718 3744 3719 switch (w->id) { 3745 3720 case snd_soc_dapm_regulator_supply: 3746 - w->regulator = devm_regulator_get(dapm->dev, widget->name); 3721 + w->regulator = devm_regulator_get(dev, widget->name); 3747 3722 if (IS_ERR(w->regulator)) { 3748 3723 ret = PTR_ERR(w->regulator); 3749 3724 goto request_failed; ··· 3752 3727 if (w->on_val & SND_SOC_DAPM_REGULATOR_BYPASS) { 3753 3728 ret = regulator_allow_bypass(w->regulator, true); 3754 3729 if (ret != 0) 3755 - dev_warn(dapm->dev, 3730 + dev_warn(dev, 3756 3731 "ASoC: Failed to bypass %s: %d\n", 3757 3732 w->name, ret); 3758 3733 } 3759 3734 break; 3760 3735 case snd_soc_dapm_pinctrl: 3761 - w->pinctrl = devm_pinctrl_get(dapm->dev); 3736 + w->pinctrl = devm_pinctrl_get(dev); 3762 3737 if (IS_ERR(w->pinctrl)) { 3763 3738 ret = PTR_ERR(w->pinctrl); 3764 3739 goto request_failed; ··· 3768 3743 snd_soc_dapm_pinctrl_event(w, NULL, SND_SOC_DAPM_POST_PMD); 3769 3744 break; 3770 3745 case snd_soc_dapm_clock_supply: 3771 - w->clk = devm_clk_get(dapm->dev, widget->name); 3746 + w->clk = devm_clk_get(dev, widget->name); 3772 3747 if (IS_ERR(w->clk)) { 3773 3748 ret = PTR_ERR(w->clk); 3774 3749 goto request_failed; ··· 3862 3837 return w; 3863 3838 3864 3839 request_failed: 3865 - dev_err_probe(dapm->dev, ret, "ASoC: Failed to request %s\n", 3840 + dev_err_probe(dev, ret, "ASoC: Failed to request %s\n", 3866 3841 w->name); 3867 3842 kfree_const(w->name); 3868 3843 kfree_const(w->sname); ··· 3929 3904 snd_soc_dai_link_event_pre_pmu(struct snd_soc_dapm_widget *w, 3930 3905 struct snd_pcm_substream *substream) 3931 3906 { 3907 + struct device *dev = snd_soc_dapm_to_dev(w->dapm); 3932 3908 struct snd_soc_dapm_path *path; 3933 3909 struct snd_soc_dai *source, *sink; 3934 3910 struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); ··· 3989 3963 */ 3990 3964 config = rtd->dai_link->c2c_params + rtd->c2c_params_select; 3991 3965 if (!config) { 3992 - dev_err(w->dapm->dev, "ASoC: link config missing\n"); 3966 + dev_err(dev, "ASoC: link config missing\n"); 3993 3967 return -EINVAL; 3994 3968 } 3995 3969 3996 3970 /* Be a little careful as we don't want to overflow the mask array */ 3997 3971 if (!config->formats) { 3998 - dev_warn(w->dapm->dev, "ASoC: Invalid format was specified\n"); 3972 + dev_warn(dev, "ASoC: Invalid format was specified\n"); 3999 3973 4000 3974 return -EINVAL; 4001 3975 } ··· 4205 4179 4206 4180 for (count = 0 ; count < num_c2c_params; count++) { 4207 4181 if (!config->stream_name) { 4208 - dev_warn(card->dapm.dev, 4182 + dev_warn(card->dev, 4209 4183 "ASoC: anonymous config %d for dai link %s\n", 4210 4184 count, link_name); 4211 4185 w_param_text[count] = ··· 4257 4231 struct snd_pcm_substream *substream, 4258 4232 char *id) 4259 4233 { 4234 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 4260 4235 struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); 4261 4236 struct snd_soc_dapm_widget template; 4262 4237 struct snd_soc_dapm_widget *w; ··· 4305 4278 4306 4279 dev_dbg(card->dev, "ASoC: adding %s widget\n", link_name); 4307 4280 4308 - w = snd_soc_dapm_new_control_unlocked(&card->dapm, &template); 4281 + w = snd_soc_dapm_new_control_unlocked(dapm, &template); 4309 4282 if (IS_ERR(w)) { 4310 4283 ret = PTR_ERR(w); 4311 4284 goto outfree_kcontrol_news; ··· 4337 4310 int snd_soc_dapm_new_dai_widgets(struct snd_soc_dapm_context *dapm, 4338 4311 struct snd_soc_dai *dai) 4339 4312 { 4313 + struct device *dev = snd_soc_dapm_to_dev(dapm); 4340 4314 struct snd_soc_dapm_widget template; 4341 4315 struct snd_soc_dapm_widget *w; 4342 4316 4343 - WARN_ON(dapm->dev != dai->dev); 4317 + WARN_ON(dev != dai->dev); 4344 4318 4345 4319 memset(&template, 0, sizeof(template)); 4346 4320 template.reg = SND_SOC_NOPM; ··· 4445 4417 struct snd_soc_dai *sink_dai, 4446 4418 struct snd_soc_dapm_widget *sink) 4447 4419 { 4448 - dev_dbg(dapm->dev, "connected DAI link %s:%s -> %s:%s\n", 4420 + struct device *dev = snd_soc_dapm_to_dev(dapm); 4421 + 4422 + dev_dbg(dev, "connected DAI link %s:%s -> %s:%s\n", 4449 4423 src_dai->component->name, src->name, 4450 4424 sink_dai->component->name, sink->name); 4451 4425 ··· 4464 4434 struct snd_soc_dai *codec_dai, 4465 4435 struct snd_soc_dai *cpu_dai) 4466 4436 { 4437 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 4467 4438 struct snd_soc_dai_link *dai_link = rtd->dai_link; 4468 4439 struct snd_soc_dapm_widget *codec, *cpu; 4469 4440 struct snd_soc_dai *src_dai[] = { cpu_dai, codec_dai }; ··· 4499 4468 rtd->c2c_widget[stream] = dai; 4500 4469 } 4501 4470 4502 - dapm_connect_dai_routes(&card->dapm, src_dai[stream], *src[stream], 4471 + dapm_connect_dai_routes(dapm, src_dai[stream], *src[stream], 4503 4472 rtd->c2c_widget[stream], 4504 4473 sink_dai[stream], *sink[stream]); 4505 4474 } ··· 4692 4661 int snd_soc_dapm_force_enable_pin_unlocked(struct snd_soc_dapm_context *dapm, 4693 4662 const char *pin) 4694 4663 { 4664 + struct device *dev; 4695 4665 struct snd_soc_dapm_widget *w = dapm_find_widget(dapm, pin, true); 4696 4666 4697 4667 if (!w) { 4698 - dev_err(dapm->dev, "ASoC: unknown pin %s\n", pin); 4668 + dev = snd_soc_dapm_to_dev(dapm); 4669 + 4670 + dev_err(dev, "ASoC: unknown pin %s\n", pin); 4699 4671 return -EINVAL; 4700 4672 } 4701 4673 4702 - dev_dbg(w->dapm->dev, "ASoC: force enable pin %s\n", pin); 4674 + dev = snd_soc_dapm_to_dev(w->dapm); 4675 + 4676 + dev_dbg(dev, "ASoC: force enable pin %s\n", pin); 4703 4677 if (!w->connected) { 4704 4678 /* 4705 4679 * w->force does not affect the number of input or output paths, ··· 4827 4791 int snd_soc_dapm_ignore_suspend(struct snd_soc_dapm_context *dapm, 4828 4792 const char *pin) 4829 4793 { 4794 + struct device *dev = snd_soc_dapm_to_dev(dapm); 4830 4795 struct snd_soc_dapm_widget *w = dapm_find_widget(dapm, pin, false); 4831 4796 4832 4797 if (!w) { 4833 - dev_err(dapm->dev, "ASoC: unknown pin %s\n", pin); 4798 + dev_err(dev, "ASoC: unknown pin %s\n", pin); 4834 4799 return -EINVAL; 4835 4800 } 4836 4801 ··· 4914 4877 */ 4915 4878 void snd_soc_dapm_shutdown(struct snd_soc_card *card) 4916 4879 { 4880 + struct snd_soc_dapm_context *card_dapm = snd_soc_card_to_dapm(card); 4917 4881 struct snd_soc_dapm_context *dapm; 4918 4882 4919 4883 for_each_card_dapms(card, dapm) { 4920 - if (dapm != &card->dapm) { 4884 + if (dapm != card_dapm) { 4921 4885 soc_dapm_shutdown_dapm(dapm); 4922 4886 if (dapm->bias_level == SND_SOC_BIAS_STANDBY) 4923 - snd_soc_dapm_set_bias_level(dapm, 4924 - SND_SOC_BIAS_OFF); 4887 + snd_soc_dapm_set_bias_level(dapm, SND_SOC_BIAS_OFF); 4925 4888 } 4926 4889 } 4927 4890 4928 - soc_dapm_shutdown_dapm(&card->dapm); 4929 - if (card->dapm.bias_level == SND_SOC_BIAS_STANDBY) 4930 - snd_soc_dapm_set_bias_level(&card->dapm, 4931 - SND_SOC_BIAS_OFF); 4891 + soc_dapm_shutdown_dapm(card_dapm); 4892 + if (card_dapm->bias_level == SND_SOC_BIAS_STANDBY) 4893 + snd_soc_dapm_set_bias_level(card_dapm, SND_SOC_BIAS_OFF); 4932 4894 } 4933 4895 4934 4896 /* Module information */
+1 -1
sound/soc/soc-jack.c
··· 40 40 return; 41 41 trace_snd_soc_jack_report(jack, mask, status); 42 42 43 - dapm = &jack->card->dapm; 43 + dapm = snd_soc_card_to_dapm(jack->card); 44 44 45 45 mutex_lock(&jack->mutex); 46 46
+1 -1
sound/soc/soc-pcm.c
··· 1463 1463 1464 1464 bool dpcm_end_walk_at_be(struct snd_soc_dapm_widget *widget, enum snd_soc_dapm_direction dir) 1465 1465 { 1466 - struct snd_soc_card *card = widget->dapm->card; 1466 + struct snd_soc_card *card = snd_soc_dapm_to_card(widget->dapm); 1467 1467 struct snd_soc_pcm_runtime *rtd; 1468 1468 int stream; 1469 1469
+5 -5
sound/soc/soc-topology.c
··· 1026 1026 static int soc_tplg_dapm_graph_elems_load(struct soc_tplg *tplg, 1027 1027 struct snd_soc_tplg_hdr *hdr) 1028 1028 { 1029 - struct snd_soc_dapm_context *dapm = &tplg->comp->dapm; 1029 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(tplg->comp); 1030 1030 const size_t maxlen = SNDRV_CTL_ELEM_ID_NAME_MAXLEN; 1031 1031 struct snd_soc_tplg_dapm_graph_elem *elem; 1032 1032 struct snd_soc_dapm_route *route; ··· 1097 1097 static int soc_tplg_dapm_widget_create(struct soc_tplg *tplg, 1098 1098 struct snd_soc_tplg_dapm_widget *w) 1099 1099 { 1100 - struct snd_soc_dapm_context *dapm = &tplg->comp->dapm; 1100 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(tplg->comp); 1101 1101 struct snd_soc_dapm_widget template, *widget; 1102 1102 struct snd_soc_tplg_ctl_hdr *control_hdr; 1103 1103 struct snd_soc_card *card = tplg->comp->card; ··· 1245 1245 return 0; 1246 1246 1247 1247 ready_err: 1248 - soc_tplg_remove_widget(widget->dapm->component, &widget->dobj, SOC_TPLG_PASS_WIDGET); 1248 + soc_tplg_remove_widget(snd_soc_dapm_to_component(widget->dapm), 1249 + &widget->dobj, SOC_TPLG_PASS_WIDGET); 1249 1250 snd_soc_dapm_free_widget(widget); 1250 1251 hdr_err: 1251 1252 kfree(template.sname); ··· 1368 1367 struct snd_soc_pcm_stream *stream; 1369 1368 struct snd_soc_tplg_stream_caps *caps; 1370 1369 struct snd_soc_dai *dai; 1371 - struct snd_soc_dapm_context *dapm = 1372 - snd_soc_component_get_dapm(tplg->comp); 1370 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(tplg->comp); 1373 1371 int ret; 1374 1372 1375 1373 dai_drv = devm_kzalloc(tplg->dev, sizeof(struct snd_soc_dai_driver), GFP_KERNEL);
+8 -3
sound/soc/sof/sof-client-probes.c
··· 524 524 card->num_links = SOF_PROBES_NUM_DAI_LINKS; 525 525 card->dai_link = links; 526 526 527 - /* set idle_bias_off to prevent the core from resuming the card->dev */ 528 - card->dapm.idle_bias = false; 529 - 530 527 snd_soc_card_set_drvdata(card, cdev); 531 528 532 529 ret = devm_snd_soc_register_card(dev, card); ··· 533 536 dev_err(dev, "Probes card register failed %d\n", ret); 534 537 return ret; 535 538 } 539 + 540 + /* 541 + * set idle_bias_off to prevent the core from resuming the card->dev 542 + * call it after snd_soc_register_card() 543 + */ 544 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 545 + 546 + snd_soc_dapm_set_idle_bias(dapm, false); 536 547 537 548 /* enable runtime PM */ 538 549 pm_runtime_set_autosuspend_delay(dev, SOF_PROBES_SUSPEND_DELAY_MS);
+2 -1
sound/soc/sunxi/sun4i-codec.c
··· 1663 1663 static int sun4i_codec_spk_event(struct snd_soc_dapm_widget *w, 1664 1664 struct snd_kcontrol *k, int event) 1665 1665 { 1666 - struct sun4i_codec *scodec = snd_soc_card_get_drvdata(w->dapm->card); 1666 + struct snd_soc_card *card = snd_soc_dapm_to_card(w->dapm); 1667 + struct sun4i_codec *scodec = snd_soc_card_get_drvdata(card); 1667 1668 1668 1669 gpiod_set_value_cansleep(scodec->gpio_pa, 1669 1670 !!SND_SOC_DAPM_EVENT_ON(event));
+1 -1
sound/soc/sunxi/sun50i-codec-analog.c
··· 495 495 static int sun50i_a64_codec_set_bias_level(struct snd_soc_component *component, 496 496 enum snd_soc_bias_level level) 497 497 { 498 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 498 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 499 499 int hbias; 500 500 501 501 switch (level) {
+7 -7
sound/soc/sunxi/sun8i-codec-analog.c
··· 390 390 391 391 static int sun8i_codec_add_headphone(struct snd_soc_component *cmpnt) 392 392 { 393 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(cmpnt); 393 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(cmpnt); 394 394 struct device *dev = cmpnt->dev; 395 395 int ret; 396 396 ··· 428 428 429 429 static int sun8i_codec_add_mbias(struct snd_soc_component *cmpnt) 430 430 { 431 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(cmpnt); 431 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(cmpnt); 432 432 struct device *dev = cmpnt->dev; 433 433 int ret; 434 434 ··· 449 449 450 450 static int sun8i_codec_add_hmic(struct snd_soc_component *cmpnt) 451 451 { 452 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(cmpnt); 452 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(cmpnt); 453 453 struct device *dev = cmpnt->dev; 454 454 int ret; 455 455 ··· 486 486 487 487 static int sun8i_codec_add_linein(struct snd_soc_component *cmpnt) 488 488 { 489 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(cmpnt); 489 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(cmpnt); 490 490 struct device *dev = cmpnt->dev; 491 491 int ret; 492 492 ··· 567 567 568 568 static int sun8i_codec_add_lineout(struct snd_soc_component *cmpnt) 569 569 { 570 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(cmpnt); 570 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(cmpnt); 571 571 struct device *dev = cmpnt->dev; 572 572 int ret; 573 573 ··· 632 632 633 633 static int sun8i_codec_add_mic2(struct snd_soc_component *cmpnt) 634 634 { 635 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(cmpnt); 635 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(cmpnt); 636 636 struct device *dev = cmpnt->dev; 637 637 int ret; 638 638 ··· 688 688 static int sun8i_codec_analog_add_mixer(struct snd_soc_component *cmpnt, 689 689 const struct sun8i_codec_analog_quirks *quirks) 690 690 { 691 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(cmpnt); 691 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(cmpnt); 692 692 struct device *dev = cmpnt->dev; 693 693 int ret; 694 694
+2 -2
sound/soc/sunxi/sun8i-codec.c
··· 1287 1287 1288 1288 static int sun8i_codec_component_probe(struct snd_soc_component *component) 1289 1289 { 1290 - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 1290 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1291 1291 struct sun8i_codec *scodec = snd_soc_component_get_drvdata(component); 1292 1292 int ret; 1293 1293 ··· 1331 1331 1332 1332 static void sun8i_codec_set_hmic_bias(struct sun8i_codec *scodec, bool enable) 1333 1333 { 1334 - struct snd_soc_dapm_context *dapm = &scodec->component->card->dapm; 1334 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(scodec->component->card); 1335 1335 int irq_mask = BIT(SUN8I_HMIC_CTRL1_HMIC_DATA_IRQ_EN); 1336 1336 1337 1337 if (enable)
+3 -3
sound/soc/tegra/tegra210_ahub.c
··· 17 17 static int tegra_ahub_get_value_enum(struct snd_kcontrol *kctl, 18 18 struct snd_ctl_elem_value *uctl) 19 19 { 20 - struct snd_soc_component *cmpnt = snd_soc_dapm_kcontrol_component(kctl); 20 + struct snd_soc_component *cmpnt = snd_soc_dapm_kcontrol_to_component(kctl); 21 21 struct tegra_ahub *ahub = snd_soc_component_get_drvdata(cmpnt); 22 22 struct soc_enum *e = (struct soc_enum *)kctl->private_value; 23 23 unsigned int reg, i, bit_pos = 0; ··· 54 54 static int tegra_ahub_put_value_enum(struct snd_kcontrol *kctl, 55 55 struct snd_ctl_elem_value *uctl) 56 56 { 57 - struct snd_soc_component *cmpnt = snd_soc_dapm_kcontrol_component(kctl); 57 + struct snd_soc_component *cmpnt = snd_soc_dapm_kcontrol_to_component(kctl); 58 58 struct tegra_ahub *ahub = snd_soc_component_get_drvdata(cmpnt); 59 - struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_dapm(kctl); 59 + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kctl); 60 60 struct soc_enum *e = (struct soc_enum *)kctl->private_value; 61 61 struct snd_soc_dapm_update update[TEGRA_XBAR_UPDATE_MAX_REG] = { }; 62 62 unsigned int *item = uctl->value.enumerated.item;
+7 -4
sound/soc/tegra/tegra_asoc_machine.c
··· 78 78 static int tegra_machine_event(struct snd_soc_dapm_widget *w, 79 79 struct snd_kcontrol *k, int event) 80 80 { 81 - struct snd_soc_dapm_context *dapm = w->dapm; 82 - struct tegra_machine *machine = snd_soc_card_get_drvdata(dapm->card); 81 + struct snd_soc_card *card = snd_soc_dapm_to_card(w->dapm); 82 + struct tegra_machine *machine = snd_soc_card_get_drvdata(card); 83 83 84 84 if (!snd_soc_dapm_widget_name_cmp(w, "Int Spk") || 85 85 !snd_soc_dapm_widget_name_cmp(w, "Speakers")) ··· 659 659 660 660 static int tegra_wm9712_init(struct snd_soc_pcm_runtime *rtd) 661 661 { 662 - return snd_soc_dapm_force_enable_pin(&rtd->card->dapm, "Mic Bias"); 662 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(rtd->card); 663 + 664 + return snd_soc_dapm_force_enable_pin(dapm, "Mic Bias"); 663 665 } 664 666 665 667 SND_SOC_DAILINK_DEFS(wm9712_hifi, ··· 841 839 static int tegra_rt5677_init(struct snd_soc_pcm_runtime *rtd) 842 840 { 843 841 struct snd_soc_card *card = rtd->card; 842 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 844 843 int err; 845 844 846 845 err = tegra_asoc_machine_init(rtd); 847 846 if (err) 848 847 return err; 849 848 850 - snd_soc_dapm_force_enable_pin(&card->dapm, "MICBIAS1"); 849 + snd_soc_dapm_force_enable_pin(dapm, "MICBIAS1"); 851 850 852 851 return 0; 853 852 }
+2 -1
sound/soc/tegra/tegra_wm8903.c
··· 56 56 { 57 57 struct tegra_machine *machine = snd_soc_card_get_drvdata(rtd->card); 58 58 struct snd_soc_card *card = rtd->card; 59 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 59 60 int err; 60 61 61 62 /* ··· 97 96 SND_JACK_MICROPHONE, shrt); 98 97 } 99 98 100 - snd_soc_dapm_force_enable_pin(&card->dapm, "MICBIAS"); 99 + snd_soc_dapm_force_enable_pin(dapm, "MICBIAS"); 101 100 102 101 return 0; 103 102 }
+4 -4
sound/soc/ti/ams-delta.c
··· 99 99 struct snd_ctl_elem_value *ucontrol) 100 100 { 101 101 struct snd_soc_card *card = snd_kcontrol_chip(kcontrol); 102 - struct snd_soc_dapm_context *dapm = &card->dapm; 102 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 103 103 struct soc_enum *control = (struct soc_enum *)kcontrol->private_value; 104 104 unsigned short pins; 105 105 int pin, changed = 0; ··· 172 172 struct snd_ctl_elem_value *ucontrol) 173 173 { 174 174 struct snd_soc_card *card = snd_kcontrol_chip(kcontrol); 175 - struct snd_soc_dapm_context *dapm = &card->dapm; 175 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 176 176 unsigned short pins, mode; 177 177 178 178 pins = ((snd_soc_dapm_get_pin_status(dapm, "Mouthpiece") << ··· 313 313 314 314 v253_ops.close(tty); 315 315 316 - dapm = &component->card->dapm; 316 + dapm = snd_soc_card_to_dapm(component->card); 317 317 318 318 /* Revert back to default audio input/output constellation */ 319 319 snd_soc_dapm_mutex_lock(dapm); ··· 462 462 { 463 463 struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, 0); 464 464 struct snd_soc_card *card = rtd->card; 465 - struct snd_soc_dapm_context *dapm = &card->dapm; 465 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 466 466 int ret; 467 467 /* Codec is ready, now add/activate board specific controls */ 468 468
+6 -5
sound/soc/ti/davinci-evm.c
··· 113 113 static int evm_aic3x_init(struct snd_soc_pcm_runtime *rtd) 114 114 { 115 115 struct snd_soc_card *card = rtd->card; 116 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(rtd->card); 116 117 struct device_node *np = card->dev->of_node; 117 118 int ret; 118 119 119 120 /* Add davinci-evm specific widgets */ 120 - snd_soc_dapm_new_controls(&card->dapm, aic3x_dapm_widgets, 121 + snd_soc_dapm_new_controls(dapm, aic3x_dapm_widgets, 121 122 ARRAY_SIZE(aic3x_dapm_widgets)); 122 123 123 124 if (np) { ··· 127 126 return ret; 128 127 } else { 129 128 /* Set up davinci-evm specific audio path audio_map */ 130 - snd_soc_dapm_add_routes(&card->dapm, audio_map, 129 + snd_soc_dapm_add_routes(dapm, audio_map, 131 130 ARRAY_SIZE(audio_map)); 132 131 } 133 132 134 133 /* not connected */ 135 - snd_soc_dapm_nc_pin(&card->dapm, "MONO_LOUT"); 136 - snd_soc_dapm_nc_pin(&card->dapm, "HPLCOM"); 137 - snd_soc_dapm_nc_pin(&card->dapm, "HPRCOM"); 134 + snd_soc_dapm_disable_pin(dapm, "MONO_LOUT"); 135 + snd_soc_dapm_disable_pin(dapm, "HPLCOM"); 136 + snd_soc_dapm_disable_pin(dapm, "HPRCOM"); 138 137 139 138 return 0; 140 139 }
+1 -1
sound/soc/ti/j721e-evm.c
··· 444 444 445 445 static int j721e_audio_init_ivi(struct snd_soc_pcm_runtime *rtd) 446 446 { 447 - struct snd_soc_dapm_context *dapm = &rtd->card->dapm; 447 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(rtd->card); 448 448 449 449 snd_soc_dapm_new_controls(dapm, j721e_ivi_codec_a_dapm_widgets, 450 450 ARRAY_SIZE(j721e_ivi_codec_a_dapm_widgets));
+8 -4
sound/soc/ti/n810.c
··· 85 85 { 86 86 struct snd_pcm_runtime *runtime = substream->runtime; 87 87 struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); 88 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(rtd->card); 88 89 89 90 snd_pcm_hw_constraint_single(runtime, SNDRV_PCM_HW_PARAM_CHANNELS, 2); 90 91 91 - n810_ext_control(&rtd->card->dapm); 92 + n810_ext_control(dapm); 92 93 return clk_prepare_enable(sys_clkout2); 93 94 } 94 95 ··· 130 129 struct snd_ctl_elem_value *ucontrol) 131 130 { 132 131 struct snd_soc_card *card = snd_kcontrol_chip(kcontrol); 132 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 133 133 134 134 if (n810_spk_func == ucontrol->value.enumerated.item[0]) 135 135 return 0; 136 136 137 137 n810_spk_func = ucontrol->value.enumerated.item[0]; 138 - n810_ext_control(&card->dapm); 138 + n810_ext_control(dapm); 139 139 140 140 return 1; 141 141 } ··· 153 151 struct snd_ctl_elem_value *ucontrol) 154 152 { 155 153 struct snd_soc_card *card = snd_kcontrol_chip(kcontrol); 154 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 156 155 157 156 if (n810_jack_func == ucontrol->value.enumerated.item[0]) 158 157 return 0; 159 158 160 159 n810_jack_func = ucontrol->value.enumerated.item[0]; 161 - n810_ext_control(&card->dapm); 160 + n810_ext_control(dapm); 162 161 163 162 return 1; 164 163 } ··· 176 173 struct snd_ctl_elem_value *ucontrol) 177 174 { 178 175 struct snd_soc_card *card = snd_kcontrol_chip(kcontrol); 176 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 179 177 180 178 if (n810_dmic_func == ucontrol->value.enumerated.item[0]) 181 179 return 0; 182 180 183 181 n810_dmic_func = ucontrol->value.enumerated.item[0]; 184 - n810_ext_control(&card->dapm); 182 + n810_ext_control(dapm); 185 183 186 184 return 1; 187 185 }
+1 -1
sound/soc/ti/omap-abe-twl6040.c
··· 202 202 203 203 static int omap_abe_dmic_init(struct snd_soc_pcm_runtime *rtd) 204 204 { 205 - struct snd_soc_dapm_context *dapm = &rtd->card->dapm; 205 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(rtd->card); 206 206 207 207 return snd_soc_dapm_add_routes(dapm, dmic_audio_map, 208 208 ARRAY_SIZE(dmic_audio_map));
+1 -1
sound/soc/ti/omap-twl4030.c
··· 143 143 static int omap_twl4030_init(struct snd_soc_pcm_runtime *rtd) 144 144 { 145 145 struct snd_soc_card *card = rtd->card; 146 - struct snd_soc_dapm_context *dapm = &card->dapm; 146 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 147 147 struct omap_tw4030_pdata *pdata = dev_get_platdata(card->dev); 148 148 struct omap_twl4030 *priv = snd_soc_card_get_drvdata(card); 149 149 int ret = 0;
+19 -17
sound/soc/ti/omap3pandora.c
··· 71 71 * VCC power on/off and /PD pin high/low 72 72 */ 73 73 if (SND_SOC_DAPM_EVENT_ON(event)) { 74 + struct device *dev = snd_soc_dapm_to_dev(w->dapm); 75 + 74 76 ret = regulator_enable(omap3pandora_dac_reg); 75 77 if (ret) { 76 - dev_err(w->dapm->dev, "Failed to power DAC: %d\n", ret); 78 + dev_err(dev, "Failed to power DAC: %d\n", ret); 77 79 return ret; 78 80 } 79 81 mdelay(1); ··· 141 139 142 140 static int omap3pandora_out_init(struct snd_soc_pcm_runtime *rtd) 143 141 { 144 - struct snd_soc_dapm_context *dapm = &rtd->card->dapm; 142 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(rtd->card); 145 143 146 144 /* All TWL4030 output pins are floating */ 147 - snd_soc_dapm_nc_pin(dapm, "EARPIECE"); 148 - snd_soc_dapm_nc_pin(dapm, "PREDRIVEL"); 149 - snd_soc_dapm_nc_pin(dapm, "PREDRIVER"); 150 - snd_soc_dapm_nc_pin(dapm, "HSOL"); 151 - snd_soc_dapm_nc_pin(dapm, "HSOR"); 152 - snd_soc_dapm_nc_pin(dapm, "CARKITL"); 153 - snd_soc_dapm_nc_pin(dapm, "CARKITR"); 154 - snd_soc_dapm_nc_pin(dapm, "HFL"); 155 - snd_soc_dapm_nc_pin(dapm, "HFR"); 156 - snd_soc_dapm_nc_pin(dapm, "VIBRA"); 145 + snd_soc_dapm_disable_pin(dapm, "EARPIECE"); 146 + snd_soc_dapm_disable_pin(dapm, "PREDRIVEL"); 147 + snd_soc_dapm_disable_pin(dapm, "PREDRIVER"); 148 + snd_soc_dapm_disable_pin(dapm, "HSOL"); 149 + snd_soc_dapm_disable_pin(dapm, "HSOR"); 150 + snd_soc_dapm_disable_pin(dapm, "CARKITL"); 151 + snd_soc_dapm_disable_pin(dapm, "CARKITR"); 152 + snd_soc_dapm_disable_pin(dapm, "HFL"); 153 + snd_soc_dapm_disable_pin(dapm, "HFR"); 154 + snd_soc_dapm_disable_pin(dapm, "VIBRA"); 157 155 158 156 return 0; 159 157 } 160 158 161 159 static int omap3pandora_in_init(struct snd_soc_pcm_runtime *rtd) 162 160 { 163 - struct snd_soc_dapm_context *dapm = &rtd->card->dapm; 161 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(rtd->card); 164 162 165 163 /* Not comnnected */ 166 - snd_soc_dapm_nc_pin(dapm, "HSMIC"); 167 - snd_soc_dapm_nc_pin(dapm, "CARKITMIC"); 168 - snd_soc_dapm_nc_pin(dapm, "DIGIMIC0"); 169 - snd_soc_dapm_nc_pin(dapm, "DIGIMIC1"); 164 + snd_soc_dapm_disable_pin(dapm, "HSMIC"); 165 + snd_soc_dapm_disable_pin(dapm, "CARKITMIC"); 166 + snd_soc_dapm_disable_pin(dapm, "DIGIMIC0"); 167 + snd_soc_dapm_disable_pin(dapm, "DIGIMIC1"); 170 168 171 169 return 0; 172 170 }
+10 -7
sound/soc/ti/rx51.c
··· 42 42 43 43 static void rx51_ext_control(struct snd_soc_dapm_context *dapm) 44 44 { 45 - struct snd_soc_card *card = dapm->card; 45 + struct snd_soc_card *card = snd_soc_dapm_to_card(dapm); 46 46 struct rx51_audio_pdata *pdata = snd_soc_card_get_drvdata(card); 47 47 int hp = 0, hs = 0, tvout = 0; 48 48 ··· 89 89 { 90 90 struct snd_pcm_runtime *runtime = substream->runtime; 91 91 struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); 92 - struct snd_soc_card *card = rtd->card; 92 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(rtd->card); 93 93 94 94 snd_pcm_hw_constraint_single(runtime, SNDRV_PCM_HW_PARAM_CHANNELS, 2); 95 - rx51_ext_control(&card->dapm); 95 + rx51_ext_control(dapm); 96 96 97 97 return 0; 98 98 } ··· 125 125 struct snd_ctl_elem_value *ucontrol) 126 126 { 127 127 struct snd_soc_card *card = snd_kcontrol_chip(kcontrol); 128 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 128 129 129 130 if (rx51_spk_func == ucontrol->value.enumerated.item[0]) 130 131 return 0; 131 132 132 133 rx51_spk_func = ucontrol->value.enumerated.item[0]; 133 - rx51_ext_control(&card->dapm); 134 + rx51_ext_control(dapm); 134 135 135 136 return 1; 136 137 } ··· 140 139 struct snd_kcontrol *k, int event) 141 140 { 142 141 struct snd_soc_dapm_context *dapm = w->dapm; 143 - struct snd_soc_card *card = dapm->card; 142 + struct snd_soc_card *card = snd_soc_dapm_to_card(dapm); 144 143 struct rx51_audio_pdata *pdata = snd_soc_card_get_drvdata(card); 145 144 146 145 gpiod_set_raw_value_cansleep(pdata->speaker_amp_gpio, ··· 161 160 struct snd_ctl_elem_value *ucontrol) 162 161 { 163 162 struct snd_soc_card *card = snd_kcontrol_chip(kcontrol); 163 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 164 164 165 165 if (rx51_dmic_func == ucontrol->value.enumerated.item[0]) 166 166 return 0; 167 167 168 168 rx51_dmic_func = ucontrol->value.enumerated.item[0]; 169 - rx51_ext_control(&card->dapm); 169 + rx51_ext_control(dapm); 170 170 171 171 return 1; 172 172 } ··· 184 182 struct snd_ctl_elem_value *ucontrol) 185 183 { 186 184 struct snd_soc_card *card = snd_kcontrol_chip(kcontrol); 185 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 187 186 188 187 if (rx51_jack_func == ucontrol->value.enumerated.item[0]) 189 188 return 0; 190 189 191 190 rx51_jack_func = ucontrol->value.enumerated.item[0]; 192 - rx51_ext_control(&card->dapm); 191 + rx51_ext_control(dapm); 193 192 194 193 return 1; 195 194 }
+1 -1
sound/soc/ux500/mop500_ab8500.c
··· 357 357 358 358 int mop500_ab8500_machine_init(struct snd_soc_pcm_runtime *rtd) 359 359 { 360 - struct snd_soc_dapm_context *dapm = &rtd->card->dapm; 360 + struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(rtd->card); 361 361 struct device *dev = rtd->card->dev; 362 362 struct mop500_ab8500_drvdata *drvdata; 363 363 int ret;