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: random cleanup

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

These are random cleanup patch-set for ASoC

+91 -140
+4 -4
include/sound/soc-dpcm.h
··· 132 132 int dpcm_path_get(struct snd_soc_pcm_runtime *fe, 133 133 int stream, struct snd_soc_dapm_widget_list **list_); 134 134 void dpcm_path_put(struct snd_soc_dapm_widget_list **list); 135 - int dpcm_process_paths(struct snd_soc_pcm_runtime *fe, 136 - int stream, struct snd_soc_dapm_widget_list **list, int new); 135 + int dpcm_add_paths(struct snd_soc_pcm_runtime *fe, int stream, 136 + struct snd_soc_dapm_widget_list **list_); 137 137 int dpcm_be_dai_startup(struct snd_soc_pcm_runtime *fe, int stream); 138 138 void dpcm_be_dai_stop(struct snd_soc_pcm_runtime *fe, int stream, 139 139 int do_hw_free, struct snd_soc_dpcm *last); ··· 143 143 int dpcm_be_dai_hw_params(struct snd_soc_pcm_runtime *fe, int tream); 144 144 int dpcm_be_dai_trigger(struct snd_soc_pcm_runtime *fe, int stream, int cmd); 145 145 int dpcm_be_dai_prepare(struct snd_soc_pcm_runtime *fe, int stream); 146 - int dpcm_dapm_stream_event(struct snd_soc_pcm_runtime *fe, int dir, 147 - int event); 146 + void dpcm_dapm_stream_event(struct snd_soc_pcm_runtime *fe, int dir, int event); 147 + 148 148 bool dpcm_end_walk_at_be(struct snd_soc_dapm_widget *widget, enum snd_soc_dapm_direction dir); 149 149 int widget_in_list(struct snd_soc_dapm_widget_list *list, 150 150 struct snd_soc_dapm_widget *widget);
-11
include/sound/soc.h
··· 522 522 int snd_soc_runtime_set_dai_fmt(struct snd_soc_pcm_runtime *rtd, 523 523 unsigned int dai_fmt); 524 524 525 - #ifdef CONFIG_DMI 526 - int snd_soc_set_dmi_name(struct snd_soc_card *card, const char *flavour); 527 - #else 528 - static inline int snd_soc_set_dmi_name(struct snd_soc_card *card, 529 - const char *flavour) 530 - { 531 - return 0; 532 - } 533 - #endif 534 - 535 525 /* Utility functions to get clock rates from various things */ 536 526 int snd_soc_calc_frame_size(int sample_size, int channels, int tdm_slots); 537 527 int snd_soc_params_to_frame_size(const struct snd_pcm_hw_params *params); ··· 1106 1116 /* Generic DAPM context for the card */ 1107 1117 struct snd_soc_dapm_context dapm; 1108 1118 struct snd_soc_dapm_stats dapm_stats; 1109 - struct snd_soc_dapm_update *update; 1110 1119 1111 1120 #ifdef CONFIG_DEBUG_FS 1112 1121 struct dentry *debugfs_card_root;
+1 -1
sound/soc/soc-compress.c
··· 148 148 snd_soc_dpcm_mutex_lock(fe); 149 149 150 150 /* calculate valid and active FE <-> BE dpcms */ 151 - dpcm_process_paths(fe, stream, &list, 1); 151 + dpcm_add_paths(fe, stream, &list); 152 152 153 153 fe->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_FE; 154 154
+7 -8
sound/soc/soc-core.c
··· 1887 1887 /** 1888 1888 * snd_soc_set_dmi_name() - Register DMI names to card 1889 1889 * @card: The card to register DMI names 1890 - * @flavour: The flavour "differentiator" for the card amongst its peers. 1891 1890 * 1892 1891 * An Intel machine driver may be used by many different devices but are 1893 1892 * difficult for userspace to differentiate, since machine drivers usually ··· 1914 1915 * 1915 1916 * Returns 0 on success, otherwise a negative error code. 1916 1917 */ 1917 - int snd_soc_set_dmi_name(struct snd_soc_card *card, const char *flavour) 1918 + static int snd_soc_set_dmi_name(struct snd_soc_card *card) 1918 1919 { 1919 1920 const char *vendor, *product, *board; 1920 1921 ··· 1958 1959 return 0; 1959 1960 } 1960 1961 1961 - /* Add flavour to dmi long name */ 1962 - if (flavour) 1963 - append_dmi_string(card, flavour); 1964 - 1965 1962 /* set the card long name */ 1966 1963 card->long_name = card->dmi_longname; 1967 1964 1968 1965 return 0; 1969 1966 } 1970 - EXPORT_SYMBOL_GPL(snd_soc_set_dmi_name); 1967 + #else 1968 + static inline int snd_soc_set_dmi_name(struct snd_soc_card *card) 1969 + { 1970 + return 0; 1971 + } 1971 1972 #endif /* CONFIG_DMI */ 1972 1973 1973 1974 static void soc_check_tplg_fes(struct snd_soc_card *card) ··· 2255 2256 goto probe_end; 2256 2257 2257 2258 /* try to set some sane longname if DMI is available */ 2258 - snd_soc_set_dmi_name(card, NULL); 2259 + snd_soc_set_dmi_name(card); 2259 2260 2260 2261 soc_setup_card_name(card, card->snd_card->shortname, 2261 2262 card->name, NULL);
+5 -3
sound/soc/soc-dai.c
··· 261 261 262 262 if (dai->driver->ops && 263 263 dai->driver->ops->xlate_tdm_slot_mask) 264 - dai->driver->ops->xlate_tdm_slot_mask(slots, 265 - &tx_mask, &rx_mask); 264 + ret = dai->driver->ops->xlate_tdm_slot_mask(slots, &tx_mask, &rx_mask); 266 265 else 267 - snd_soc_xlate_tdm_slot_mask(slots, &tx_mask, &rx_mask); 266 + ret = snd_soc_xlate_tdm_slot_mask(slots, &tx_mask, &rx_mask); 267 + if (ret) 268 + goto err; 268 269 269 270 for_each_pcm_streams(stream) 270 271 snd_soc_dai_tdm_mask_set(dai, stream, *tdm_mask[stream]); ··· 274 273 dai->driver->ops->set_tdm_slot) 275 274 ret = dai->driver->ops->set_tdm_slot(dai, tx_mask, rx_mask, 276 275 slots, slot_width); 276 + err: 277 277 return soc_dai_ret(dai, ret); 278 278 } 279 279 EXPORT_SYMBOL_GPL(snd_soc_dai_set_tdm_slot);
+21 -27
sound/soc/soc-dapm.c
··· 1743 1743 soc_dapm_async_complete(d); 1744 1744 } 1745 1745 1746 - static void dapm_widget_update(struct snd_soc_card *card) 1746 + static void dapm_widget_update(struct snd_soc_card *card, struct snd_soc_dapm_update *update) 1747 1747 { 1748 - struct snd_soc_dapm_update *update = card->update; 1749 1748 struct snd_soc_dapm_widget_list *wlist; 1750 1749 struct snd_soc_dapm_widget *w = NULL; 1751 1750 unsigned int wi; ··· 1950 1951 * o Input pin to Output pin (bypass, sidetone) 1951 1952 * o DAC to ADC (loopback). 1952 1953 */ 1953 - static int dapm_power_widgets(struct snd_soc_card *card, int event) 1954 + static int dapm_power_widgets(struct snd_soc_card *card, int event, 1955 + struct snd_soc_dapm_update *update) 1954 1956 { 1955 1957 struct snd_soc_dapm_widget *w; 1956 1958 struct snd_soc_dapm_context *d; ··· 2059 2059 /* Power down widgets first; try to avoid amplifying pops. */ 2060 2060 dapm_seq_run(card, &down_list, event, false); 2061 2061 2062 - dapm_widget_update(card); 2062 + dapm_widget_update(card, update); 2063 2063 2064 2064 /* Now power up. */ 2065 2065 dapm_seq_run(card, &up_list, event, true); ··· 2332 2332 2333 2333 /* test and update the power status of a mux widget */ 2334 2334 static int soc_dapm_mux_update_power(struct snd_soc_card *card, 2335 - struct snd_kcontrol *kcontrol, int mux, struct soc_enum *e) 2335 + struct snd_kcontrol *kcontrol, 2336 + struct snd_soc_dapm_update *update, 2337 + int mux, struct soc_enum *e) 2336 2338 { 2337 2339 struct snd_soc_dapm_path *path; 2338 2340 int found = 0; ··· 2355 2353 } 2356 2354 2357 2355 if (found) 2358 - dapm_power_widgets(card, SND_SOC_DAPM_STREAM_NOP); 2356 + dapm_power_widgets(card, SND_SOC_DAPM_STREAM_NOP, update); 2359 2357 2360 2358 return found; 2361 2359 } ··· 2368 2366 int ret; 2369 2367 2370 2368 snd_soc_dapm_mutex_lock(card); 2371 - card->update = update; 2372 - ret = soc_dapm_mux_update_power(card, kcontrol, mux, e); 2373 - card->update = NULL; 2369 + ret = soc_dapm_mux_update_power(card, kcontrol, update, mux, e); 2374 2370 snd_soc_dapm_mutex_unlock(card); 2375 2371 if (ret > 0) 2376 2372 snd_soc_dpcm_runtime_update(card); ··· 2379 2379 /* test and update the power status of a mixer or switch widget */ 2380 2380 static int soc_dapm_mixer_update_power(struct snd_soc_card *card, 2381 2381 struct snd_kcontrol *kcontrol, 2382 + struct snd_soc_dapm_update *update, 2382 2383 int connect, int rconnect) 2383 2384 { 2384 2385 struct snd_soc_dapm_path *path; ··· 2419 2418 } 2420 2419 2421 2420 if (found) 2422 - dapm_power_widgets(card, SND_SOC_DAPM_STREAM_NOP); 2421 + dapm_power_widgets(card, SND_SOC_DAPM_STREAM_NOP, update); 2423 2422 2424 2423 return found; 2425 2424 } ··· 2432 2431 int ret; 2433 2432 2434 2433 snd_soc_dapm_mutex_lock(card); 2435 - card->update = update; 2436 - ret = soc_dapm_mixer_update_power(card, kcontrol, connect, -1); 2437 - card->update = NULL; 2434 + ret = soc_dapm_mixer_update_power(card, kcontrol, update, connect, -1); 2438 2435 snd_soc_dapm_mutex_unlock(card); 2439 2436 if (ret > 0) 2440 2437 snd_soc_dpcm_runtime_update(card); ··· 2688 2689 if (!snd_soc_card_is_instantiated(dapm->card)) 2689 2690 return 0; 2690 2691 2691 - return dapm_power_widgets(dapm->card, SND_SOC_DAPM_STREAM_NOP); 2692 + return dapm_power_widgets(dapm->card, SND_SOC_DAPM_STREAM_NOP, NULL); 2692 2693 } 2693 2694 EXPORT_SYMBOL_GPL(snd_soc_dapm_sync_unlocked); 2694 2695 ··· 3357 3358 dapm_debugfs_add_widget(w); 3358 3359 } 3359 3360 3360 - dapm_power_widgets(card, SND_SOC_DAPM_STREAM_NOP); 3361 + dapm_power_widgets(card, SND_SOC_DAPM_STREAM_NOP, NULL); 3361 3362 snd_soc_dapm_mutex_unlock(card); 3362 3363 return 0; 3363 3364 } ··· 3446 3447 unsigned int val, rval = 0; 3447 3448 int connect, rconnect = -1, change, reg_change = 0; 3448 3449 struct snd_soc_dapm_update update = {}; 3450 + struct snd_soc_dapm_update *pupdate = NULL; 3449 3451 int ret = 0; 3450 3452 3451 3453 val = (ucontrol->value.integer.value[0] & mask); ··· 3495 3495 update.reg = reg; 3496 3496 update.mask = mask << shift; 3497 3497 update.val = val; 3498 - card->update = &update; 3498 + pupdate = &update; 3499 3499 } 3500 - 3501 - ret = soc_dapm_mixer_update_power(card, kcontrol, connect, 3502 - rconnect); 3503 - 3504 - card->update = NULL; 3500 + ret = soc_dapm_mixer_update_power(card, kcontrol, pupdate, connect, rconnect); 3505 3501 } 3506 3502 3507 3503 snd_soc_dapm_mutex_unlock(card); ··· 3564 3568 unsigned int val, change, reg_change = 0; 3565 3569 unsigned int mask; 3566 3570 struct snd_soc_dapm_update update = {}; 3571 + struct snd_soc_dapm_update *pupdate = NULL; 3567 3572 int ret = 0; 3568 3573 3569 3574 if (item[0] >= e->items) ··· 3592 3595 update.reg = e->reg; 3593 3596 update.mask = mask; 3594 3597 update.val = val; 3595 - card->update = &update; 3598 + pupdate = &update; 3596 3599 } 3597 - 3598 - ret = soc_dapm_mux_update_power(card, kcontrol, item[0], e); 3599 - 3600 - card->update = NULL; 3600 + ret = soc_dapm_mux_update_power(card, kcontrol, pupdate, item[0], e); 3601 3601 } 3602 3602 3603 3603 snd_soc_dapm_mutex_unlock(card); ··· 4520 4526 for_each_rtd_dais(rtd, i, dai) 4521 4527 soc_dapm_dai_stream_event(dai, stream, event); 4522 4528 4523 - dapm_power_widgets(rtd->card, event); 4529 + dapm_power_widgets(rtd->card, event, NULL); 4524 4530 } 4525 4531 4526 4532 /**
+6 -17
sound/soc/soc-ops.c
··· 122 122 * This functions reads a codec register. The register value is shifted right 123 123 * by 'shift' bits and masked with the given 'mask'. Afterwards it translates 124 124 * the given registervalue into a signed integer if sign_bit is non-zero. 125 - * 126 - * Returns 0 on sucess, otherwise an error value 127 125 */ 128 - static int snd_soc_read_signed(struct snd_soc_component *component, 126 + static void snd_soc_read_signed(struct snd_soc_component *component, 129 127 unsigned int reg, unsigned int mask, unsigned int shift, 130 128 unsigned int sign_bit, int *signed_val) 131 129 { ··· 135 137 136 138 if (!sign_bit) { 137 139 *signed_val = val; 138 - return 0; 140 + return; 139 141 } 140 142 141 143 /* non-negative number */ 142 144 if (!(val & BIT(sign_bit))) { 143 145 *signed_val = val; 144 - return 0; 146 + return; 145 147 } 146 148 147 149 ret = val; ··· 155 157 ret |= ~((int)(BIT(sign_bit) - 1)); 156 158 157 159 *signed_val = ret; 158 - 159 - return 0; 160 160 } 161 161 162 162 /** ··· 262 266 unsigned int mask = (1ULL << fls(max)) - 1; 263 267 unsigned int invert = mc->invert; 264 268 int val; 265 - int ret; 266 269 267 270 if (sign_bit) 268 271 mask = BIT(sign_bit + 1) - 1; 269 272 270 - ret = snd_soc_read_signed(component, reg, mask, shift, sign_bit, &val); 271 - if (ret) 272 - return ret; 273 + snd_soc_read_signed(component, reg, mask, shift, sign_bit, &val); 273 274 274 275 ucontrol->value.integer.value[0] = val - min; 275 276 if (invert) ··· 275 282 276 283 if (snd_soc_volsw_is_stereo(mc)) { 277 284 if (reg == reg2) 278 - ret = snd_soc_read_signed(component, reg, mask, rshift, 279 - sign_bit, &val); 285 + snd_soc_read_signed(component, reg, mask, rshift, sign_bit, &val); 280 286 else 281 - ret = snd_soc_read_signed(component, reg2, mask, shift, 282 - sign_bit, &val); 283 - if (ret) 284 - return ret; 287 + snd_soc_read_signed(component, reg2, mask, shift, sign_bit, &val); 285 288 286 289 ucontrol->value.integer.value[1] = val - min; 287 290 if (invert)
+47 -69
sound/soc/soc-pcm.c
··· 400 400 } 401 401 402 402 /* DPCM stream event, send event to FE and all active BEs. */ 403 - int dpcm_dapm_stream_event(struct snd_soc_pcm_runtime *fe, int dir, 404 - int event) 403 + void dpcm_dapm_stream_event(struct snd_soc_pcm_runtime *fe, int dir, int event) 405 404 { 406 405 struct snd_soc_dpcm *dpcm; 407 406 ··· 421 422 } 422 423 423 424 snd_soc_dapm_stream_event(fe, dir, event); 424 - 425 - return 0; 426 425 } 427 426 428 427 static void soc_pcm_set_dai_params(struct snd_soc_dai *dai, ··· 1062 1065 * function can also be called multiple times and can allocate buffers 1063 1066 * (using snd_pcm_lib_* ). It's non-atomic. 1064 1067 */ 1065 - static int __soc_pcm_hw_params(struct snd_soc_pcm_runtime *rtd, 1066 - struct snd_pcm_substream *substream, 1068 + static int __soc_pcm_hw_params(struct snd_pcm_substream *substream, 1067 1069 struct snd_pcm_hw_params *params) 1068 1070 { 1071 + struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); 1069 1072 struct snd_soc_dai *cpu_dai; 1070 1073 struct snd_soc_dai *codec_dai; 1071 1074 struct snd_pcm_hw_params tmp_params; ··· 1171 1174 int ret; 1172 1175 1173 1176 snd_soc_dpcm_mutex_lock(rtd); 1174 - ret = __soc_pcm_hw_params(rtd, substream, params); 1177 + ret = __soc_pcm_hw_params(substream, params); 1175 1178 snd_soc_dpcm_mutex_unlock(rtd); 1176 1179 return ret; 1177 1180 } ··· 1301 1304 snd_soc_dpcm_mutex_assert_held(fe); 1302 1305 1303 1306 /* only add new dpcms */ 1304 - for_each_dpcm_be(fe, stream, dpcm) { 1305 - if (dpcm->be == be && dpcm->fe == fe) 1307 + for_each_dpcm_be(fe, stream, dpcm) 1308 + if (dpcm->be == be) 1306 1309 return 0; 1307 - } 1308 1310 1309 1311 fe_substream = snd_soc_dpcm_get_substream(fe, stream); 1310 1312 be_substream = snd_soc_dpcm_get_substream(be, stream); ··· 1550 1554 return prune; 1551 1555 } 1552 1556 1553 - static int dpcm_add_paths(struct snd_soc_pcm_runtime *fe, int stream, 1554 - struct snd_soc_dapm_widget_list **list_) 1557 + int dpcm_add_paths(struct snd_soc_pcm_runtime *fe, int stream, 1558 + struct snd_soc_dapm_widget_list **list_) 1555 1559 { 1556 1560 struct snd_soc_card *card = fe->card; 1557 1561 struct snd_soc_dapm_widget_list *list = *list_; ··· 1614 1618 1615 1619 dev_dbg(fe->dev, "ASoC: found %d new BE paths\n", new); 1616 1620 return new; 1617 - } 1618 - 1619 - /* 1620 - * Find the corresponding BE DAIs that source or sink audio to this 1621 - * FE substream. 1622 - */ 1623 - int dpcm_process_paths(struct snd_soc_pcm_runtime *fe, 1624 - int stream, struct snd_soc_dapm_widget_list **list, int new) 1625 - { 1626 - if (new) 1627 - return dpcm_add_paths(fe, stream, list); 1628 - else 1629 - return dpcm_prune_paths(fe, stream, list); 1630 1621 } 1631 1622 1632 1623 void dpcm_clear_pending_state(struct snd_soc_pcm_runtime *fe, int stream) ··· 2110 2127 dev_dbg(be->dev, "ASoC: hw_params BE %s\n", 2111 2128 be->dai_link->name); 2112 2129 2113 - ret = __soc_pcm_hw_params(be, be_substream, &hw_params); 2130 + ret = __soc_pcm_hw_params(be_substream, &hw_params); 2114 2131 if (ret < 0) 2115 2132 goto unwind; 2116 2133 ··· 2166 2183 params_channels(params), params_format(params)); 2167 2184 2168 2185 /* call hw_params on the frontend */ 2169 - ret = __soc_pcm_hw_params(fe, substream, params); 2186 + ret = __soc_pcm_hw_params(substream, params); 2170 2187 if (ret < 0) 2171 2188 dpcm_be_dai_hw_free(fe, stream); 2172 2189 else ··· 2365 2382 goto end; 2366 2383 2367 2384 ret = dpcm_be_dai_trigger(fe, substream->stream, cmd); 2368 - goto end; 2369 2385 } 2370 - 2371 2386 /* call trigger on the frontend after the backend. */ 2372 - ret = dpcm_be_dai_trigger(fe, substream->stream, cmd); 2373 - if (ret < 0) 2374 - goto end; 2387 + else { 2388 + ret = dpcm_be_dai_trigger(fe, substream->stream, cmd); 2389 + if (ret < 0) 2390 + goto end; 2375 2391 2376 - dev_dbg(fe->dev, "ASoC: post trigger FE %s cmd %d\n", 2377 - fe->dai_link->name, cmd); 2392 + dev_dbg(fe->dev, "ASoC: post trigger FE %s cmd %d\n", 2393 + fe->dai_link->name, cmd); 2378 2394 2379 - ret = soc_pcm_trigger(substream, cmd); 2395 + ret = soc_pcm_trigger(substream, cmd); 2396 + } 2380 2397 end: 2381 2398 return snd_soc_ret(fe->dev, ret, "trigger FE cmd: %d failed\n", cmd); 2382 2399 } ··· 2386 2403 struct snd_soc_pcm_runtime *fe = snd_soc_substream_to_rtd(substream); 2387 2404 int stream = substream->stream; 2388 2405 int ret = 0; 2406 + int fe_first; 2389 2407 enum snd_soc_dpcm_trigger trigger = fe->dai_link->trigger[stream]; 2390 2408 2391 2409 fe->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_FE; 2392 2410 2393 2411 switch (trigger) { 2394 2412 case SND_SOC_DPCM_TRIGGER_PRE: 2395 - switch (cmd) { 2396 - case SNDRV_PCM_TRIGGER_START: 2397 - case SNDRV_PCM_TRIGGER_RESUME: 2398 - case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: 2399 - case SNDRV_PCM_TRIGGER_DRAIN: 2400 - ret = dpcm_dai_trigger_fe_be(substream, cmd, true); 2401 - break; 2402 - case SNDRV_PCM_TRIGGER_STOP: 2403 - case SNDRV_PCM_TRIGGER_SUSPEND: 2404 - case SNDRV_PCM_TRIGGER_PAUSE_PUSH: 2405 - ret = dpcm_dai_trigger_fe_be(substream, cmd, false); 2406 - break; 2407 - default: 2408 - ret = -EINVAL; 2409 - break; 2410 - } 2413 + fe_first = true; 2411 2414 break; 2412 2415 case SND_SOC_DPCM_TRIGGER_POST: 2413 - switch (cmd) { 2414 - case SNDRV_PCM_TRIGGER_START: 2415 - case SNDRV_PCM_TRIGGER_RESUME: 2416 - case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: 2417 - case SNDRV_PCM_TRIGGER_DRAIN: 2418 - ret = dpcm_dai_trigger_fe_be(substream, cmd, false); 2419 - break; 2420 - case SNDRV_PCM_TRIGGER_STOP: 2421 - case SNDRV_PCM_TRIGGER_SUSPEND: 2422 - case SNDRV_PCM_TRIGGER_PAUSE_PUSH: 2423 - ret = dpcm_dai_trigger_fe_be(substream, cmd, true); 2424 - break; 2425 - default: 2426 - ret = -EINVAL; 2427 - break; 2428 - } 2416 + fe_first = false; 2429 2417 break; 2430 2418 default: 2431 2419 dev_err(fe->dev, "ASoC: invalid trigger cmd %d for %s\n", cmd, 2432 2420 fe->dai_link->name); 2433 2421 ret = -EINVAL; 2434 2422 goto out; 2423 + } 2424 + 2425 + switch (cmd) { 2426 + case SNDRV_PCM_TRIGGER_START: 2427 + case SNDRV_PCM_TRIGGER_RESUME: 2428 + case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: 2429 + case SNDRV_PCM_TRIGGER_DRAIN: 2430 + ret = dpcm_dai_trigger_fe_be(substream, cmd, fe_first); 2431 + break; 2432 + case SNDRV_PCM_TRIGGER_STOP: 2433 + case SNDRV_PCM_TRIGGER_SUSPEND: 2434 + case SNDRV_PCM_TRIGGER_PAUSE_PUSH: 2435 + ret = dpcm_dai_trigger_fe_be(substream, cmd, !fe_first); 2436 + break; 2437 + default: 2438 + ret = -EINVAL; 2439 + break; 2435 2440 } 2436 2441 2437 2442 if (ret < 0) ··· 2681 2710 return paths; 2682 2711 2683 2712 /* update any playback/capture paths */ 2684 - count = dpcm_process_paths(fe, stream, &list, new); 2713 + /* 2714 + * Find the corresponding BE DAIs that source or sink audio to this 2715 + * FE substream. 2716 + */ 2717 + if (new) 2718 + count = dpcm_add_paths(fe, stream, &list); 2719 + else 2720 + count = dpcm_prune_paths(fe, stream, &list); 2685 2721 if (count) { 2686 2722 dpcm_set_fe_update_state(fe, stream, SND_SOC_DPCM_UPDATE_BE); 2687 2723 if (new) ··· 2780 2802 goto open_end; 2781 2803 2782 2804 /* calculate valid and active FE <-> BE dpcms */ 2783 - dpcm_process_paths(fe, stream, &list, 1); 2805 + dpcm_add_paths(fe, stream, &list); 2784 2806 2785 2807 ret = dpcm_fe_dai_startup(fe_substream); 2786 2808 if (ret < 0)