mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-03-22 07:27:12 +08:00
ASoC: remove dpcm_process_paths()
dpcm_process_paths() will call dpcm_add_paths() (A) or
dpcm_prune_paths() (B)
dpcm_process_paths(..., new)
{
if (new)
(A) return dpcm_add_paths(...);
else
(B) return dpcm_prune_paths(...);
}
but the user who need to call dpcm_prune_paths() (B) is only
soc_dpcm_fe_runtime_update(), all other user want to call is
dpcm_add_paths() (A). We don't need to have confusing
dpcm_process_paths(). Let's remove it.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87jz9vyjyu.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
committed by
Mark Brown
parent
257a060fe2
commit
40b1f89a16
@@ -132,8 +132,8 @@ static inline void soc_dpcm_debugfs_add(struct snd_soc_pcm_runtime *rtd)
|
|||||||
int dpcm_path_get(struct snd_soc_pcm_runtime *fe,
|
int dpcm_path_get(struct snd_soc_pcm_runtime *fe,
|
||||||
int stream, struct snd_soc_dapm_widget_list **list_);
|
int stream, struct snd_soc_dapm_widget_list **list_);
|
||||||
void dpcm_path_put(struct snd_soc_dapm_widget_list **list);
|
void dpcm_path_put(struct snd_soc_dapm_widget_list **list);
|
||||||
int dpcm_process_paths(struct snd_soc_pcm_runtime *fe,
|
int dpcm_add_paths(struct snd_soc_pcm_runtime *fe, int stream,
|
||||||
int stream, struct snd_soc_dapm_widget_list **list, int new);
|
struct snd_soc_dapm_widget_list **list_);
|
||||||
int dpcm_be_dai_startup(struct snd_soc_pcm_runtime *fe, int stream);
|
int dpcm_be_dai_startup(struct snd_soc_pcm_runtime *fe, int stream);
|
||||||
void dpcm_be_dai_stop(struct snd_soc_pcm_runtime *fe, int stream,
|
void dpcm_be_dai_stop(struct snd_soc_pcm_runtime *fe, int stream,
|
||||||
int do_hw_free, struct snd_soc_dpcm *last);
|
int do_hw_free, struct snd_soc_dpcm *last);
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ static int soc_compr_open_fe(struct snd_compr_stream *cstream)
|
|||||||
snd_soc_dpcm_mutex_lock(fe);
|
snd_soc_dpcm_mutex_lock(fe);
|
||||||
|
|
||||||
/* calculate valid and active FE <-> BE dpcms */
|
/* calculate valid and active FE <-> BE dpcms */
|
||||||
dpcm_process_paths(fe, stream, &list, 1);
|
dpcm_add_paths(fe, stream, &list);
|
||||||
|
|
||||||
fe->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_FE;
|
fe->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_FE;
|
||||||
|
|
||||||
|
|||||||
@@ -1550,8 +1550,8 @@ static int dpcm_prune_paths(struct snd_soc_pcm_runtime *fe, int stream,
|
|||||||
return prune;
|
return prune;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int dpcm_add_paths(struct snd_soc_pcm_runtime *fe, int stream,
|
int dpcm_add_paths(struct snd_soc_pcm_runtime *fe, int stream,
|
||||||
struct snd_soc_dapm_widget_list **list_)
|
struct snd_soc_dapm_widget_list **list_)
|
||||||
{
|
{
|
||||||
struct snd_soc_card *card = fe->card;
|
struct snd_soc_card *card = fe->card;
|
||||||
struct snd_soc_dapm_widget_list *list = *list_;
|
struct snd_soc_dapm_widget_list *list = *list_;
|
||||||
@@ -1616,19 +1616,6 @@ static int dpcm_add_paths(struct snd_soc_pcm_runtime *fe, int stream,
|
|||||||
return new;
|
return new;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Find the corresponding BE DAIs that source or sink audio to this
|
|
||||||
* FE substream.
|
|
||||||
*/
|
|
||||||
int dpcm_process_paths(struct snd_soc_pcm_runtime *fe,
|
|
||||||
int stream, struct snd_soc_dapm_widget_list **list, int new)
|
|
||||||
{
|
|
||||||
if (new)
|
|
||||||
return dpcm_add_paths(fe, stream, list);
|
|
||||||
else
|
|
||||||
return dpcm_prune_paths(fe, stream, list);
|
|
||||||
}
|
|
||||||
|
|
||||||
void dpcm_clear_pending_state(struct snd_soc_pcm_runtime *fe, int stream)
|
void dpcm_clear_pending_state(struct snd_soc_pcm_runtime *fe, int stream)
|
||||||
{
|
{
|
||||||
struct snd_soc_dpcm *dpcm;
|
struct snd_soc_dpcm *dpcm;
|
||||||
@@ -2706,7 +2693,14 @@ static int soc_dpcm_fe_runtime_update(struct snd_soc_pcm_runtime *fe, int new)
|
|||||||
return paths;
|
return paths;
|
||||||
|
|
||||||
/* update any playback/capture paths */
|
/* update any playback/capture paths */
|
||||||
count = dpcm_process_paths(fe, stream, &list, new);
|
/*
|
||||||
|
* Find the corresponding BE DAIs that source or sink audio to this
|
||||||
|
* FE substream.
|
||||||
|
*/
|
||||||
|
if (new)
|
||||||
|
count = dpcm_add_paths(fe, stream, &list);
|
||||||
|
else
|
||||||
|
count = dpcm_prune_paths(fe, stream, &list);
|
||||||
if (count) {
|
if (count) {
|
||||||
dpcm_set_fe_update_state(fe, stream, SND_SOC_DPCM_UPDATE_BE);
|
dpcm_set_fe_update_state(fe, stream, SND_SOC_DPCM_UPDATE_BE);
|
||||||
if (new)
|
if (new)
|
||||||
@@ -2798,7 +2792,7 @@ static int dpcm_fe_dai_open(struct snd_pcm_substream *fe_substream)
|
|||||||
goto open_end;
|
goto open_end;
|
||||||
|
|
||||||
/* calculate valid and active FE <-> BE dpcms */
|
/* calculate valid and active FE <-> BE dpcms */
|
||||||
dpcm_process_paths(fe, stream, &list, 1);
|
dpcm_add_paths(fe, stream, &list);
|
||||||
|
|
||||||
ret = dpcm_fe_dai_startup(fe_substream);
|
ret = dpcm_fe_dai_startup(fe_substream);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user