From patchwork Fri Oct 12 05:47:29 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 1585431 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id CE78C3FC1A for ; Fri, 12 Oct 2012 05:49:12 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TMY5w-00037S-Cd; Fri, 12 Oct 2012 05:47:36 +0000 Received: from mail-ob0-f177.google.com ([209.85.214.177]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TMY5r-00035k-Vz for linux-arm-kernel@lists.infradead.org; Fri, 12 Oct 2012 05:47:33 +0000 Received: by mail-ob0-f177.google.com with SMTP id wd20so2647890obb.36 for ; Thu, 11 Oct 2012 22:47:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=NEdrae1rYZ0pBhdBCCDrHQkW0fw8Js/Kk9TCprpdpUY=; b=wfNr8H84p7gYjE5ntyXBXKFbzV4LkcDiAwnTbeX9yoagY8OldTThuTR1PLFx+VgOSV SntGclrIrkxdDlyIGbHgf1q0p5aOrCA8eiQyDV69FFd0Qcs/sJ4bPIFKbmA8zvMyT3C3 U8PzMD7d6cUhIWDtK7Gsy+u6b+rf9B7GlwuaFTf1L4JiQDeD81huQ6YYcylC49aTx2J7 53FTObzGowuceGcTZnTs99kudIoNTicrk5DNP5SXGNnIP6bvi9GBrwYEnPi/AyLtQUSz iBGBZ3yuskGCwY2J0QaTRhk0JFbGhOAqBfE2rAZkRSqVbc2eLcNs6IUQ7hxwhSajHkVP PGLw== MIME-Version: 1.0 Received: by 10.182.222.72 with SMTP id qk8mr1319726obc.99.1350020849710; Thu, 11 Oct 2012 22:47:29 -0700 (PDT) Received: by 10.182.35.169 with HTTP; Thu, 11 Oct 2012 22:47:29 -0700 (PDT) In-Reply-To: <91e41b4cc972d298f714cbd6f400569a9710304c.1350020375.git.viresh.kumar@linaro.org> References: <142ef9170a2c69657d8a05ac127a9970d7b04965.1350020375.git.viresh.kumar@linaro.org> <91e41b4cc972d298f714cbd6f400569a9710304c.1350020375.git.viresh.kumar@linaro.org> Date: Fri, 12 Oct 2012 11:17:29 +0530 X-Google-Sender-Auth: 4omjt2BAqZLQIZc7WNXPmQw2uus Message-ID: Subject: Re: [PATCH 2/3] dmaengine: dw_dmac: Enhance device tree support From: viresh kumar To: vinod.koul@intel.com X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (viresh.linux[at]gmail.com) -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.214.177 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: Viresh Kumar , devicetree-discuss@lists.ozlabs.org, spear-devel@list.st.com, linux-kernel@vger.kernel.org, andriy.shevchenko@linux.intel.com, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org On Fri, Oct 12, 2012 at 11:14 AM, Viresh Kumar wrote: > dw_dmac driver already supports device tree but it used to have its platform > data passed the non-DT way. > > This patch does following changes: > - pass platform data via DT, non-DT way still takes precedence if both are used. > - create generic filter routine > - Earlier slave information was made available by slave specific filter routines > in chan->private field. Now, this information would be passed from within dmac > DT node. Slave drivers would now be required to pass bus_id (a string) as > parameter to this generic filter(), which would be compared against the slave > data passed from DT, by the generic filter routine. > - Update binding document DT parsing of this patch can be tested with following non-official patch :) dmaengine: dw_dmac: Add dt params debug routine Signed-off-by: Viresh Kumar --- drivers/dma/dw_dmac.c | 42 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) struct dw_dma_platform_data *pdata; @@ -1515,9 +1552,12 @@ static int __devinit dw_probe(struct platform_device *pdev) int i; pdata = dev_get_platdata(&pdev->dev); - if (!pdata) + if (!pdata) { pdata = dw_dma_parse_dt(pdev); + dw_dma_parse_dt_debug(pdata); + } diff --git a/drivers/dma/dw_dmac.c b/drivers/dma/dw_dmac.c index 05c1dff..569914d 100644 --- a/drivers/dma/dw_dmac.c +++ b/drivers/dma/dw_dmac.c @@ -1504,6 +1504,43 @@ static inline int dw_dma_parse_dt(struct platform_device *pdev) } #endif +static void dw_dma_parse_dt_debug(struct dw_dma_platform_data *pdata) +{ + int i = -1; + + if (!pdata) { + printk(KERN_ERR "dw_dma: unable to read info from DT\n"); + return; + } + + printk(KERN_ERR "\nPrinting dw_dma DT info\n"); + + printk(KERN_ERR "nr_channels: %x\n", pdata->nr_channels); + printk(KERN_ERR "is_private: %x\n", pdata->is_private); + printk(KERN_ERR "chan_allocation_order: %x\n", + pdata->chan_allocation_order); + + printk(KERN_ERR "chan_priority: %x\n", pdata->chan_priority); + printk(KERN_ERR "block_size: %x\n", pdata->block_size); + + printk(KERN_ERR "nr_masters: %x\n", pdata->nr_masters); + printk(KERN_ERR "data_width: %d %d %d %d\n", pdata->data_width[0], + pdata->data_width[1], pdata->data_width[2], + pdata->data_width[3]); + + /* parse slave data */ + printk(KERN_ERR "slave_info\n"); + + while (++i < pdata->sd_count) { + printk(KERN_INFO "bus_id: %s\n", pdata->sd[i].bus_id); + printk(KERN_INFO "cfg_hi: %x\n", pdata->sd[i].cfg_hi); + printk(KERN_INFO "cfg_lo: %x\n", pdata->sd[i].cfg_lo); + printk(KERN_INFO "src_master: %x\n", + pdata->sd[i].src_master); + printk(KERN_INFO "dst_master: %x\n", + pdata->sd[i].dst_master); + } +} static int __devinit dw_probe(struct platform_device *pdev) {