From patchwork Thu Dec 19 15:55:03 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 22644 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pb0-f71.google.com (mail-pb0-f71.google.com [209.85.160.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4287E23FCA for ; Thu, 19 Dec 2013 15:55:40 +0000 (UTC) Received: by mail-pb0-f71.google.com with SMTP id uo5sf3265076pbc.6 for ; Thu, 19 Dec 2013 07:55:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=dxCD9XZJ13T1SsootO4iXvQt68ZmH9wAZ90aaIkmHzU=; b=YPYpXbendk23n/vajkhfwtSWB5sleJ5GtjfmsSzx/4ER17frf01wbUpnhPsApG5xYc wXObX5EpBzj3Vsqyc1bRNH7kre0xGAS9wV74KGNwr8jpfB7WHCSs8I/rWau0QzDcDZAt 0OhzsmAnMgp58JGjpkvwgJN4kdbDp/sJM1p/MNilTmKA0quALFfbzqZXXre3lu/bQ4es rjyz71+4BSjqpaZd+BXlgZJ4eTmptWdAjDLSauqW5RQg8U0q72Pac0/S1FXyaNe2oHUQ YJlMuQfaphEre1iROOcPyUVEk4TcQ++Opiz0MWUNNNjLrWLeqPUvZUOaIJgw6nMV2qia 4A8g== X-Gm-Message-State: ALoCoQmUgkhlyRU0UPL4Q3PVrYt8RW2FlNvEIgZ43xDML1ebjAJKwjZg1b9Ib8sC9Mybq9k1uN+S X-Received: by 10.67.3.34 with SMTP id bt2mr947373pad.41.1387468539493; Thu, 19 Dec 2013 07:55:39 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.128.200 with SMTP id nq8ls392584qeb.95.gmail; Thu, 19 Dec 2013 07:55:39 -0800 (PST) X-Received: by 10.58.146.71 with SMTP id ta7mr13048veb.23.1387468539263; Thu, 19 Dec 2013 07:55:39 -0800 (PST) Received: from mail-ve0-f174.google.com (mail-ve0-f174.google.com [209.85.128.174]) by mx.google.com with ESMTPS id gw7si786954veb.0.2013.12.19.07.55.39 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 19 Dec 2013 07:55:39 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.174 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.174; Received: by mail-ve0-f174.google.com with SMTP id pa12so767507veb.19 for ; Thu, 19 Dec 2013 07:55:39 -0800 (PST) X-Received: by 10.58.146.71 with SMTP id ta7mr13032veb.23.1387468539115; Thu, 19 Dec 2013 07:55:39 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.59.13.131 with SMTP id ey3csp331347ved; Thu, 19 Dec 2013 07:55:38 -0800 (PST) X-Received: by 10.194.94.167 with SMTP id dd7mr2084066wjb.43.1387468537903; Thu, 19 Dec 2013 07:55:37 -0800 (PST) Received: from mail-we0-f178.google.com (mail-we0-f178.google.com [74.125.82.178]) by mx.google.com with ESMTPS id nb15si2428160wic.21.2013.12.19.07.55.37 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 19 Dec 2013 07:55:37 -0800 (PST) Received-SPF: neutral (google.com: 74.125.82.178 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=74.125.82.178; Received: by mail-we0-f178.google.com with SMTP id u57so1280415wes.9 for ; Thu, 19 Dec 2013 07:55:37 -0800 (PST) X-Received: by 10.180.19.165 with SMTP id g5mr2982669wie.31.1387468537419; Thu, 19 Dec 2013 07:55:37 -0800 (PST) Received: from localhost.localdomain (cpc15-aztw25-2-0-cust493.aztw.cable.virginm.net. [92.233.57.238]) by mx.google.com with ESMTPSA id ko3sm279236wjb.23.2013.12.19.07.55.35 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 19 Dec 2013 07:55:36 -0800 (PST) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: linus.walleij@linaro.org, broonie@kernel.org, alsa-devel@alsa-project.org, Lee Jones Subject: [PATCH 06/11] ASoC: ux500_pcm: Expect different saved DMA data when obtaining from DAI store Date: Thu, 19 Dec 2013 15:55:03 +0000 Message-Id: <1387468508-12286-7-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1387468508-12286-1-git-send-email-lee.jones@linaro.org> References: <1387468508-12286-1-git-send-email-lee.jones@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: lee.jones@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.174 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , In preparation for full Device Tree enablement we must differentiate between the two varying ways DMA data can be held in the DAI store. If we're booting with Device Tree the provided 'snd_dmaengine_dai_dma_data' data structure shall be used, whereas in order to avoid breaking legacy platform data we also need to be able to translate DMA data stored using the UX500 specific 'ux500_msp_dma_params' method. Once we move over to solely use Device Tree, we can enforce the use of 'snd_dmaengine_dai_dma_data' and this code can be removed altogether. Signed-off-by: Lee Jones --- sound/soc/ux500/ux500_pcm.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/sound/soc/ux500/ux500_pcm.c b/sound/soc/ux500/ux500_pcm.c index 32d4572..8b53f22 100644 --- a/sound/soc/ux500/ux500_pcm.c +++ b/sound/soc/ux500/ux500_pcm.c @@ -108,10 +108,21 @@ static int ux500_pcm_prepare_slave_config(struct snd_pcm_substream *substream, struct dma_slave_config *slave_config) { struct snd_soc_pcm_runtime *rtd = substream->private_data; - struct ux500_msp_dma_params *dma_params; + struct msp_i2s_platform_data *pdata = rtd->cpu_dai->dev->platform_data; + struct snd_dmaengine_dai_dma_data *snd_dma_params; + struct ux500_msp_dma_params *ste_dma_params; + dma_addr_t dma_addr; int ret; - dma_params = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream); + if (pdata) { + ste_dma_params = + snd_soc_dai_get_dma_data(rtd->cpu_dai, substream); + dma_addr = ste_dma_params->tx_rx_addr; + } else { + snd_dma_params = + snd_soc_dai_get_dma_data(rtd->cpu_dai, substream); + dma_addr = snd_dma_params->addr; + } ret = snd_hwparams_to_dma_slave_config(substream, params, slave_config); if (ret) @@ -124,9 +135,9 @@ static int ux500_pcm_prepare_slave_config(struct snd_pcm_substream *substream, slave_config->dst_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES; if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) - slave_config->dst_addr = dma_params->tx_rx_addr; + slave_config->dst_addr = dma_addr; else - slave_config->src_addr = dma_params->tx_rx_addr; + slave_config->src_addr = dma_addr; return 0; }