From patchwork Wed Nov 6 10:16:24 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 3146341 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C43A7BEEB2 for ; Wed, 6 Nov 2013 10:58:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BF99E2024F for ; Wed, 6 Nov 2013 10:58:34 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 471752015B for ; Wed, 6 Nov 2013 10:58:33 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Ve0DH-0003XS-EO; Wed, 06 Nov 2013 10:19:52 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Ve0CJ-0002T4-75; Wed, 06 Nov 2013 10:18:51 +0000 Received: from mail-ie0-f171.google.com ([209.85.223.171]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Ve0B1-0002Fc-6h for linux-arm-kernel@lists.infradead.org; Wed, 06 Nov 2013 10:17:34 +0000 Received: by mail-ie0-f171.google.com with SMTP id tp5so17578510ieb.30 for ; Wed, 06 Nov 2013 02:17:10 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=y7F0+lpnN8MTXontV7s7Emjd7RHz5sOhfBRt/chGt/8=; b=Lth2Pc44/Yy96eweTw90es/gXMQzINu0FqQbd+Le0Pzntp4vqSxmmJs/JBnYoJoVoa 81D163xiDxvdCXpQ70q7kempP/wNM8MenMkQ0+kas2dMMqVMkbll2b5smDPDey01a0fQ C8nfplL4I3ZzVb6mOPwPJwsvCcWHB7pE1+u1SWLITZ1UoZowlpc/MEIwBnWKZxi295XU sf8cK/D9P7KFFkBNTTDPOY26GOojrcQBhug2wUx3aKE4qZ5z91eEta+XAq7Ive4ADp7U m6RnmSluEfRN3OB/7ZZ0BJa23spW9E145VBYPMDgHjx/ZV8qeUYFFYsTip2e8eD4LwG4 IpfQ== X-Gm-Message-State: ALoCoQnotpg3sVCnpdEpTyZVJvEG7UklzS4X4Y4Q484Rlvq8NYyMjiFmRFTh5MKH2ZywYpMXNSMQ X-Received: by 10.50.23.16 with SMTP id i16mr1784501igf.50.1383733029912; Wed, 06 Nov 2013 02:17:09 -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 ka1sm13308397igb.7.2013.11.06.02.17.08 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 06 Nov 2013 02:17:09 -0800 (PST) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 12/13] ASoC: ux500_pcm: Differentiate between pdata and DT initialisation Date: Wed, 6 Nov 2013 10:16:24 +0000 Message-Id: <1383732985-18928-13-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1383732985-18928-1-git-send-email-lee.jones@linaro.org> References: <1383732985-18928-1-git-send-email-lee.jones@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131106_051731_363551_A459905C X-CRM114-Status: GOOD ( 14.34 ) X-Spam-Score: -2.6 (--) Cc: linus.walleij@linaro.org, Mark Brown , Lee Jones , alsa-devel@alsa-project.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Signed-off-by: Lee Jones Acked-by: Linus Walleij --- 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",