Merge remote-tracking branches 'asoc/fix/da7219-pops' and 'asoc/fix/qcom' into asoc...
authorMark Brown <broonie@kernel.org>
Mon, 12 Dec 2016 15:52:37 +0000 (15:52 +0000)
committerMark Brown <broonie@kernel.org>
Mon, 12 Dec 2016 15:52:37 +0000 (15:52 +0000)
1  2  3 
sound/soc/codecs/da7219.c
sound/soc/qcom/lpass-platform.c

Simple merge
index b392e51de94d173a20b130ad663b6af7c1e25f19,e2ff538a8aa5b63c4117f35365c39057b1f5360a,e223bc90b2ef7fed9df0c07c823c104e32e97dba..420d200f9a0533bd335224784c2e7933a0c8c3b1
@@@@ -61,41 -61,7 -61,43 +61,44 @@@@ 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;
   
        snd_soc_set_runtime_hwparams(substream, &lpass_platform_pcm_hardware);