From patchwork Tue Nov 19 11:07:47 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 21621 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f199.google.com (mail-pd0-f199.google.com [209.85.192.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8C5CF23FB4 for ; Tue, 19 Nov 2013 11:08:21 +0000 (UTC) Received: by mail-pd0-f199.google.com with SMTP id r10sf9437282pdi.6 for ; Tue, 19 Nov 2013 03:08:20 -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=dWMXLniua9zqKThM4B3p0D+2gWXmkdALO72zHGzC2Cw=; b=PbHLQN6vq1htgrxfAzaPrqCnV5k7XsJx7U1hBNjeZEzqw3uU77UZ2oz5RSncCId/1Z 0+TJNy/IFDBrESh2hsnqVslzvGEjBmDEmn1VPZQqukPaP+bZwyzihIlkS1nedrfFUQ6V pdBn05QW8mkS+Wb/r1EZEJ8RPUVot3oJPAuiQxZBtlkaeESPpYeoXU2LwQTK+bjDTpKu 7I/lcaB5Dd9i6tMMn+sm3zMyxM5P/GN+E+Sigh9EU7h6NRpod/F5Wg7zh6MA3qO5vrvD QCv6KBHG+PBH0nMtPSU1M4gAhLWMjKpqntcGNq6L4nVOuosU4H1nbYzUpftek2kyy7Ih Kkbg== X-Gm-Message-State: ALoCoQlVPXive6kBl6ALVKVArDEWh/P1UuGKiIYeNlijpnMQtE6Roxs3hKIPcS2xoZBuz1bOTnz3 X-Received: by 10.66.172.79 with SMTP id ba15mr10008854pac.26.1384859300806; Tue, 19 Nov 2013 03:08:20 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.127.46 with SMTP id nd14ls381325qeb.19.gmail; Tue, 19 Nov 2013 03:08:20 -0800 (PST) X-Received: by 10.52.165.131 with SMTP id yy3mr1132848vdb.25.1384859300673; Tue, 19 Nov 2013 03:08:20 -0800 (PST) Received: from mail-vc0-f173.google.com (mail-vc0-f173.google.com [209.85.220.173]) by mx.google.com with ESMTPS id at4si7983143ved.151.2013.11.19.03.08.20 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 19 Nov 2013 03:08:20 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.173 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.173; Received: by mail-vc0-f173.google.com with SMTP id lh4so4551554vcb.18 for ; Tue, 19 Nov 2013 03:08:20 -0800 (PST) X-Received: by 10.52.23.68 with SMTP id k4mr418614vdf.28.1384859300587; Tue, 19 Nov 2013 03:08:20 -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.220.174.196 with SMTP id u4csp269510vcz; Tue, 19 Nov 2013 03:08:20 -0800 (PST) X-Received: by 10.182.246.74 with SMTP id xu10mr24648623obc.23.1384859300047; Tue, 19 Nov 2013 03:08:20 -0800 (PST) Received: from mail-oa0-f49.google.com (mail-oa0-f49.google.com [209.85.219.49]) by mx.google.com with ESMTPS id co8si15124700oec.112.2013.11.19.03.08.19 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 19 Nov 2013 03:08:20 -0800 (PST) Received-SPF: neutral (google.com: 209.85.219.49 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=209.85.219.49; Received: by mail-oa0-f49.google.com with SMTP id i4so2927148oah.8 for ; Tue, 19 Nov 2013 03:08:19 -0800 (PST) X-Received: by 10.182.40.201 with SMTP id z9mr6117897obk.45.1384859299808; Tue, 19 Nov 2013 03:08:19 -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 d8sm34904086oeu.6.2013.11.19.03.08.18 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 19 Nov 2013 03:08:19 -0800 (PST) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: linus.walleij@linaro.org, Lee Jones , alsa-devel@alsa-project.org, Mark Brown Subject: [PATCH 08/10] ASoC: ux500_pcm: Differentiate between pdata and DT initialisation Date: Tue, 19 Nov 2013 11:07:47 +0000 Message-Id: <1384859269-19801-9-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1384859269-19801-1-git-send-email-lee.jones@linaro.org> References: <1384859269-19801-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.220.173 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: , If booting with full DT support (i.e. DMA too, the last piece of the puzzle), then we don't need to use the compatible request channel call back and, due to the work we laid down earlier in this patch-set, we can use core function calls to populate the DMA slave_config. We also require slightly different flags to inform the core that we 'are' booting with DT. Cc: alsa-devel@alsa-project.org Cc: Mark Brown Acked-by: Linus Walleij Signed-off-by: Lee Jones --- sound/soc/ux500/ux500_pcm.c | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/sound/soc/ux500/ux500_pcm.c b/sound/soc/ux500/ux500_pcm.c index ce554de..acfec98 100644 --- a/sound/soc/ux500/ux500_pcm.c +++ b/sound/soc/ux500/ux500_pcm.c @@ -139,15 +139,33 @@ static const struct snd_dmaengine_pcm_config ux500_dmaengine_pcm_config = { .prepare_slave_config = ux500_pcm_prepare_slave_config, }; +static const struct snd_dmaengine_pcm_config ux500_dmaengine_of_pcm_config = { + .pcm_hardware = &ux500_pcm_hw, + .prealloc_buffer_size = 128 * 1024, + .prepare_slave_config = snd_dmaengine_pcm_prepare_slave_config, +}; + int ux500_pcm_register_platform(struct platform_device *pdev) { + const struct snd_dmaengine_pcm_config *pcm_config; + struct device_node *np = pdev->dev.of_node; + unsigned int pcm_flags; int ret; - ret = snd_dmaengine_pcm_register(&pdev->dev, - &ux500_dmaengine_pcm_config, - SND_DMAENGINE_PCM_FLAG_NO_RESIDUE | - SND_DMAENGINE_PCM_FLAG_COMPAT | - SND_DMAENGINE_PCM_FLAG_NO_DT); + if (np) { + pcm_config = &ux500_dmaengine_of_pcm_config; + + pcm_flags = SND_DMAENGINE_PCM_FLAG_NO_RESIDUE | + SND_DMAENGINE_PCM_FLAG_COMPAT; + } else { + pcm_config = &ux500_dmaengine_pcm_config; + + pcm_flags = SND_DMAENGINE_PCM_FLAG_NO_RESIDUE | + SND_DMAENGINE_PCM_FLAG_NO_DT | + SND_DMAENGINE_PCM_FLAG_COMPAT; + } + + ret = snd_dmaengine_pcm_register(&pdev->dev, pcm_config, pcm_flags); if (ret < 0) { dev_err(&pdev->dev, "%s: ERROR: Failed to register platform '%s' (%d)!\n",