Re: [PATCH 2/6 v5] dmaengine: rcar-audmapp: independent from SH_DMAE_BASE v2

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

 



Hi Arnd

> > +static bool audmapp_chan_filter(struct dma_chan *chan, void *arg)
> > +{
> > +       struct dma_device *dma = chan->device;
> > +       struct of_phandle_args *dma_spec = arg;
> > +
> > +       /*
> > +        * FIXME: Using a filter on OF platforms is a nonsense. The OF xlate
> > +        * function knows from which device it wants to allocate a channel from,
> > +        * and would be perfectly capable of selecting the channel it wants.
> > +        * Forcing it to call dma_request_channel() and iterate through all
> > +        * channels from all controllers is just pointless.
> > +        */
> > +       if (dma->device_config != audmapp_device_config ||
> > +           dma_spec->np != dma->dev->of_node)
> > +               return false;
> > +
> > 
> 
> I think the above means you can have a trivial xlate function instead, like
> 
> static struct dma_chan *audmapp_of_xlate(struct of_phandle_args *dma_spec,
> +                                        struct of_dma *ofdma)
> +{
> +       struct audmapp_chan *achan;
> +       struct dma_chan *chan;
> +
> +       if (dma_spec->args_count != 1)
> +               return NULL;
> +
> +       chan = dma_get_any_slave_channel(of_dma->of_dma_data);
> +       if (!chan)
> +               return NULL;
> +
> +       achan = chan_to_achan(chan);
> +       achan->chcr = dma_spec->args[0] << 16;
> +
> +       return chan;
> +}

Thank you. I didn't know this method

Best regards
---
Kuninori Morimoto
--
To unsubscribe from this list: send the line "unsubscribe dmaengine" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux PCI]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux