Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sdw/multi cpu dai support #1802

Merged
merged 20 commits into from
Feb 21, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
9a09de4
ASoC: fix for_rtd_codec_dai_rollback() macro
plbossart Feb 18, 2020
af255e9
ASoC: Add initial support for multiple CPU DAIs
shreyasnc1 Jan 20, 2020
1e044e5
ASoC: Add multiple CPU DAI support for PCM ops
shreyasnc1 Jan 20, 2020
ab98fab
ASoC: Add dapm_add_valid_dai_widget helper
shreyasnc1 Jan 20, 2020
5005d58
ASoC: Add multiple CPU DAI support in DAPM
shreyasnc1 Jan 20, 2020
d514a91
ASoC: Return error if the function does not support multi-cpu
bardliao Jan 20, 2020
4097910
ASoC: pcm: check if cpu-dai supports a given stream
bardliao Jan 20, 2020
0d5413a
ASoC: SOF: topology: connect dai widget to all cpu-dais
bardliao Feb 18, 2020
c2e38f1
soundwire: cadence: remove useless prototypes
plbossart Feb 20, 2020
b3359e6
soundwire: stream: only change state if needed
plbossart Feb 19, 2020
b27f0d8
ASoC: soc-dai: add get_sdw_stream() callback
plbossart Feb 20, 2020
eeef703
soundwire: intel: implement get_sdw_stream() operations
plbossart Feb 20, 2020
216ebe4
soundwire: stream: add helper to startup/shutdown streams
plbossart Feb 20, 2020
f8914ba
soundwire: intel: remove stream allocation/free
plbossart Feb 20, 2020
b5c329a
soundwire: cadence: allocate/free dma_data in set_sdw_stream
plbossart Feb 20, 2020
47b4921
soundwire: intel: don't free dma_data in DAI shutdown
plbossart Feb 20, 2020
4476a47
ASoC: Intel: sdw_rt700: handle SoundWire stream creation in dailink
plbossart Feb 20, 2020
fced860
ASoC: Intel: sdw_rt711_rt1308_rt715: handle SoundWire stream creation…
plbossart Feb 20, 2020
352771c
Revert "ASoC: pcm: check if cpu-dai supports a given stream"
plbossart Feb 20, 2020
3578aae
[SQUASHME] ASoC: soc-generic-dmaengine-pcm: fix integer/pointer
plbossart Feb 21, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions sound/soc/soc-compress.c
Original file line number Diff line number Diff line change
Expand Up @@ -810,9 +810,10 @@ int snd_soc_new_compress(struct snd_soc_pcm_runtime *rtd, int num)
int playback = 0, capture = 0;
int i;

if (rtd->num_codecs > 1) {
if (rtd->num_cpus > 1 ||
rtd->num_codecs > 1) {
dev_err(rtd->card->dev,
"Compress ASoC: Multicodec not supported\n");
"Compress ASoC: Multi CPU/Codec not supported\n");
return -EINVAL;
}

Expand Down
18 changes: 18 additions & 0 deletions sound/soc/soc-generic-dmaengine-pcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ int snd_dmaengine_pcm_prepare_slave_config(struct snd_pcm_substream *substream,
struct snd_dmaengine_dai_dma_data *dma_data;
int ret;

if (rtd->num_cpus > 1) {
dev_err(rtd->dev,
"%s doesn't support Multi CPU yet\n", __func__);
return -EINVAL;
}

dma_data = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream);

ret = snd_hwparams_to_dma_slave_config(substream, params, slave_config);
Expand Down Expand Up @@ -118,6 +124,12 @@ dmaengine_pcm_set_runtime_hwparams(struct snd_soc_component *component,
struct snd_dmaengine_dai_dma_data *dma_data;
struct snd_pcm_hardware hw;

if (rtd->num_cpus > 1) {
dev_err(rtd->dev,
"%s doesn't support Multi CPU yet\n", __func__);
return -EINVAL;
}

if (pcm->config && pcm->config->pcm_hardware)
return snd_soc_set_runtime_hwparams(substream,
pcm->config->pcm_hardware);
Expand Down Expand Up @@ -185,6 +197,12 @@ static struct dma_chan *dmaengine_pcm_compat_request_channel(
struct snd_dmaengine_dai_dma_data *dma_data;
dma_filter_fn fn = NULL;

if (rtd->num_cpus > 1) {
dev_err(rtd->dev,
"%s doesn't support Multi CPU yet\n", __func__);
return -EINVAL;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this function returns a pointer. Should it have been ERR_PTR(-EINVAL) or NULL?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, fixed in update (reported independently by kbuild)

}

dma_data = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream);

if ((pcm->flags & SND_DMAENGINE_PCM_FLAG_HALF_DUPLEX) && pcm->chan[0])
Expand Down
18 changes: 18 additions & 0 deletions sound/soc/soc-pcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1415,6 +1415,12 @@ int dpcm_path_get(struct snd_soc_pcm_runtime *fe,
struct snd_soc_dai *cpu_dai = fe->cpu_dai;
int paths;

if (fe->num_cpus > 1) {
dev_err(fe->dev,
"%s doesn't support Multi CPU yet\n", __func__);
return -EINVAL;
}

/* get number of valid DAI paths and their widgets */
paths = snd_soc_dapm_dai_get_connected_widgets(cpu_dai, stream, list,
dpcm_end_walk_at_be);
Expand Down Expand Up @@ -2742,6 +2748,12 @@ static int soc_dpcm_fe_runtime_update(struct snd_soc_pcm_runtime *fe, int new)
int stream;
int count, paths;

if (fe->num_cpus > 1) {
dev_err(fe->dev,
"%s doesn't support Multi CPU yet\n", __func__);
return -EINVAL;
}

if (!fe->dai_link->dynamic)
return 0;

Expand Down Expand Up @@ -3228,6 +3240,12 @@ static ssize_t dpcm_state_read_file(struct file *file, char __user *user_buf,
int stream;
char *buf;

if (fe->num_cpus > 1) {
dev_err(fe->dev,
"%s doesn't support Multi CPU yet\n", __func__);
return -EINVAL;
}

buf = kmalloc(out_count, GFP_KERNEL);
if (!buf)
return -ENOMEM;
Expand Down