[PATCH V3 1/2] of: Add generic device tree DMA helpers

Arnd Bergmann arnd at arndb.de
Fri May 18 17:43:54 EDT 2012


On Friday 18 May 2012, Stephen Warren wrote:
> > The driver can still request the dma line by name "tx" and the subsystem
> > would pick one out of those with the same name.
> > 
> > For the majority of cases, we would only need a single dma request line
> 
> Hmm. Many devices have multiple different FIFOs, and hence multiple DMA
> request signals (e.g. Tegra I2S has separate RX and TX FIFO, Tegra
> S/PDIF has 2 FIFOs in each direction). That would require the driver to
> always use get_by_name() to differentiate between 2/4 options for the
> same DMA req or 2/4 different DMA requests. Most other bindings allow
> use of get_by_id() or get_by_name() interchangeably.

Ok, good point. So we could make the common case that they are numbered
but not named and require all drivers to use named properties when
there is the possibility that the device might be connected to multiple
controllers, but that seems tricky because a driver can start being
used on a platform that has only one controller and have no dma-name
property in the device tree but then get used on a different soc
that actually has multiple controllers.
So if we do that, we might want to make the dma-names property mandatory
for every device, and document what the names are.

Another option would be to encode the direction in the property in
a generic way and provide an API that lets you ask specifically
for a read, write or readwrite channel out of the ones that are
available, rather than assuming there is only one kind. Consequently,
any device that uses more than one read channel or more than one
write channel would still have to use names to identify them.

	Arnd



More information about the linux-arm-kernel mailing list