Re: [PATCH 13/31] dma: tegra: register as an OF DMA controller

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Friday 15 November 2013, Stephen Warren wrote:
> +bool tegra_dma_filter_fn(struct dma_chan *dc, void *param)
> +{
> +       u32 slave_id = *(u32 *)param;
> +       struct tegra_dma_channel *tdc;
> +
> +       if (dc->device->dev->driver != &tegra_dmac_driver.driver)
> +               return false;
> +
> +       tdc = to_tegra_dma_chan(dc);
> +       tdc->slave_id = slave_id;
> +
> +       return true;
> +}
> +
> +static struct of_dma_filter_info tegra_dma_info = {
> +       .filter_fn = tegra_dma_filter_fn,
> +};
> +
>  static int tegra_dma_probe(struct platform_device *pdev)
>  {
>         struct resource *res;
> @@ -1383,6 +1409,10 @@ static int tegra_dma_probe(struct platform_device *pdev)
>                 goto err_irq;
>         }
>  
> +       tegra_dma_info.dma_cap = tdma->dma_dev.cap_mask;
> +       ret = of_dma_controller_register(pdev->dev.of_node,
> +                                        of_dma_simple_xlate, &tegra_dma_info);
> +

I would suggest to use a custom xlate() function based on
dma_get_slave_channel() that was added recently: Iterating through all
channels is not necessary any more.

	Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [ARM Kernel]     [Linux ARM]     [Linux ARM MSM]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux