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: 21375 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 A2E0B20DB9 for ; Wed, 6 Nov 2013 10:17:12 +0000 (UTC) Received: by mail-pb0-f71.google.com with SMTP id wy17sf1793031pbc.2 for ; Wed, 06 Nov 2013 02:17:11 -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=y7F0+lpnN8MTXontV7s7Emjd7RHz5sOhfBRt/chGt/8=; b=hTCgdBR32wHMsSENYYn0u8slvZ10ZuZu2gfYXO07ca1x/+ZRDZ5gYIMkEnqqKvy5K7 KOAzuNQgzyl6M5zuiBjVHHb0/YEibROpXgnH2XQsggJqEgCfL2d6JgZgUp1mxL7d3ei0 CkM2/BfVqcJeeibD1QnCyMvK+XgslolfSokkQQu5RTwXme9S43WpamZBGY+DTNbUFH0e D30cRNvW8SC7s5kB84Pg5gbm3DXMUIdTOZiLATCwL0qfyAy7h8u31kL0ZGuJYN3HFjCF EgvO1huy/dlC2jTHKWIWSPZHvoUbzwS4jegR2iFSJcO7V6AipAreM6k4bH18k714tUTi /5pg== X-Gm-Message-State: ALoCoQlsD2CZKKyjLFCD9NdQHdhqWKawYnrVS1qr3zw4SB5wnAq4ypSiMAVdrk1i6daUsjlPXOCI X-Received: by 10.69.20.107 with SMTP id hb11mr817773pbd.2.1383733031658; Wed, 06 Nov 2013 02:17:11 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.94.114 with SMTP id db18ls554680qeb.66.gmail; Wed, 06 Nov 2013 02:17:11 -0800 (PST) X-Received: by 10.52.157.232 with SMTP id wp8mr1471445vdb.4.1383733031519; Wed, 06 Nov 2013 02:17:11 -0800 (PST) Received: from mail-vc0-f179.google.com (mail-vc0-f179.google.com [209.85.220.179]) by mx.google.com with ESMTPS id m10si8161342vcm.132.2013.11.06.02.17.11 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 06 Nov 2013 02:17:11 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.179 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.179; Received: by mail-vc0-f179.google.com with SMTP id hz11so6571702vcb.10 for ; Wed, 06 Nov 2013 02:17:11 -0800 (PST) X-Received: by 10.58.168.205 with SMTP id zy13mr1720140veb.19.1383733031448; Wed, 06 Nov 2013 02:17:11 -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 u4csp273223vcz; Wed, 6 Nov 2013 02:17:10 -0800 (PST) X-Received: by 10.42.67.74 with SMTP id s10mr1511502ici.1.1383733030621; Wed, 06 Nov 2013 02:17:10 -0800 (PST) Received: from mail-ie0-f175.google.com (mail-ie0-f175.google.com [209.85.223.175]) by mx.google.com with ESMTPS id lz8si5318743icc.86.2013.11.06.02.17.10 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 06 Nov 2013 02:17:10 -0800 (PST) Received-SPF: neutral (google.com: 209.85.223.175 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=209.85.223.175; Received: by mail-ie0-f175.google.com with SMTP id aq17so17402623iec.34 for ; Wed, 06 Nov 2013 02:17:10 -0800 (PST) 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 Cc: linus.walleij@linaro.org, Lee Jones , alsa-devel@alsa-project.org, Mark Brown 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-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.179 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 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",