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

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: capsuling struct snd_soc_dapm_context

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

Now, all DAPM users are using function to handling it.
We can capsuling it. This patchset moves struct snd_soc_dapm_context into
soc-dapm.c, and remove un-used functions.

Link: https://lore.kernel.org/r/87zf7jrx52.wl-kuninori.morimoto.gx@renesas.com

+202 -321
+2 -27
include/sound/soc-component.h
··· 237 237 * the driver will be marked as BROKEN when these fields are removed. 238 238 */ 239 239 240 - /* Don't use these, use snd_soc_component_get_dapm() */ 241 - struct snd_soc_dapm_context dapm; 240 + struct snd_soc_dapm_context *dapm; 242 241 243 242 /* machine specific init */ 244 243 int (*init)(struct snd_soc_component *component); ··· 267 268 static inline struct snd_soc_dapm_context *snd_soc_component_to_dapm( 268 269 struct snd_soc_component *component) 269 270 { 270 - return &component->dapm; 271 + return component->dapm; 271 272 } 272 - 273 - // FIXME 274 - #define snd_soc_component_get_dapm snd_soc_component_to_dapm 275 273 276 274 /** 277 275 * snd_soc_component_cache_sync() - Sync the register cache with the hardware ··· 363 367 { 364 368 return component->active; 365 369 } 366 - 367 - /* component pin */ 368 - int snd_soc_component_enable_pin(struct snd_soc_component *component, 369 - const char *pin); 370 - int snd_soc_component_enable_pin_unlocked(struct snd_soc_component *component, 371 - const char *pin); 372 - int snd_soc_component_disable_pin(struct snd_soc_component *component, 373 - const char *pin); 374 - int snd_soc_component_disable_pin_unlocked(struct snd_soc_component *component, 375 - const char *pin); 376 - int snd_soc_component_nc_pin(struct snd_soc_component *component, 377 - const char *pin); 378 - int snd_soc_component_nc_pin_unlocked(struct snd_soc_component *component, 379 - const char *pin); 380 - int snd_soc_component_get_pin_status(struct snd_soc_component *component, 381 - const char *pin); 382 - int snd_soc_component_force_enable_pin(struct snd_soc_component *component, 383 - const char *pin); 384 - int snd_soc_component_force_enable_pin_unlocked( 385 - struct snd_soc_component *component, 386 - const char *pin); 387 370 388 371 /* component controls */ 389 372 struct snd_kcontrol *snd_soc_component_get_kcontrol(struct snd_soc_component *component,
+3 -41
include/sound/soc-dapm.h
··· 20 20 struct soc_enum; 21 21 struct snd_pcm_substream; 22 22 struct snd_soc_pcm_runtime; 23 + struct snd_soc_dapm_context; 23 24 24 25 /* widget has no PM register bit */ 25 26 #define SND_SOC_NOPM -1 ··· 580 579 bool has_second_set; 581 580 }; 582 581 583 - /* DAPM context */ 584 - struct snd_soc_dapm_context { 585 - enum snd_soc_bias_level bias_level; 586 - 587 - bool idle_bias; /* Use BIAS_OFF instead of STANDBY when false */ 588 - 589 - struct device *dev; /* from parent - for debug */ /* REMOVE ME */ 590 - struct snd_soc_component *component; /* parent component */ 591 - struct snd_soc_card *card; /* parent card */ 592 - 593 - /* used during DAPM updates */ 594 - enum snd_soc_bias_level target_bias_level; 595 - struct list_head list; 596 - 597 - struct snd_soc_dapm_widget *wcache_sink; 598 - struct snd_soc_dapm_widget *wcache_source; 599 - 600 - #ifdef CONFIG_DEBUG_FS 601 - struct dentry *debugfs_dapm; 602 - #endif 603 - }; 604 - 605 582 /* A list of widgets associated with an object, typically a snd_kcontrol */ 606 583 struct snd_soc_dapm_widget_list { 607 584 int num_widgets; ··· 606 627 607 628 #define SND_SOC_DAPM_EP_SOURCE SND_SOC_DAPM_DIR_TO_EP(SND_SOC_DAPM_DIR_IN) 608 629 #define SND_SOC_DAPM_EP_SINK SND_SOC_DAPM_DIR_TO_EP(SND_SOC_DAPM_DIR_OUT) 630 + 631 + struct snd_soc_dapm_context *snd_soc_dapm_alloc(struct device *dev); 609 632 610 633 int snd_soc_dapm_regulator_event(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event); 611 634 int snd_soc_dapm_clock_event(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event); ··· 686 705 int snd_soc_dapm_ignore_suspend(struct snd_soc_dapm_context *dapm, const char *pin); 687 706 void snd_soc_dapm_mark_endpoints_dirty(struct snd_soc_card *card); 688 707 689 - /* 690 - * Marks the specified pin as being not connected, disabling it along 691 - * any parent or child widgets. At present this is identical to 692 - * snd_soc_dapm_disable_pin[_unlocked]() but in future it will be extended to do 693 - * additional things such as disabling controls which only affect 694 - * paths through the pin. 695 - */ 696 - #define snd_soc_dapm_nc_pin snd_soc_dapm_disable_pin 697 - #define snd_soc_dapm_nc_pin_unlocked snd_soc_dapm_disable_pin_unlocked 698 - 699 708 /* dapm path query */ 700 709 int snd_soc_dapm_dai_get_connected_widgets(struct snd_soc_dai *dai, int stream, 701 710 struct snd_soc_dapm_widget_list **list, ··· 700 729 int snd_soc_dapm_force_bias_level(struct snd_soc_dapm_context *dapm, enum snd_soc_bias_level level); 701 730 enum snd_soc_bias_level snd_soc_dapm_get_bias_level(struct snd_soc_dapm_context *dapm); 702 731 void snd_soc_dapm_init_bias_level(struct snd_soc_dapm_context *dapm, enum snd_soc_bias_level level); 703 - 704 - // REMOVE ME !! 705 - #define snd_soc_component_force_bias_level(c, l) snd_soc_dapm_force_bias_level(&(c)->dapm, l) 706 - #define snd_soc_component_get_bias_level(c) snd_soc_dapm_get_bias_level(&(c)->dapm) 707 - #define snd_soc_component_init_bias_level(c, l) snd_soc_dapm_init_bias_level(&(c)->dapm, l) 708 - #define snd_soc_dapm_kcontrol_widget snd_soc_dapm_kcontrol_to_widget 709 - #define snd_soc_dapm_kcontrol_dapm snd_soc_dapm_kcontrol_to_dapm 710 - #define dapm_kcontrol_get_value snd_soc_dapm_kcontrol_get_value 711 - #define snd_soc_dapm_kcontrol_component snd_soc_dapm_kcontrol_to_component 712 732 713 733 #define for_each_dapm_widgets(list, i, widget) \ 714 734 for ((i) = 0; \
+2 -2
include/sound/soc.h
··· 1076 1076 struct list_head dobj_list; 1077 1077 1078 1078 /* Generic DAPM context for the card */ 1079 - struct snd_soc_dapm_context dapm; 1079 + struct snd_soc_dapm_context *dapm; 1080 1080 struct snd_soc_dapm_stats dapm_stats; 1081 1081 1082 1082 #ifdef CONFIG_DEBUG_FS ··· 1136 1136 1137 1137 static inline struct snd_soc_dapm_context *snd_soc_card_to_dapm(struct snd_soc_card *card) 1138 1138 { 1139 - return &card->dapm; 1139 + return card->dapm; 1140 1140 } 1141 1141 1142 1142 /* SoC machine DAI configuration, glues a codec and cpu DAI together */
+2 -2
sound/soc/codecs/tlv320adcx140.c
··· 1188 1188 enum snd_soc_bias_level level) 1189 1189 { 1190 1190 struct adcx140_priv *adcx140 = snd_soc_component_get_drvdata(component); 1191 - enum snd_soc_bias_level prev_level 1192 - = snd_soc_component_get_bias_level(component); 1191 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1192 + enum snd_soc_bias_level prev_level = snd_soc_dapm_get_bias_level(dapm); 1193 1193 1194 1194 switch (level) { 1195 1195 case SND_SOC_BIAS_ON:
-82
sound/soc/soc-component.c
··· 142 142 return soc_component_ret(component, ret); 143 143 } 144 144 145 - int snd_soc_component_enable_pin(struct snd_soc_component *component, 146 - const char *pin) 147 - { 148 - struct snd_soc_dapm_context *dapm = 149 - snd_soc_component_get_dapm(component); 150 - return snd_soc_dapm_enable_pin(dapm, pin); 151 - } 152 - EXPORT_SYMBOL_GPL(snd_soc_component_enable_pin); 153 - 154 - int snd_soc_component_enable_pin_unlocked(struct snd_soc_component *component, 155 - const char *pin) 156 - { 157 - struct snd_soc_dapm_context *dapm = 158 - snd_soc_component_get_dapm(component); 159 - return snd_soc_dapm_enable_pin_unlocked(dapm, pin); 160 - } 161 - EXPORT_SYMBOL_GPL(snd_soc_component_enable_pin_unlocked); 162 - 163 - int snd_soc_component_disable_pin(struct snd_soc_component *component, 164 - const char *pin) 165 - { 166 - struct snd_soc_dapm_context *dapm = 167 - snd_soc_component_get_dapm(component); 168 - return snd_soc_dapm_disable_pin(dapm, pin); 169 - } 170 - EXPORT_SYMBOL_GPL(snd_soc_component_disable_pin); 171 - 172 - int snd_soc_component_disable_pin_unlocked(struct snd_soc_component *component, 173 - const char *pin) 174 - { 175 - struct snd_soc_dapm_context *dapm = 176 - snd_soc_component_get_dapm(component); 177 - return snd_soc_dapm_disable_pin_unlocked(dapm, pin); 178 - } 179 - EXPORT_SYMBOL_GPL(snd_soc_component_disable_pin_unlocked); 180 - 181 - int snd_soc_component_nc_pin(struct snd_soc_component *component, 182 - const char *pin) 183 - { 184 - struct snd_soc_dapm_context *dapm = 185 - snd_soc_component_get_dapm(component); 186 - return snd_soc_dapm_nc_pin(dapm, pin); 187 - } 188 - EXPORT_SYMBOL_GPL(snd_soc_component_nc_pin); 189 - 190 - int snd_soc_component_nc_pin_unlocked(struct snd_soc_component *component, 191 - const char *pin) 192 - { 193 - struct snd_soc_dapm_context *dapm = 194 - snd_soc_component_get_dapm(component); 195 - return snd_soc_dapm_nc_pin_unlocked(dapm, pin); 196 - } 197 - EXPORT_SYMBOL_GPL(snd_soc_component_nc_pin_unlocked); 198 - 199 - int snd_soc_component_get_pin_status(struct snd_soc_component *component, 200 - const char *pin) 201 - { 202 - struct snd_soc_dapm_context *dapm = 203 - snd_soc_component_get_dapm(component); 204 - return snd_soc_dapm_get_pin_status(dapm, pin); 205 - } 206 - EXPORT_SYMBOL_GPL(snd_soc_component_get_pin_status); 207 - 208 - int snd_soc_component_force_enable_pin(struct snd_soc_component *component, 209 - const char *pin) 210 - { 211 - struct snd_soc_dapm_context *dapm = 212 - snd_soc_component_get_dapm(component); 213 - return snd_soc_dapm_force_enable_pin(dapm, pin); 214 - } 215 - EXPORT_SYMBOL_GPL(snd_soc_component_force_enable_pin); 216 - 217 - int snd_soc_component_force_enable_pin_unlocked( 218 - struct snd_soc_component *component, 219 - const char *pin) 220 - { 221 - struct snd_soc_dapm_context *dapm = 222 - snd_soc_component_get_dapm(component); 223 - return snd_soc_dapm_force_enable_pin_unlocked(dapm, pin); 224 - } 225 - EXPORT_SYMBOL_GPL(snd_soc_component_force_enable_pin_unlocked); 226 - 227 145 static void soc_get_kcontrol_name(struct snd_soc_component *component, 228 146 char *buf, int size, const char * const ctl) 229 147 {
+8
sound/soc/soc-core.c
··· 2556 2556 if (!card->name || !card->dev) 2557 2557 return -EINVAL; 2558 2558 2559 + card->dapm = snd_soc_dapm_alloc(card->dev); 2560 + if (!card->dapm) 2561 + return -ENOMEM; 2562 + 2559 2563 dev_set_drvdata(card->dev, card); 2560 2564 2561 2565 INIT_LIST_HEAD(&card->widgets); ··· 2844 2840 const struct snd_soc_component_driver *driver, 2845 2841 struct device *dev) 2846 2842 { 2843 + component->dapm = snd_soc_dapm_alloc(dev); 2844 + if (!component->dapm) 2845 + return -ENOMEM; 2846 + 2847 2847 INIT_LIST_HEAD(&component->dai_list); 2848 2848 INIT_LIST_HEAD(&component->dobj_list); 2849 2849 INIT_LIST_HEAD(&component->card_list);
+185 -167
sound/soc/soc-dapm.c
··· 40 40 41 41 #include <trace/events/asoc.h> 42 42 43 + /* DAPM context */ 44 + struct snd_soc_dapm_context { 45 + enum snd_soc_bias_level bias_level; 46 + 47 + bool idle_bias; /* Use BIAS_OFF instead of STANDBY when false */ 48 + 49 + struct snd_soc_component *component; /* parent component */ 50 + struct snd_soc_card *card; /* parent card */ 51 + 52 + /* used during DAPM updates */ 53 + enum snd_soc_bias_level target_bias_level; 54 + struct list_head list; 55 + 56 + struct snd_soc_dapm_widget *wcache_sink; 57 + struct snd_soc_dapm_widget *wcache_source; 58 + 59 + #ifdef CONFIG_DEBUG_FS 60 + struct dentry *debugfs_dapm; 61 + #endif 62 + }; 63 + 43 64 #define DAPM_UPDATE_STAT(widget, val) widget->dapm->card->dapm_stats.val++; 44 65 45 - #define SND_SOC_DAPM_DIR_REVERSE(x) ((x == SND_SOC_DAPM_DIR_IN) ? \ 66 + #define DAPM_DIR_REVERSE(x) ((x == SND_SOC_DAPM_DIR_IN) ? \ 46 67 SND_SOC_DAPM_DIR_OUT : SND_SOC_DAPM_DIR_IN) 47 68 48 - #define snd_soc_dapm_for_each_direction(dir) \ 69 + #define dapm_for_each_direction(dir) \ 49 70 for ((dir) = SND_SOC_DAPM_DIR_IN; (dir) <= SND_SOC_DAPM_DIR_OUT; \ 50 71 (dir)++) 51 72 ··· 159 138 snd_soc_dapm_mutex_assert_held(dapm); 160 139 } 161 140 162 - static void pop_wait(u32 pop_time) 141 + static void dapm_pop_wait(u32 pop_time) 163 142 { 164 143 if (pop_time) 165 144 schedule_timeout_uninterruptible(msecs_to_jiffies(pop_time)); 166 145 } 167 146 168 147 __printf(3, 4) 169 - static void pop_dbg(struct device *dev, u32 pop_time, const char *fmt, ...) 148 + static void dapm_pop_dbg(struct device *dev, u32 pop_time, const char *fmt, ...) 170 149 { 171 150 va_list args; 172 151 char *buf; ··· 184 163 va_end(args); 185 164 186 165 kfree(buf); 166 + } 167 + 168 + struct snd_soc_dapm_context *snd_soc_dapm_alloc(struct device *dev) 169 + { 170 + return devm_kzalloc(dev, sizeof(struct snd_soc_dapm_context), GFP_KERNEL); 187 171 } 188 172 189 173 struct device *snd_soc_dapm_to_dev(struct snd_soc_dapm_context *dapm) ··· 240 214 static __always_inline void dapm_widget_invalidate_paths( 241 215 struct snd_soc_dapm_widget *w, enum snd_soc_dapm_direction dir) 242 216 { 243 - enum snd_soc_dapm_direction rdir = SND_SOC_DAPM_DIR_REVERSE(dir); 217 + enum snd_soc_dapm_direction rdir = DAPM_DIR_REVERSE(dir); 244 218 struct snd_soc_dapm_widget *node; 245 219 struct snd_soc_dapm_path *p; 246 220 LIST_HEAD(list); ··· 387 361 struct snd_soc_dapm_widget_list *wlist; 388 362 }; 389 363 390 - static unsigned int soc_dapm_read(struct snd_soc_dapm_context *dapm, int reg) 364 + static unsigned int dapm_read(struct snd_soc_dapm_context *dapm, int reg) 391 365 { 392 366 if (!dapm->component) 393 367 return -EIO; ··· 407 381 unsigned int shift = mc->shift; 408 382 unsigned int max = mc->max; 409 383 unsigned int mask = (1 << fls(max)) - 1; 410 - unsigned int val = soc_dapm_read(p->sink->dapm, reg); 384 + unsigned int val = dapm_read(p->sink->dapm, reg); 411 385 412 386 /* 413 387 * The nth_path argument allows this function to know ··· 423 397 */ 424 398 if (snd_soc_volsw_is_stereo(mc) && nth_path > 0) { 425 399 if (reg != mc->rreg) 426 - val = soc_dapm_read(p->sink->dapm, mc->rreg); 400 + val = dapm_read(p->sink->dapm, mc->rreg); 427 401 val = (val >> mc->rshift) & mask; 428 402 } else { 429 403 val = (val >> shift) & mask; ··· 455 429 if (e->reg != SND_SOC_NOPM) { 456 430 unsigned int val; 457 431 458 - val = soc_dapm_read(dapm, e->reg); 432 + val = dapm_read(dapm, e->reg); 459 433 val = (val >> e->shift_l) & e->mask; 460 434 item = snd_soc_enum_val_to_item(e, val); 461 435 } else { ··· 543 517 break; 544 518 case snd_soc_dapm_line: 545 519 ep = 0; 546 - snd_soc_dapm_for_each_direction(dir) { 520 + dapm_for_each_direction(dir) { 547 521 if (!list_empty(&w->edges[dir])) 548 522 ep |= SND_SOC_DAPM_DIR_TO_EP(dir); 549 523 } ··· 555 529 w->is_ep = ep; 556 530 } 557 531 558 - static int snd_soc_dapm_check_dynamic_path( 532 + static int dapm_check_dynamic_path( 559 533 struct snd_soc_dapm_context *dapm, 560 534 struct snd_soc_dapm_widget *source, struct snd_soc_dapm_widget *sink, 561 535 const char *control) ··· 601 575 return 0; 602 576 } 603 577 604 - static int snd_soc_dapm_add_path( 578 + static int dapm_add_path( 605 579 struct snd_soc_dapm_context *dapm, 606 580 struct snd_soc_dapm_widget *wsource, struct snd_soc_dapm_widget *wsink, 607 581 const char *control, ··· 634 608 return -EINVAL; 635 609 } 636 610 637 - ret = snd_soc_dapm_check_dynamic_path(dapm, wsource, wsink, control); 611 + ret = dapm_check_dynamic_path(dapm, wsource, wsink, control); 638 612 if (ret) 639 613 return ret; 640 614 ··· 686 660 687 661 list_add(&path->list, &dapm->card->paths); 688 662 689 - snd_soc_dapm_for_each_direction(dir) 663 + dapm_for_each_direction(dir) 690 664 list_add(&path->list_node[dir], &path->node[dir]->edges[dir]); 691 665 692 - snd_soc_dapm_for_each_direction(dir) { 666 + dapm_for_each_direction(dir) { 693 667 dapm_update_widget_flags(path->node[dir]); 694 668 dapm_mark_dirty(path->node[dir], "Route added"); 695 669 } ··· 797 771 goto err_data; 798 772 } 799 773 800 - snd_soc_dapm_add_path(widget->dapm, data->widget, 801 - widget, NULL, NULL); 774 + dapm_add_path(widget->dapm, data->widget, 775 + widget, NULL, NULL); 802 776 } else if (e->reg != SND_SOC_NOPM) { 803 - data->value = soc_dapm_read(widget->dapm, e->reg) & 777 + data->value = dapm_read(widget->dapm, e->reg) & 804 778 (e->mask << e->shift_l); 805 779 } 806 780 break; ··· 980 954 } 981 955 } 982 956 983 - static const char *soc_dapm_prefix(struct snd_soc_dapm_context *dapm) 957 + static const char *dapm_prefix(struct snd_soc_dapm_context *dapm) 984 958 { 985 959 if (!dapm->component) 986 960 return NULL; 987 961 return dapm->component->name_prefix; 988 962 } 989 963 990 - static int soc_dapm_update_bits(struct snd_soc_dapm_context *dapm, 964 + static int dapm_update_bits(struct snd_soc_dapm_context *dapm, 991 965 int reg, unsigned int mask, unsigned int value) 992 966 { 993 967 if (!dapm->component) ··· 996 970 mask, value); 997 971 } 998 972 999 - static int soc_dapm_test_bits(struct snd_soc_dapm_context *dapm, 973 + static int dapm_test_bits(struct snd_soc_dapm_context *dapm, 1000 974 int reg, unsigned int mask, unsigned int value) 1001 975 { 1002 976 if (!dapm->component) ··· 1004 978 return snd_soc_component_test_bits(dapm->component, reg, mask, value); 1005 979 } 1006 980 1007 - static void soc_dapm_async_complete(struct snd_soc_dapm_context *dapm) 981 + static void dapm_async_complete(struct snd_soc_dapm_context *dapm) 1008 982 { 1009 983 if (dapm->component) 1010 984 snd_soc_component_async_complete(dapm->component); ··· 1102 1076 if (ret != 0) 1103 1077 goto out; 1104 1078 1105 - if (dapm != &card->dapm) 1079 + if (dapm != card->dapm) 1106 1080 ret = snd_soc_dapm_force_bias_level(dapm, level); 1107 1081 1108 1082 if (ret != 0) ··· 1175 1149 const char *name; 1176 1150 int ret = 0; 1177 1151 1178 - prefix = soc_dapm_prefix(dapm); 1152 + prefix = dapm_prefix(dapm); 1179 1153 if (prefix) 1180 1154 prefix_len = strlen(prefix) + 1; 1181 1155 else ··· 1295 1269 1296 1270 data = snd_kcontrol_chip(w->kcontrols[i]); 1297 1271 if (data->widget) 1298 - snd_soc_dapm_add_path(data->widget->dapm, 1299 - data->widget, 1300 - path->source, 1301 - NULL, NULL); 1272 + dapm_add_path(data->widget->dapm, 1273 + data->widget, 1274 + path->source, 1275 + NULL, NULL); 1302 1276 } 1303 1277 } 1304 1278 ··· 1402 1376 * the ALSA card - when we are suspending the ALSA state for the card 1403 1377 * is set to D3. 1404 1378 */ 1405 - static int snd_soc_dapm_suspend_check(struct snd_soc_dapm_widget *widget) 1379 + static int dapm_suspend_check(struct snd_soc_dapm_widget *widget) 1406 1380 { 1407 1381 struct device *dev = snd_soc_dapm_to_dev(widget->dapm); 1408 1382 int level = snd_power_get_state(widget->dapm->card->snd_card); ··· 1454 1428 * widget and all widgets that can be reached via incoming or outcoming paths 1455 1429 * from the widget. 1456 1430 */ 1457 - static void invalidate_paths_ep(struct snd_soc_dapm_widget *widget, 1431 + static void dapm_invalidate_paths_ep(struct snd_soc_dapm_widget *widget, 1458 1432 enum snd_soc_dapm_direction dir) 1459 1433 { 1460 - enum snd_soc_dapm_direction rdir = SND_SOC_DAPM_DIR_REVERSE(dir); 1434 + enum snd_soc_dapm_direction rdir = DAPM_DIR_REVERSE(dir); 1461 1435 struct snd_soc_dapm_path *path; 1462 1436 1463 1437 widget->endpoints[dir] = -1; ··· 1471 1445 1472 1446 if (path->connect) { 1473 1447 path->walking = 1; 1474 - invalidate_paths_ep(path->node[dir], dir); 1448 + dapm_invalidate_paths_ep(path->node[dir], dir); 1475 1449 path->walking = 0; 1476 1450 } 1477 1451 } ··· 1484 1458 * generic function and at the same time the fast path of the specialized 1485 1459 * functions is significantly smaller than the generic function. 1486 1460 */ 1487 - static __always_inline int is_connected_ep(struct snd_soc_dapm_widget *widget, 1461 + static __always_inline int dapm_is_connected_ep(struct snd_soc_dapm_widget *widget, 1488 1462 struct list_head *list, enum snd_soc_dapm_direction dir, 1489 1463 int (*fn)(struct snd_soc_dapm_widget *, struct list_head *, 1490 1464 bool (*custom_stop_condition)(struct snd_soc_dapm_widget *, ··· 1492 1466 bool (*custom_stop_condition)(struct snd_soc_dapm_widget *, 1493 1467 enum snd_soc_dapm_direction)) 1494 1468 { 1495 - enum snd_soc_dapm_direction rdir = SND_SOC_DAPM_DIR_REVERSE(dir); 1469 + enum snd_soc_dapm_direction rdir = DAPM_DIR_REVERSE(dir); 1496 1470 struct snd_soc_dapm_path *path; 1497 1471 int con = 0; 1498 1472 ··· 1511 1485 } 1512 1486 1513 1487 if ((widget->is_ep & SND_SOC_DAPM_DIR_TO_EP(dir)) && widget->connected) { 1514 - widget->endpoints[dir] = snd_soc_dapm_suspend_check(widget); 1488 + widget->endpoints[dir] = dapm_suspend_check(widget); 1515 1489 return widget->endpoints[dir]; 1516 1490 } 1517 1491 ··· 1547 1521 * direction as an arguments, it should return true if widgets from that point 1548 1522 * in the graph onwards should not be added to the widget list. 1549 1523 */ 1550 - static int is_connected_output_ep(struct snd_soc_dapm_widget *widget, 1524 + static int dapm_is_connected_output_ep(struct snd_soc_dapm_widget *widget, 1551 1525 struct list_head *list, 1552 1526 bool (*custom_stop_condition)(struct snd_soc_dapm_widget *i, 1553 1527 enum snd_soc_dapm_direction)) 1554 1528 { 1555 - return is_connected_ep(widget, list, SND_SOC_DAPM_DIR_OUT, 1556 - is_connected_output_ep, custom_stop_condition); 1529 + return dapm_is_connected_ep(widget, list, SND_SOC_DAPM_DIR_OUT, 1530 + dapm_is_connected_output_ep, custom_stop_condition); 1557 1531 } 1558 1532 1559 1533 /* ··· 1565 1539 * direction as an arguments, it should return true if the walk should be 1566 1540 * stopped and false otherwise. 1567 1541 */ 1568 - static int is_connected_input_ep(struct snd_soc_dapm_widget *widget, 1542 + static int dapm_is_connected_input_ep(struct snd_soc_dapm_widget *widget, 1569 1543 struct list_head *list, 1570 1544 bool (*custom_stop_condition)(struct snd_soc_dapm_widget *i, 1571 1545 enum snd_soc_dapm_direction)) 1572 1546 { 1573 - return is_connected_ep(widget, list, SND_SOC_DAPM_DIR_IN, 1574 - is_connected_input_ep, custom_stop_condition); 1547 + return dapm_is_connected_ep(widget, list, SND_SOC_DAPM_DIR_IN, 1548 + dapm_is_connected_input_ep, custom_stop_condition); 1575 1549 } 1576 1550 1577 1551 /** ··· 1607 1581 snd_soc_dapm_mutex_lock(card); 1608 1582 1609 1583 if (stream == SNDRV_PCM_STREAM_PLAYBACK) { 1610 - invalidate_paths_ep(w, SND_SOC_DAPM_DIR_OUT); 1611 - paths = is_connected_output_ep(w, &widgets, 1584 + dapm_invalidate_paths_ep(w, SND_SOC_DAPM_DIR_OUT); 1585 + paths = dapm_is_connected_output_ep(w, &widgets, 1612 1586 custom_stop_condition); 1613 1587 } else { 1614 - invalidate_paths_ep(w, SND_SOC_DAPM_DIR_IN); 1615 - paths = is_connected_input_ep(w, &widgets, 1588 + dapm_invalidate_paths_ep(w, SND_SOC_DAPM_DIR_IN); 1589 + paths = dapm_is_connected_input_ep(w, &widgets, 1616 1590 custom_stop_condition); 1617 1591 } 1618 1592 ··· 1645 1619 struct device *dev = snd_soc_dapm_to_dev(w->dapm); 1646 1620 int ret; 1647 1621 1648 - soc_dapm_async_complete(w->dapm); 1622 + dapm_async_complete(w->dapm); 1649 1623 1650 1624 if (SND_SOC_DAPM_EVENT_ON(event)) { 1651 1625 if (w->on_val & SND_SOC_DAPM_REGULATOR_BYPASS) { ··· 1705 1679 if (!w->clk) 1706 1680 return -EIO; 1707 1681 1708 - soc_dapm_async_complete(w->dapm); 1682 + dapm_async_complete(w->dapm); 1709 1683 1710 1684 if (SND_SOC_DAPM_EVENT_ON(event)) { 1711 1685 return clk_prepare_enable(w->clk); ··· 1740 1714 1741 1715 DAPM_UPDATE_STAT(w, power_checks); 1742 1716 1743 - in = is_connected_input_ep(w, NULL, NULL); 1744 - out = is_connected_output_ep(w, NULL, NULL); 1717 + in = dapm_is_connected_input_ep(w, NULL, NULL); 1718 + out = dapm_is_connected_output_ep(w, NULL, NULL); 1745 1719 return out != 0 && in != 0; 1746 1720 } 1747 1721 ··· 1864 1838 if (w->event && (w->event_flags & event)) { 1865 1839 int ret; 1866 1840 1867 - pop_dbg(dev, card->pop_time, "pop test : %s %s\n", 1841 + dapm_pop_dbg(dev, card->pop_time, "pop test : %s %s\n", 1868 1842 w->name, ev_name); 1869 - soc_dapm_async_complete(w->dapm); 1843 + dapm_async_complete(w->dapm); 1870 1844 trace_snd_soc_dapm_widget_event_start(w, event); 1871 1845 ret = w->event(w, NULL, event); 1872 1846 trace_snd_soc_dapm_widget_event_done(w, event); ··· 1901 1875 else 1902 1876 value |= w->off_val << w->shift; 1903 1877 1904 - pop_dbg(dev, card->pop_time, 1878 + dapm_pop_dbg(dev, card->pop_time, 1905 1879 "pop test : Queue %s: reg=0x%x, 0x%x/0x%x\n", 1906 1880 w->name, reg, value, mask); 1907 1881 ··· 1915 1889 * same register. 1916 1890 */ 1917 1891 1918 - pop_dbg(dev, card->pop_time, 1892 + dapm_pop_dbg(dev, card->pop_time, 1919 1893 "pop test : Applying 0x%x/0x%x to %x in %dms\n", 1920 1894 value, mask, reg, card->pop_time); 1921 - pop_wait(card->pop_time); 1922 - soc_dapm_update_bits(dapm, reg, mask, value); 1895 + dapm_pop_wait(card->pop_time); 1896 + dapm_update_bits(dapm, reg, mask, value); 1923 1897 } 1924 1898 1925 1899 list_for_each_entry(w, pending, power_list) { ··· 1973 1947 } 1974 1948 1975 1949 if (cur_dapm && w->dapm != cur_dapm) 1976 - soc_dapm_async_complete(cur_dapm); 1950 + dapm_async_complete(cur_dapm); 1977 1951 1978 1952 INIT_LIST_HEAD(&pending); 1979 1953 cur_sort = -1; ··· 2034 2008 } 2035 2009 2036 2010 for_each_card_dapms(card, d) 2037 - soc_dapm_async_complete(d); 2011 + dapm_async_complete(d); 2038 2012 } 2039 2013 2040 2014 static void dapm_widget_update(struct snd_soc_card *card, struct snd_soc_dapm_update *update) ··· 2062 2036 if (!w) 2063 2037 return; 2064 2038 2065 - ret = soc_dapm_update_bits(w->dapm, update->reg, update->mask, 2039 + ret = dapm_update_bits(w->dapm, update->reg, update->mask, 2066 2040 update->val); 2067 2041 if (ret < 0) 2068 2042 dev_err(dev, "ASoC: %s DAPM update failed: %d\n", 2069 2043 w->name, ret); 2070 2044 2071 2045 if (update->has_second_set) { 2072 - ret = soc_dapm_update_bits(w->dapm, update->reg2, 2046 + ret = dapm_update_bits(w->dapm, update->reg2, 2073 2047 update->mask2, update->val2); 2074 2048 if (ret < 0) 2075 2049 dev_err(dev, ··· 2384 2358 return ret; 2385 2359 } 2386 2360 2387 - pop_dbg(card->dev, card->pop_time, 2361 + dapm_pop_dbg(card->dev, card->pop_time, 2388 2362 "DAPM sequencing finished, waiting %dms\n", card->pop_time); 2389 - pop_wait(card->pop_time); 2363 + dapm_pop_wait(card->pop_time); 2390 2364 2391 2365 trace_snd_soc_dapm_done(card, event); 2392 2366 ··· 2395 2369 2396 2370 #ifdef CONFIG_DEBUG_FS 2397 2371 2398 - static const char * const snd_soc_dapm_type_name[] = { 2372 + static const char * const dapm_type_name[] = { 2399 2373 [snd_soc_dapm_input] = "input", 2400 2374 [snd_soc_dapm_output] = "output", 2401 2375 [snd_soc_dapm_mux] = "mux", ··· 2448 2422 struct snd_soc_dapm_path *p = NULL; 2449 2423 const char *c_name; 2450 2424 2451 - BUILD_BUG_ON(ARRAY_SIZE(snd_soc_dapm_type_name) != SND_SOC_DAPM_TYPE_COUNT); 2425 + BUILD_BUG_ON(ARRAY_SIZE(dapm_type_name) != SND_SOC_DAPM_TYPE_COUNT); 2452 2426 2453 2427 buf = kmalloc(PAGE_SIZE, GFP_KERNEL); 2454 2428 if (!buf) ··· 2456 2430 2457 2431 snd_soc_dapm_mutex_lock_root(w->dapm); 2458 2432 2459 - /* Supply widgets are not handled by is_connected_{input,output}_ep() */ 2433 + /* Supply widgets are not handled by dapm_is_connected_{input,output}_ep() */ 2460 2434 if (w->is_supply) { 2461 2435 in = 0; 2462 2436 out = 0; 2463 2437 } else { 2464 - in = is_connected_input_ep(w, NULL, NULL); 2465 - out = is_connected_output_ep(w, NULL, NULL); 2438 + in = dapm_is_connected_input_ep(w, NULL, NULL); 2439 + out = dapm_is_connected_output_ep(w, NULL, NULL); 2466 2440 } 2467 2441 2468 2442 ret = scnprintf(buf, PAGE_SIZE, "%s: %s%s in %d out %d", ··· 2482 2456 w->active ? "active" : "inactive"); 2483 2457 2484 2458 ret += scnprintf(buf + ret, PAGE_SIZE - ret, " widget-type %s\n", 2485 - snd_soc_dapm_type_name[w->id]); 2459 + dapm_type_name[w->id]); 2486 2460 2487 - snd_soc_dapm_for_each_direction(dir) { 2488 - rdir = SND_SOC_DAPM_DIR_REVERSE(dir); 2461 + dapm_for_each_direction(dir) { 2462 + rdir = DAPM_DIR_REVERSE(dir); 2489 2463 snd_soc_dapm_widget_for_each_path(w, dir, p) { 2490 2464 if (p->connected && !p->connected(p->source, p->sink)) 2491 2465 continue; ··· 2612 2586 #endif 2613 2587 2614 2588 /* 2615 - * soc_dapm_connect_path() - Connects or disconnects a path 2589 + * dapm_connect_path() - Connects or disconnects a path 2616 2590 * @path: The path to update 2617 2591 * @connect: The new connect state of the path. True if the path is connected, 2618 2592 * false if it is disconnected. 2619 2593 * @reason: The reason why the path changed (for debugging only) 2620 2594 */ 2621 - static void soc_dapm_connect_path(struct snd_soc_dapm_path *path, 2595 + static void dapm_connect_path(struct snd_soc_dapm_path *path, 2622 2596 bool connect, const char *reason) 2623 2597 { 2624 2598 if (path->connect == connect) ··· 2631 2605 } 2632 2606 2633 2607 /* test and update the power status of a mux widget */ 2634 - static int soc_dapm_mux_update_power(struct snd_soc_card *card, 2635 - struct snd_kcontrol *kcontrol, 2636 - struct snd_soc_dapm_update *update, 2637 - int mux, struct soc_enum *e) 2608 + static int dapm_mux_update_power(struct snd_soc_card *card, 2609 + struct snd_kcontrol *kcontrol, 2610 + struct snd_soc_dapm_update *update, 2611 + int mux, struct soc_enum *e) 2638 2612 { 2639 2613 struct snd_soc_dapm_path *path; 2640 2614 int found = 0; ··· 2651 2625 else 2652 2626 connect = false; 2653 2627 2654 - soc_dapm_connect_path(path, connect, "mux update"); 2628 + dapm_connect_path(path, connect, "mux update"); 2655 2629 } 2656 2630 2657 2631 if (found) ··· 2668 2642 int ret; 2669 2643 2670 2644 snd_soc_dapm_mutex_lock(card); 2671 - ret = soc_dapm_mux_update_power(card, kcontrol, update, mux, e); 2645 + ret = dapm_mux_update_power(card, kcontrol, update, mux, e); 2672 2646 snd_soc_dapm_mutex_unlock(card); 2673 2647 if (ret > 0) 2674 2648 snd_soc_dpcm_runtime_update(card); ··· 2677 2651 EXPORT_SYMBOL_GPL(snd_soc_dapm_mux_update_power); 2678 2652 2679 2653 /* test and update the power status of a mixer or switch widget */ 2680 - static int soc_dapm_mixer_update_power(struct snd_soc_card *card, 2681 - struct snd_kcontrol *kcontrol, 2682 - struct snd_soc_dapm_update *update, 2683 - int connect, int rconnect) 2654 + static int dapm_mixer_update_power(struct snd_soc_card *card, 2655 + struct snd_kcontrol *kcontrol, 2656 + struct snd_soc_dapm_update *update, 2657 + int connect, int rconnect) 2684 2658 { 2685 2659 struct snd_soc_dapm_path *path; 2686 2660 int found = 0; ··· 2712 2686 * channel. 2713 2687 */ 2714 2688 if (found && rconnect >= 0) 2715 - soc_dapm_connect_path(path, rconnect, "mixer update"); 2689 + dapm_connect_path(path, rconnect, "mixer update"); 2716 2690 else 2717 - soc_dapm_connect_path(path, connect, "mixer update"); 2691 + dapm_connect_path(path, connect, "mixer update"); 2718 2692 found = 1; 2719 2693 } 2720 2694 ··· 2732 2706 int ret; 2733 2707 2734 2708 snd_soc_dapm_mutex_lock(card); 2735 - ret = soc_dapm_mixer_update_power(card, kcontrol, update, connect, -1); 2709 + ret = dapm_mixer_update_power(card, kcontrol, update, connect, -1); 2736 2710 snd_soc_dapm_mutex_unlock(card); 2737 2711 if (ret > 0) 2738 2712 snd_soc_dpcm_runtime_update(card); ··· 2862 2836 * While removing the path, remove reference to it from both 2863 2837 * source and sink widgets so that path is removed only once. 2864 2838 */ 2865 - snd_soc_dapm_for_each_direction(dir) { 2839 + dapm_for_each_direction(dir) { 2866 2840 snd_soc_dapm_widget_for_each_path_safe(w, dir, p, next_p) 2867 2841 dapm_free_path(p); 2868 2842 } ··· 2899 2873 struct snd_soc_dapm_widget *fallback = NULL; 2900 2874 char prefixed_pin[80]; 2901 2875 const char *pin_name; 2902 - const char *prefix = soc_dapm_prefix(dapm); 2876 + const char *prefix = dapm_prefix(dapm); 2903 2877 2904 2878 if (prefix) { 2905 2879 snprintf(prefixed_pin, sizeof(prefixed_pin), "%s %s", ··· 2929 2903 * returns 1 when the value has been updated, 0 when unchanged, or a negative 2930 2904 * error code; called from kcontrol put callback 2931 2905 */ 2932 - static int __snd_soc_dapm_set_pin(struct snd_soc_dapm_context *dapm, 2933 - const char *pin, int status) 2906 + static int __dapm_set_pin(struct snd_soc_dapm_context *dapm, 2907 + const char *pin, int status) 2934 2908 { 2935 2909 struct snd_soc_dapm_widget *w = dapm_find_widget(dapm, pin, true); 2936 2910 struct device *dev = snd_soc_dapm_to_dev(dapm); ··· 2958 2932 } 2959 2933 2960 2934 /* 2961 - * similar as __snd_soc_dapm_set_pin(), but returns 0 when successful; 2935 + * similar as __dapm_set_pin(), but returns 0 when successful; 2962 2936 * called from several API functions below 2963 2937 */ 2964 - static int snd_soc_dapm_set_pin(struct snd_soc_dapm_context *dapm, 2938 + static int dapm_set_pin(struct snd_soc_dapm_context *dapm, 2965 2939 const char *pin, int status) 2966 2940 { 2967 - int ret = __snd_soc_dapm_set_pin(dapm, pin, status); 2941 + int ret = __dapm_set_pin(dapm, pin, status); 2968 2942 2969 2943 return ret < 0 ? ret : 0; 2970 2944 } ··· 3032 3006 p->source->name, p->sink->name); 3033 3007 3034 3008 if (w->channel < channels) 3035 - soc_dapm_connect_path(p, true, "dai update"); 3009 + dapm_connect_path(p, true, "dai update"); 3036 3010 else 3037 - soc_dapm_connect_path(p, false, "dai update"); 3011 + dapm_connect_path(p, false, "dai update"); 3038 3012 3039 3013 return 0; 3040 3014 } ··· 3112 3086 unsigned int source_ref = 0; 3113 3087 int ret; 3114 3088 3115 - prefix = soc_dapm_prefix(dapm); 3089 + prefix = dapm_prefix(dapm); 3116 3090 if (prefix) { 3117 3091 snprintf(prefixed_sink, sizeof(prefixed_sink), "%s %s", 3118 3092 prefix, route->sink); ··· 3181 3155 dapm->wcache_sink = wsink; 3182 3156 dapm->wcache_source = wsource; 3183 3157 3184 - ret = snd_soc_dapm_add_path(dapm, wsource, wsink, route->control, 3158 + ret = dapm_add_path(dapm, wsource, wsink, route->control, 3185 3159 route->connected); 3186 3160 err: 3187 3161 if (ret) ··· 3211 3185 return -EINVAL; 3212 3186 } 3213 3187 3214 - prefix = soc_dapm_prefix(dapm); 3188 + prefix = dapm_prefix(dapm); 3215 3189 if (prefix) { 3216 3190 snprintf(prefixed_sink, sizeof(prefixed_sink), "%s %s", 3217 3191 prefix, route->sink); ··· 3365 3339 3366 3340 /* Read the initial power state from the device */ 3367 3341 if (w->reg >= 0) { 3368 - val = soc_dapm_read(w->dapm, w->reg); 3342 + val = dapm_read(w->dapm, w->reg); 3369 3343 val = val >> w->shift; 3370 3344 val &= w->mask; 3371 3345 if (val == w->on_val) ··· 3409 3383 3410 3384 snd_soc_dapm_mutex_lock(dapm); 3411 3385 if (dapm_kcontrol_is_powered(kcontrol) && reg != SND_SOC_NOPM) { 3412 - reg_val = soc_dapm_read(dapm, reg); 3386 + reg_val = dapm_read(dapm, reg); 3413 3387 val = (reg_val >> shift) & mask; 3414 3388 3415 3389 if (reg != mc->rreg) 3416 - reg_val = soc_dapm_read(dapm, mc->rreg); 3390 + reg_val = dapm_read(dapm, mc->rreg); 3417 3391 3418 3392 if (snd_soc_volsw_is_stereo(mc)) 3419 3393 rval = (reg_val >> mc->rshift) & mask; ··· 3497 3471 val = val << shift; 3498 3472 rval = rval << mc->rshift; 3499 3473 3500 - reg_change = soc_dapm_test_bits(dapm, reg, mask << shift, val); 3474 + reg_change = dapm_test_bits(dapm, reg, mask << shift, val); 3501 3475 3502 3476 if (snd_soc_volsw_is_stereo(mc)) 3503 - reg_change |= soc_dapm_test_bits(dapm, mc->rreg, 3504 - mask << mc->rshift, 3505 - rval); 3477 + reg_change |= dapm_test_bits(dapm, mc->rreg, 3478 + mask << mc->rshift, 3479 + rval); 3506 3480 } 3507 3481 3508 3482 if (change || reg_change) { ··· 3519 3493 update.val = val; 3520 3494 pupdate = &update; 3521 3495 } 3522 - ret = soc_dapm_mixer_update_power(card, kcontrol, pupdate, connect, rconnect); 3496 + ret = dapm_mixer_update_power(card, kcontrol, pupdate, connect, rconnect); 3523 3497 } 3524 3498 3525 3499 snd_soc_dapm_mutex_unlock(card); ··· 3549 3523 3550 3524 snd_soc_dapm_mutex_lock(dapm); 3551 3525 if (e->reg != SND_SOC_NOPM && dapm_kcontrol_is_powered(kcontrol)) { 3552 - reg_val = soc_dapm_read(dapm, e->reg); 3526 + reg_val = dapm_read(dapm, e->reg); 3553 3527 } else { 3554 3528 reg_val = snd_soc_dapm_kcontrol_get_value(kcontrol); 3555 3529 } ··· 3606 3580 change = dapm_kcontrol_set_value(kcontrol, val); 3607 3581 3608 3582 if (e->reg != SND_SOC_NOPM) 3609 - reg_change = soc_dapm_test_bits(dapm, e->reg, mask, val); 3583 + reg_change = dapm_test_bits(dapm, e->reg, mask, val); 3610 3584 3611 3585 if (change || reg_change) { 3612 3586 if (reg_change) { ··· 3616 3590 update.val = val; 3617 3591 pupdate = &update; 3618 3592 } 3619 - ret = soc_dapm_mux_update_power(card, kcontrol, pupdate, item[0], e); 3593 + ret = dapm_mux_update_power(card, kcontrol, pupdate, item[0], e); 3620 3594 } 3621 3595 3622 3596 snd_soc_dapm_mutex_unlock(card); ··· 3699 3673 } 3700 3674 EXPORT_SYMBOL_GPL(snd_soc_dapm_get_component_pin_switch); 3701 3675 3702 - static int __snd_soc_dapm_put_pin_switch(struct snd_soc_dapm_context *dapm, 3703 - const char *pin, 3704 - struct snd_ctl_elem_value *ucontrol) 3676 + static int __dapm_put_pin_switch(struct snd_soc_dapm_context *dapm, 3677 + const char *pin, 3678 + struct snd_ctl_elem_value *ucontrol) 3705 3679 { 3706 3680 int ret; 3707 3681 3708 3682 snd_soc_dapm_mutex_lock(dapm); 3709 - ret = __snd_soc_dapm_set_pin(dapm, pin, !!ucontrol->value.integer.value[0]); 3683 + ret = __dapm_set_pin(dapm, pin, !!ucontrol->value.integer.value[0]); 3710 3684 snd_soc_dapm_mutex_unlock(dapm); 3711 3685 3712 3686 snd_soc_dapm_sync(dapm); ··· 3730 3704 struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 3731 3705 const char *pin = (const char *)kcontrol->private_value; 3732 3706 3733 - return __snd_soc_dapm_put_pin_switch(dapm, pin, ucontrol); 3707 + return __dapm_put_pin_switch(dapm, pin, ucontrol); 3734 3708 } 3735 3709 EXPORT_SYMBOL_GPL(snd_soc_dapm_put_pin_switch); 3736 3710 ··· 3750 3724 struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 3751 3725 const char *pin = (const char *)kcontrol->private_value; 3752 3726 3753 - return __snd_soc_dapm_put_pin_switch(dapm, pin, ucontrol); 3727 + return __dapm_put_pin_switch(dapm, pin, ucontrol); 3754 3728 } 3755 3729 EXPORT_SYMBOL_GPL(snd_soc_dapm_put_component_pin_switch); 3756 3730 ··· 3763 3737 struct snd_soc_dapm_widget *w; 3764 3738 int ret = -ENOMEM; 3765 3739 3766 - w = dapm_cnew_widget(widget, soc_dapm_prefix(dapm)); 3740 + w = dapm_cnew_widget(widget, dapm_prefix(dapm)); 3767 3741 if (!w) 3768 3742 goto cnew_failed; 3769 3743 ··· 3878 3852 /* see for_each_card_widgets */ 3879 3853 list_add_tail(&w->list, &dapm->card->widgets); 3880 3854 3881 - snd_soc_dapm_for_each_direction(dir) { 3855 + dapm_for_each_direction(dir) { 3882 3856 INIT_LIST_HEAD(&w->edges[dir]); 3883 3857 w->endpoints[dir] = -1; 3884 3858 } ··· 3951 3925 } 3952 3926 EXPORT_SYMBOL_GPL(snd_soc_dapm_new_controls); 3953 3927 3954 - static int 3955 - snd_soc_dai_link_event_pre_pmu(struct snd_soc_dapm_widget *w, 3956 - struct snd_pcm_substream *substream) 3928 + static int dapm_dai_link_event_pre_pmu(struct snd_soc_dapm_widget *w, 3929 + struct snd_pcm_substream *substream) 3957 3930 { 3958 3931 struct device *dev = snd_soc_dapm_to_dev(w->dapm); 3959 3932 struct snd_soc_dapm_path *path; ··· 4067 4042 return 0; 4068 4043 } 4069 4044 4070 - static int snd_soc_dai_link_event(struct snd_soc_dapm_widget *w, 4071 - struct snd_kcontrol *kcontrol, int event) 4045 + static int dapm_dai_link_event(struct snd_soc_dapm_widget *w, 4046 + struct snd_kcontrol *kcontrol, int event) 4072 4047 { 4073 4048 struct snd_soc_dapm_path *path; 4074 4049 struct snd_soc_dai *source, *sink; ··· 4081 4056 4082 4057 switch (event) { 4083 4058 case SND_SOC_DAPM_PRE_PMU: 4084 - ret = snd_soc_dai_link_event_pre_pmu(w, substream); 4059 + ret = dapm_dai_link_event_pre_pmu(w, substream); 4085 4060 if (ret < 0) 4086 4061 goto out; 4087 4062 ··· 4159 4134 return ret; 4160 4135 } 4161 4136 4162 - static int snd_soc_dapm_dai_link_get(struct snd_kcontrol *kcontrol, 4163 - struct snd_ctl_elem_value *ucontrol) 4137 + static int dapm_dai_link_get(struct snd_kcontrol *kcontrol, 4138 + struct snd_ctl_elem_value *ucontrol) 4164 4139 { 4165 4140 struct snd_soc_dapm_widget *w = snd_kcontrol_chip(kcontrol); 4166 4141 struct snd_soc_pcm_runtime *rtd = w->priv; ··· 4170 4145 return 0; 4171 4146 } 4172 4147 4173 - static int snd_soc_dapm_dai_link_put(struct snd_kcontrol *kcontrol, 4174 - struct snd_ctl_elem_value *ucontrol) 4148 + static int dapm_dai_link_put(struct snd_kcontrol *kcontrol, 4149 + struct snd_ctl_elem_value *ucontrol) 4175 4150 { 4176 4151 struct snd_soc_dapm_widget *w = snd_kcontrol_chip(kcontrol); 4177 4152 struct snd_soc_pcm_runtime *rtd = w->priv; ··· 4191 4166 return 1; 4192 4167 } 4193 4168 4194 - static void 4195 - snd_soc_dapm_free_kcontrol(struct snd_soc_card *card, 4196 - unsigned long *private_value, 4197 - int num_c2c_params, 4198 - const char **w_param_text) 4169 + static void dapm_free_kcontrol(struct snd_soc_card *card, 4170 + unsigned long *private_value, 4171 + int num_c2c_params, 4172 + const char **w_param_text) 4199 4173 { 4200 4174 int count; 4201 4175 ··· 4209 4185 } 4210 4186 4211 4187 static struct snd_kcontrol_new * 4212 - snd_soc_dapm_alloc_kcontrol(struct snd_soc_card *card, 4188 + dapm_alloc_kcontrol(struct snd_soc_card *card, 4213 4189 char *link_name, 4214 4190 const struct snd_soc_pcm_stream *c2c_params, 4215 4191 int num_c2c_params, const char **w_param_text, ··· 4220 4196 }; 4221 4197 struct snd_kcontrol_new kcontrol_dai_link[] = { 4222 4198 SOC_ENUM_EXT(NULL, w_param_enum[0], 4223 - snd_soc_dapm_dai_link_get, 4224 - snd_soc_dapm_dai_link_put), 4199 + dapm_dai_link_get, 4200 + dapm_dai_link_put), 4225 4201 }; 4226 4202 struct snd_kcontrol_new *kcontrol_news; 4227 4203 const struct snd_soc_pcm_stream *config = c2c_params; ··· 4272 4248 return kcontrol_news; 4273 4249 4274 4250 outfree_w_param: 4275 - snd_soc_dapm_free_kcontrol(card, private_value, num_c2c_params, w_param_text); 4251 + dapm_free_kcontrol(card, private_value, num_c2c_params, w_param_text); 4252 + 4276 4253 return NULL; 4277 4254 } 4278 4255 4279 - static struct snd_soc_dapm_widget * 4280 - snd_soc_dapm_new_dai(struct snd_soc_card *card, 4281 - struct snd_pcm_substream *substream, 4282 - char *id) 4256 + static struct snd_soc_dapm_widget *dapm_new_dai(struct snd_soc_card *card, 4257 + struct snd_pcm_substream *substream, 4258 + char *id) 4283 4259 { 4284 4260 struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 4285 4261 struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); ··· 4309 4285 goto param_fail; 4310 4286 4311 4287 num_kcontrols = 1; 4312 - kcontrol_news = snd_soc_dapm_alloc_kcontrol(card, link_name, 4313 - rtd->dai_link->c2c_params, 4314 - rtd->dai_link->num_c2c_params, 4315 - w_param_text, &private_value); 4288 + kcontrol_news = dapm_alloc_kcontrol(card, link_name, 4289 + rtd->dai_link->c2c_params, 4290 + rtd->dai_link->num_c2c_params, 4291 + w_param_text, &private_value); 4316 4292 if (!kcontrol_news) 4317 4293 goto param_fail; 4318 4294 } ··· 4321 4297 template.reg = SND_SOC_NOPM; 4322 4298 template.id = snd_soc_dapm_dai_link; 4323 4299 template.name = link_name; 4324 - template.event = snd_soc_dai_link_event; 4300 + template.event = dapm_dai_link_event; 4325 4301 template.event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU | 4326 4302 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD; 4327 4303 template.kcontrol_news = kcontrol_news; ··· 4341 4317 4342 4318 outfree_kcontrol_news: 4343 4319 devm_kfree(card->dev, (void *)template.kcontrol_news); 4344 - snd_soc_dapm_free_kcontrol(card, &private_value, 4320 + dapm_free_kcontrol(card, &private_value, 4345 4321 rtd->dai_link->num_c2c_params, w_param_text); 4346 4322 param_fail: 4347 4323 devm_kfree(card->dev, link_name); ··· 4455 4431 sink = dai_w; 4456 4432 } 4457 4433 dev_dbg(dai->dev, "%s -> %s\n", src->name, sink->name); 4458 - snd_soc_dapm_add_path(w->dapm, src, sink, NULL, NULL); 4434 + dapm_add_path(w->dapm, src, sink, NULL, NULL); 4459 4435 } 4460 4436 } 4461 4437 ··· 4476 4452 sink_dai->component->name, sink->name); 4477 4453 4478 4454 if (dai) { 4479 - snd_soc_dapm_add_path(dapm, src, dai, NULL, NULL); 4455 + dapm_add_path(dapm, src, dai, NULL, NULL); 4480 4456 src = dai; 4481 4457 } 4482 4458 4483 - snd_soc_dapm_add_path(dapm, src, sink, NULL, NULL); 4459 + dapm_add_path(dapm, src, sink, NULL, NULL); 4484 4460 } 4485 4461 4486 4462 static void dapm_connect_dai_pair(struct snd_soc_card *card, ··· 4514 4490 /* special handling for [Codec2Codec] */ 4515 4491 if (dai_link->c2c_params && !rtd->c2c_widget[stream]) { 4516 4492 struct snd_pcm_substream *substream = rtd->pcm->streams[stream].substream; 4517 - struct snd_soc_dapm_widget *dai = snd_soc_dapm_new_dai(card, substream, 4518 - widget_name[stream]); 4493 + struct snd_soc_dapm_widget *dai = dapm_new_dai(card, substream, 4494 + widget_name[stream]); 4519 4495 4520 4496 if (IS_ERR(dai)) 4521 4497 continue; ··· 4529 4505 } 4530 4506 } 4531 4507 4532 - static void soc_dapm_dai_stream_event(struct snd_soc_dai *dai, int stream, 4533 - int event) 4508 + static void dapm_dai_stream_event(struct snd_soc_dai *dai, int stream, int event) 4534 4509 { 4535 4510 struct snd_soc_dapm_widget *w; 4536 4511 ··· 4597 4574 } 4598 4575 } 4599 4576 4600 - static void soc_dapm_stream_event(struct snd_soc_pcm_runtime *rtd, int stream, 4601 - int event) 4577 + static void dapm_stream_event(struct snd_soc_pcm_runtime *rtd, int stream, int event) 4602 4578 { 4603 4579 struct snd_soc_dai *dai; 4604 4580 int i; 4605 4581 4606 4582 for_each_rtd_dais(rtd, i, dai) 4607 - soc_dapm_dai_stream_event(dai, stream, event); 4583 + dapm_dai_stream_event(dai, stream, event); 4608 4584 4609 4585 dapm_power_widgets(rtd->card, event, NULL); 4610 4586 } ··· 4625 4603 struct snd_soc_card *card = rtd->card; 4626 4604 4627 4605 snd_soc_dapm_mutex_lock(card); 4628 - soc_dapm_stream_event(rtd, stream, event); 4606 + dapm_stream_event(rtd, stream, event); 4629 4607 snd_soc_dapm_mutex_unlock(card); 4630 4608 } 4631 4609 ··· 4668 4646 int snd_soc_dapm_enable_pin_unlocked(struct snd_soc_dapm_context *dapm, 4669 4647 const char *pin) 4670 4648 { 4671 - return snd_soc_dapm_set_pin(dapm, pin, 1); 4649 + return dapm_set_pin(dapm, pin, 1); 4672 4650 } 4673 4651 EXPORT_SYMBOL_GPL(snd_soc_dapm_enable_pin_unlocked); 4674 4652 ··· 4689 4667 4690 4668 snd_soc_dapm_mutex_lock(dapm); 4691 4669 4692 - ret = snd_soc_dapm_set_pin(dapm, pin, 1); 4670 + ret = dapm_set_pin(dapm, pin, 1); 4693 4671 4694 4672 snd_soc_dapm_mutex_unlock(dapm); 4695 4673 ··· 4785 4763 int snd_soc_dapm_disable_pin_unlocked(struct snd_soc_dapm_context *dapm, 4786 4764 const char *pin) 4787 4765 { 4788 - return snd_soc_dapm_set_pin(dapm, pin, 0); 4766 + return dapm_set_pin(dapm, pin, 0); 4789 4767 } 4790 4768 EXPORT_SYMBOL_GPL(snd_soc_dapm_disable_pin_unlocked); 4791 4769 ··· 4806 4784 4807 4785 snd_soc_dapm_mutex_lock(dapm); 4808 4786 4809 - ret = snd_soc_dapm_set_pin(dapm, pin, 0); 4787 + ret = dapm_set_pin(dapm, pin, 0); 4810 4788 4811 4789 snd_soc_dapm_mutex_unlock(dapm); 4812 4790 ··· 4884 4862 dapm->component = component; 4885 4863 dapm->bias_level = SND_SOC_BIAS_OFF; 4886 4864 4887 - if (component) { 4888 - dapm->dev = component->dev; 4865 + if (component) 4889 4866 dapm->idle_bias = component->driver->idle_bias_on; 4890 - } else { 4891 - dapm->dev = card->dev; 4892 - } 4893 4867 4894 4868 INIT_LIST_HEAD(&dapm->list); 4895 4869 /* see for_each_card_dapms */ 4896 4870 list_add(&dapm->list, &card->dapm_list); 4897 4871 } 4898 4872 4899 - static void soc_dapm_shutdown_dapm(struct snd_soc_dapm_context *dapm) 4873 + static void dapm_shutdown(struct snd_soc_dapm_context *dapm) 4900 4874 { 4901 4875 struct snd_soc_card *card = dapm->card; 4902 4876 struct snd_soc_dapm_widget *w; ··· 4937 4919 4938 4920 for_each_card_dapms(card, dapm) { 4939 4921 if (dapm != card_dapm) { 4940 - soc_dapm_shutdown_dapm(dapm); 4922 + dapm_shutdown(dapm); 4941 4923 if (dapm->bias_level == SND_SOC_BIAS_STANDBY) 4942 4924 snd_soc_dapm_set_bias_level(dapm, SND_SOC_BIAS_OFF); 4943 4925 } 4944 4926 } 4945 4927 4946 - soc_dapm_shutdown_dapm(card_dapm); 4928 + dapm_shutdown(card_dapm); 4947 4929 if (card_dapm->bias_level == SND_SOC_BIAS_STANDBY) 4948 4930 snd_soc_dapm_set_bias_level(card_dapm, SND_SOC_BIAS_OFF); 4949 4931 }