lpass-platform.c (eb4606e64a7d548f5d60a9583baa8104890b2c6e) lpass-platform.c (287980e49ffc0f6d911601e7e352a812ed27768e)
1/*
2 * Copyright (c) 2010-2011,2013-2015 The Linux Foundation. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 and
6 * only version 2 as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,

--- 460 unchanged lines hidden (view full) ---

469static int lpass_platform_pcm_new(struct snd_soc_pcm_runtime *soc_runtime)
470{
471 struct snd_pcm *pcm = soc_runtime->pcm;
472 struct snd_pcm_substream *psubstream, *csubstream;
473 struct snd_soc_dai *cpu_dai = soc_runtime->cpu_dai;
474 struct lpass_data *drvdata =
475 snd_soc_platform_get_drvdata(soc_runtime->platform);
476 struct lpass_variant *v = drvdata->variant;
1/*
2 * Copyright (c) 2010-2011,2013-2015 The Linux Foundation. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 and
6 * only version 2 as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,

--- 460 unchanged lines hidden (view full) ---

469static int lpass_platform_pcm_new(struct snd_soc_pcm_runtime *soc_runtime)
470{
471 struct snd_pcm *pcm = soc_runtime->pcm;
472 struct snd_pcm_substream *psubstream, *csubstream;
473 struct snd_soc_dai *cpu_dai = soc_runtime->cpu_dai;
474 struct lpass_data *drvdata =
475 snd_soc_platform_get_drvdata(soc_runtime->platform);
476 struct lpass_variant *v = drvdata->variant;
477 int ret = -EINVAL;
477 int ret;
478 struct lpass_pcm_data *data;
479 size_t size = lpass_platform_pcm_hardware.buffer_bytes_max;
480
481 data = devm_kzalloc(soc_runtime->dev, sizeof(*data), GFP_KERNEL);
482 if (!data)
483 return -ENOMEM;
484
485 data->i2s_port = cpu_dai->driver->id;

--- 27 unchanged lines hidden (view full) ---

513 }
514
515 csubstream = pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream;
516 if (csubstream) {
517 if (v->alloc_dma_channel)
518 data->wrdma_ch = v->alloc_dma_channel(drvdata,
519 SNDRV_PCM_STREAM_CAPTURE);
520
478 struct lpass_pcm_data *data;
479 size_t size = lpass_platform_pcm_hardware.buffer_bytes_max;
480
481 data = devm_kzalloc(soc_runtime->dev, sizeof(*data), GFP_KERNEL);
482 if (!data)
483 return -ENOMEM;
484
485 data->i2s_port = cpu_dai->driver->id;

--- 27 unchanged lines hidden (view full) ---

513 }
514
515 csubstream = pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream;
516 if (csubstream) {
517 if (v->alloc_dma_channel)
518 data->wrdma_ch = v->alloc_dma_channel(drvdata,
519 SNDRV_PCM_STREAM_CAPTURE);
520
521 if (data->wrdma_ch < 0) {
522 ret = data->wrdma_ch;
521 if (data->wrdma_ch < 0)
523 goto capture_alloc_err;
522 goto capture_alloc_err;
524 }
525
526 drvdata->substream[data->wrdma_ch] = csubstream;
527
528 ret = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV,
529 soc_runtime->platform->dev,
530 size, &csubstream->dma_buffer);
531 if (ret)
532 goto capture_alloc_err;

--- 103 unchanged lines hidden ---
523
524 drvdata->substream[data->wrdma_ch] = csubstream;
525
526 ret = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV,
527 soc_runtime->platform->dev,
528 size, &csubstream->dma_buffer);
529 if (ret)
530 goto capture_alloc_err;

--- 103 unchanged lines hidden ---