From: viresh kumar <viresh.kumar@linaro.org> To: vinod.koul@intel.com Cc: linux-kernel@vger.kernel.org, spear-devel@list.st.com, andriy.shevchenko@linux.intel.com, linux-arm-kernel@lists.infradead.org, devicetree-discuss@lists.ozlabs.org, Viresh Kumar <viresh.kumar@linaro.org> Subject: Re: [PATCH 2/3] dmaengine: dw_dmac: Enhance device tree support Date: Fri, 12 Oct 2012 11:17:29 +0530 [thread overview] Message-ID: <CAOh2x=karuuGbzwACPL8GNL4ivuLypqBj=sGCrJLupBBy52Uwg@mail.gmail.com> (raw) In-Reply-To: <91e41b4cc972d298f714cbd6f400569a9710304c.1350020375.git.viresh.kumar@linaro.org> On Fri, Oct 12, 2012 at 11:14 AM, Viresh Kumar <viresh.kumar@linaro.org> 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 <viresh.kumar@linaro.org> --- drivers/dma/dw_dmac.c | 42 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) 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) { 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); + }
WARNING: multiple messages have this Message-ID (diff)
From: viresh.kumar@linaro.org (viresh kumar) To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 2/3] dmaengine: dw_dmac: Enhance device tree support Date: Fri, 12 Oct 2012 11:17:29 +0530 [thread overview] Message-ID: <CAOh2x=karuuGbzwACPL8GNL4ivuLypqBj=sGCrJLupBBy52Uwg@mail.gmail.com> (raw) In-Reply-To: <91e41b4cc972d298f714cbd6f400569a9710304c.1350020375.git.viresh.kumar@linaro.org> On Fri, Oct 12, 2012 at 11:14 AM, Viresh Kumar <viresh.kumar@linaro.org> 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 <viresh.kumar@linaro.org> --- drivers/dma/dw_dmac.c | 42 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) 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) { 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); + }
next prev parent reply other threads:[~2012-10-12 5:47 UTC|newest] Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top 2012-10-12 5:43 [PATCH 1/3] dmaengine: dw_dmac: Update documentation style comments for dw_dma_platform_data Viresh Kumar 2012-10-12 5:43 ` Viresh Kumar 2012-10-12 5:43 ` Viresh Kumar 2012-10-12 5:44 ` [PATCH 2/3] dmaengine: dw_dmac: Enhance device tree support Viresh Kumar 2012-10-12 5:44 ` Viresh Kumar 2012-10-12 5:47 ` viresh kumar [this message] 2012-10-12 5:47 ` viresh kumar 2012-10-12 8:23 ` Andy Shevchenko 2012-10-12 8:23 ` Andy Shevchenko 2012-10-12 8:34 ` Viresh Kumar 2012-10-12 8:34 ` Viresh Kumar 2012-10-12 9:25 ` Andy Shevchenko 2012-10-12 9:25 ` Andy Shevchenko 2012-10-12 9:30 ` Viresh Kumar 2012-10-12 9:30 ` Viresh Kumar 2012-10-12 10:36 ` viresh kumar 2012-10-12 10:36 ` viresh kumar 2012-10-12 10:36 ` viresh kumar 2012-10-12 10:40 ` Andy Shevchenko 2012-10-12 10:40 ` Andy Shevchenko 2012-10-12 10:40 ` Andy Shevchenko 2012-10-12 10:48 ` Viresh Kumar 2012-10-12 10:48 ` Viresh Kumar 2012-10-12 11:01 ` Viresh Kumar 2012-10-12 11:01 ` Viresh Kumar 2012-10-12 11:25 ` Andy Shevchenko 2012-10-12 11:25 ` Andy Shevchenko 2012-10-12 13:44 ` Viresh Kumar 2012-10-12 13:44 ` Viresh Kumar [not found] ` <91e41b4cc972d298f714cbd6f400569a9710304c.1350020375.git.viresh.kumar-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> 2012-10-12 13:27 ` Andy Shevchenko 2012-10-12 13:27 ` Andy Shevchenko 2012-10-12 13:27 ` Andy Shevchenko 2012-10-12 13:28 ` Shevchenko, Andriy 2012-10-12 13:28 ` Shevchenko, Andriy 2012-10-12 13:28 ` Shevchenko, Andriy 2012-10-12 14:06 ` Viresh Kumar 2012-10-12 14:06 ` Viresh Kumar 2012-10-12 14:06 ` Viresh Kumar 2012-10-12 14:41 ` Shevchenko, Andriy 2012-10-12 14:41 ` Shevchenko, Andriy 2012-10-12 14:41 ` Shevchenko, Andriy 2012-10-12 14:47 ` Viresh Kumar 2012-10-12 14:47 ` Viresh Kumar 2012-10-12 14:47 ` Viresh Kumar 2012-10-12 5:44 ` [PATCH 3/3] ARM: SPEAr13xx: Pass DW DMAC platform data from DT Viresh Kumar 2012-10-12 5:44 ` Viresh Kumar
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to='CAOh2x=karuuGbzwACPL8GNL4ivuLypqBj=sGCrJLupBBy52Uwg@mail.gmail.com' \ --to=viresh.kumar@linaro.org \ --cc=andriy.shevchenko@linux.intel.com \ --cc=devicetree-discuss@lists.ozlabs.org \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-kernel@vger.kernel.org \ --cc=spear-devel@list.st.com \ --cc=vinod.koul@intel.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.