From: Mark Brown Date: Mon, 12 Dec 2016 15:53:07 +0000 (+0000) Subject: Merge remote-tracking branches 'asoc/topic/of-graph', 'asoc/topic/pxa', 'asoc/topic... X-Git-Tag: v4.10-rc1~121^2~3^2~7 X-Git-Url: http://git.samba.org/samba.git/?p=sfrench%2Fcifs-2.6.git;a=commitdiff_plain;h=2f028b15a232737ba8dd5b883adcca3471a8280e Merge remote-tracking branches 'asoc/topic/of-graph', 'asoc/topic/pxa', 'asoc/topic/qcom' and 'asoc/topic/rk808' into asoc-next --- 2f028b15a232737ba8dd5b883adcca3471a8280e diff --cc sound/soc/qcom/lpass-platform.c index 420d200f9a05,e2ff538a8aa5,e2ff538a8aa5,ca5e19f55a28,e2ff538a8aa5..dd5bdd0da730 --- a/sound/soc/qcom/lpass-platform.c +++ b/sound/soc/qcom/lpass-platform.c @@@@@@ -61,44 -61,7 -61,7 -60,37 -61,7 +60,41 @@@@@@ static int lpass_platform_pcmops_open(s { struct snd_pcm_runtime *runtime = substream->runtime; struct snd_soc_pcm_runtime *soc_runtime = substream->private_data; -- - int ret; ++ + struct snd_soc_dai *cpu_dai = soc_runtime->cpu_dai; ++ + struct lpass_data *drvdata = ++ + snd_soc_platform_get_drvdata(soc_runtime->platform); ++ + struct lpass_variant *v = drvdata->variant; ++ + int ret, dma_ch, dir = substream->stream; ++ + struct lpass_pcm_data *data; ++ + ++ + data = devm_kzalloc(soc_runtime->dev, sizeof(*data), GFP_KERNEL); ++ + if (!data) ++ + return -ENOMEM; ++ + ++ + data->i2s_port = cpu_dai->driver->id; ++ + runtime->private_data = data; ++ + ++++ dma_ch = 0; ++ + if (v->alloc_dma_channel) ++ + dma_ch = v->alloc_dma_channel(drvdata, dir); ++++ else ++++ dma_ch = 0; ++++ ++ + if (dma_ch < 0) ++ + return dma_ch; ++ + ++ + drvdata->substream[dma_ch] = substream; ++ + ++ + ret = regmap_write(drvdata->lpaif_map, ++ + LPAIF_DMACTL_REG(v, dma_ch, dir), 0); ++ + if (ret) { ++ + dev_err(soc_runtime->dev, ++ + "%s() error writing to rdmactl reg: %d\n", ++ + __func__, ret); ++ + return ret; ++ + } ++ + - if (dir == SNDRV_PCM_STREAM_PLAYBACK) - data->rdma_ch = dma_ch; - else - data->wrdma_ch = dma_ch; +++ + data->dma_ch = dma_ch; snd_soc_set_runtime_hwparams(substream, &lpass_platform_pcm_hardware); @@@@@@ -117,32 -80,6 -80,6 -109,24 -80,6 +113,24 @@@@@@ return 0; } ++ +static int lpass_platform_pcmops_close(struct snd_pcm_substream *substream) ++ +{ ++ + struct snd_pcm_runtime *runtime = substream->runtime; ++ + struct snd_soc_pcm_runtime *soc_runtime = substream->private_data; ++ + struct lpass_data *drvdata = ++ + snd_soc_platform_get_drvdata(soc_runtime->platform); ++ + struct lpass_variant *v = drvdata->variant; ++ + struct lpass_pcm_data *data; - int dma_ch, dir = substream->stream; ++ + ++ + data = runtime->private_data; ++ + v = drvdata->variant; - - if (dir == SNDRV_PCM_STREAM_PLAYBACK) - dma_ch = data->rdma_ch; - else - dma_ch = data->wrdma_ch; - - drvdata->substream[dma_ch] = NULL; - +++ + drvdata->substream[data->dma_ch] = NULL; ++ + if (v->free_dma_channel) - v->free_dma_channel(drvdata, dma_ch); +++ + v->free_dma_channel(drvdata, data->dma_ch); ++ + ++ + return 0; ++ +} ++ + static int lpass_platform_pcmops_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params) {