From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Warren Subject: Re: [PATCH 2/9] dma: tegra20-apbdma: move to generic device tree bindings Date: Fri, 26 Jul 2013 13:27:58 -0600 Message-ID: <51F2CDBE.40802@wwwdotorg.org> References: <1374639002-16753-1-git-send-email-rizhao@nvidia.com> <1374639002-16753-3-git-send-email-rizhao@nvidia.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1374639002-16753-3-git-send-email-rizhao-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org> Sender: linux-tegra-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Richard Zhao Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org, vinod.koul-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org, djbw-b10kYP2dOMg@public.gmane.org List-Id: linux-tegra@vger.kernel.org (Stripping the Cc list a lot) On 07/23/2013 10:09 PM, Richard Zhao wrote: > Update tegra20-apbdma driver to adopt generic DMA device tree bindings. > It calls of_dma_controller_register() with of_dma_simple_xlate to get > the generic DMA device tree helper support. The #dma-cells for apbdma > must be 1, which is slave ID. > > The existing nvidia,dma-request-selector still works there, and the > support will be removed after all clients get converted to generic DMA > device tree helper. (BTW, I would like to take this series through the Tegra tree to simplify dependencies. So, I'm looking for ack's on the drivers rather than for them to be applied. I had hoped Richard would point this out when posting the patches) > diff --git a/drivers/dma/tegra20-apb-dma.c b/drivers/dma/tegra20-apb-dma.c > +static bool tegra_dma_filter_fn(struct dma_chan *dc, void *param) > +{ > + if (dc->device->dev->driver == &tegra_dmac_driver.driver) { > + struct tegra_dma_channel *tdc = to_tegra_dma_chan(dc); > + unsigned req = *(unsigned *)param; > + > + tdc->slave_id = req; > + > + return true; > + } > + return false; > +} > + > +static struct of_dma_filter_info tegra_dma_info = { > + .filter_fn = tegra_dma_filter_fn, > +}; Why does this driver need to define a filter function? I thought the dmaengine's DT support would already match DMA clients/engines based on the phandle in DT? Isn't the need to pass the slave channel ID into drivers something pretty fundamental to dmaengine, and hence something it already supports? From mboxrd@z Thu Jan 1 00:00:00 1970 From: swarren@wwwdotorg.org (Stephen Warren) Date: Fri, 26 Jul 2013 13:27:58 -0600 Subject: [PATCH 2/9] dma: tegra20-apbdma: move to generic device tree bindings In-Reply-To: <1374639002-16753-3-git-send-email-rizhao@nvidia.com> References: <1374639002-16753-1-git-send-email-rizhao@nvidia.com> <1374639002-16753-3-git-send-email-rizhao@nvidia.com> Message-ID: <51F2CDBE.40802@wwwdotorg.org> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org (Stripping the Cc list a lot) On 07/23/2013 10:09 PM, Richard Zhao wrote: > Update tegra20-apbdma driver to adopt generic DMA device tree bindings. > It calls of_dma_controller_register() with of_dma_simple_xlate to get > the generic DMA device tree helper support. The #dma-cells for apbdma > must be 1, which is slave ID. > > The existing nvidia,dma-request-selector still works there, and the > support will be removed after all clients get converted to generic DMA > device tree helper. (BTW, I would like to take this series through the Tegra tree to simplify dependencies. So, I'm looking for ack's on the drivers rather than for them to be applied. I had hoped Richard would point this out when posting the patches) > diff --git a/drivers/dma/tegra20-apb-dma.c b/drivers/dma/tegra20-apb-dma.c > +static bool tegra_dma_filter_fn(struct dma_chan *dc, void *param) > +{ > + if (dc->device->dev->driver == &tegra_dmac_driver.driver) { > + struct tegra_dma_channel *tdc = to_tegra_dma_chan(dc); > + unsigned req = *(unsigned *)param; > + > + tdc->slave_id = req; > + > + return true; > + } > + return false; > +} > + > +static struct of_dma_filter_info tegra_dma_info = { > + .filter_fn = tegra_dma_filter_fn, > +}; Why does this driver need to define a filter function? I thought the dmaengine's DT support would already match DMA clients/engines based on the phandle in DT? Isn't the need to pass the slave channel ID into drivers something pretty fundamental to dmaengine, and hence something it already supports?