DT DMA channel binding for Tegra I2S

Stephen Warren swarren at nvidia.com
Thu Nov 24 08:25:28 EST 2011


Rob, Grant,

Re: http://www.spinics.net/lists/arm-kernel/msg148899.html

Background: Tegra's DMA controller needs to be told which DMA "request
select" to use for each transfer. The identifies which peripheral to
transfer to/from.

The Tegra I2S driver needs to know its own "request select" value to
pass to the audio driver DMA path. The board files typically provide
this to the driver as an IORESOURCE_DMA. I don't think there's any
standard binding that creates such a resource when instantiating a
platform device from device tree, and the discussions I found when
looking for one didn't seem to reach conclusion that there should be
one. So, I proposed the following property in the I2S driver's DT
binding for this:

Doc:

- dma-channel : The Tegra DMA controller's channel ID for this I2S controller

Example:

i2s at 70002800 {
	compatible = "nvidia,tegra20-i2s";
	reg = <0x70002800 0x200>;
	interrupts = < 45 >;
	dma-channel = < 2 >;
};

Does that look reasonable? Or, should I pursue some more standardized
solution?

(although perhaps dma-request-select would be a better name, since each
of the DMA controller's 16 channels can be used for any of the DMA
selects)

For reference, the code turns out as below; it might be nicer if the
DT parsing code could create this resource for us, although there was
some previous discussion about IORESOURCE_DMA not being the correct
representation for this anyway.

	dmareq = platform_get_resource(pdev, IORESOURCE_DMA, 0);
	if (!dmareq) {
		if (of_property_read_u32(pdev->dev.of_node,
					 "nvidia,dma-channel",
					 &dma_ch) < 0) {
...

Thanks.

-- 
nvpublic



More information about the devicetree-discuss mailing list