diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2023-01-31 03:02:04 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2023-01-31 12:05:12 +0100 |
commit | 3653480c68120dc16ebfeb80e529200dbbd98f92 (patch) | |
tree | 80c5ca2186ff1314945220d55bdb0370de669200 /sound/soc/soc-dai.c | |
parent | ASoC: soc-topology.c: use helper function (diff) | |
download | linux-3653480c68120dc16ebfeb80e529200dbbd98f92.tar.xz linux-3653480c68120dc16ebfeb80e529200dbbd98f92.zip |
ASoC: soc-dai.h: cleanup Playback/Capture data for snd_soc_dai
Current snd_soc_dai has data for Playback/Capture, but it is very
random. Someone is array (A), someone is playback/capture (B),
and someone is tx/rx (C);
struct snd_soc_dai {
...
(A) unsigned int stream_active[SNDRV_PCM_STREAM_LAST + 1];
(B) struct snd_soc_dapm_widget *playback_widget;
(B) struct snd_soc_dapm_widget *capture_widget;
(B) void *playback_dma_data;
(B) void *capture_dma_data;
...
(C) unsigned int tx_mask;
(C) unsigned int rx_mask;
};
Because of it, the code was very complicated.
This patch creates new data structure to merge these into one,
and tidyup the code.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/87cz6vea1v.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/soc-dai.c')
-rw-r--r-- | sound/soc/soc-dai.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/soc/soc-dai.c b/sound/soc/soc-dai.c index 69f534f0d4bf..0119afbd01fc 100644 --- a/sound/soc/soc-dai.c +++ b/sound/soc/soc-dai.c @@ -514,7 +514,7 @@ void snd_soc_dai_action(struct snd_soc_dai *dai, int stream, int action) { /* see snd_soc_dai_stream_active() */ - dai->stream_active[stream] += action; + dai->stream[stream].active += action; /* see snd_soc_component_active() */ dai->component->active += action; @@ -527,7 +527,7 @@ int snd_soc_dai_active(struct snd_soc_dai *dai) active = 0; for_each_pcm_streams(stream) - active += dai->stream_active[stream]; + active += dai->stream[stream].active; return active; } |