Skip to contentSkip to conversation

Add Qualcomm ADM dmaengine driver

PATCH Superseded Andy Gross 4 participants 10 messages Jan 8, 2015 – Feb 11, 2015

Subsystems (3)

v2 of 6 Superseded Latest is v6 →

lore
Share & tools
lore

Andy Gross

author
#0 lore raw

v2 cover Add Qualcomm ADM dmaengine driver

This patch set introduces the dmaengine driver for the Qualcomm Application Data Mover (ADM) DMA controller present on MSM8960, APQ8064, and IPQ8064 devices.

The initial version of this driver will only support slave DMA operations between system memory and peripherals. Flow control via the CRCI (client rate control interface) is supported and can be configured via device tree configuration. Flow control usage is required for some peripheral devices.

Changes since v1:
- Fixed various review comments
- Fixed some descriptor programming issues.
- Added single descriptors to support sub burst length transactions. Selection of single or box descriptors depends on the sg length and burst size.
- Removed use of crci in the dmas property. CRCI is now designated via the slave_config structure and will be stored in slave_id.

Andy Gross (2):
dmaengine: Add ADM driveri
dt/bindings: qcom_adm: Fix channel specificers

 Documentation/devicetree/bindings/dma/qcom_adm.txt |   14 +-
 drivers/dma/Kconfig                                |   10 +
 drivers/dma/Makefile                               |    1 +
 drivers/dma/qcom_adm.c                             |  899 ++++++++++++++++++++
 4 files changed, 915 insertions(+), 9 deletions(-)
 create mode 100644 drivers/dma/qcom_adm.c
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation
author
#1 lore raw

PATCH v2 1/2 dmaengine: Add ADM driver

---
 drivers/dma/Kconfig    |   10 +
 drivers/dma/Makefile   |    1 +
 drivers/dma/qcom_adm.c |  899 ++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 910 insertions(+)
 create mode 100644 drivers/dma/qcom_adm.c
drivers/dma/Kconfig +10 -0
index f2b2c4e..69bc15e 100644
@@ -464,4 +464,14 @@ config QCOM_BAM_DMA
 	  Enable support for the QCOM BAM DMA controller.  This controller
 	  provides DMA capabilities for a variety of on-chip devices.
 
+config QCOM_ADM
+	tristate "Qualcomm ADM support"
+	depends on ARCH_QCOM || (COMPILE_TEST && OF && ARM)
+	select DMA_ENGINE
+	select DMA_VIRTUAL_CHANNELS
+	---help---
+	  Enable support for the Qualcomm ADM DMA controller.  This controller
+	  provides DMA capabilities for both general purpose and on-chip
+	  peripheral devices.
+
 endif
drivers/dma/Makefile +1 -0
index 2022b54..3b7ead6 100644
@@ -50,3 +50,4 @@ obj-y += xilinx/
 obj-$(CONFIG_INTEL_MIC_X100_DMA) += mic_x100_dma.o
 obj-$(CONFIG_NBPFAXI_DMA) += nbpfaxi.o
 obj-$(CONFIG_DMA_SUN6I) += sun6i-dma.o
+obj-$(CONFIG_QCOM_ADM) += qcom_adm.o
drivers/dma/qcom_adm.c new file +899 -0

899 lines not on this page · raw message

Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation
author
#2 lore raw

Re: [Patch v2 1/2] dmaengine: Add ADM driver

On Wed, Jan 07, 2015 at 09:26:11PM -0600, Andy Gross wrote:

I somehow managed to lose my commit message. I'll fix that in the next set. The rest of the patch is fine.

Quoted 1 line

<snip>

#3 lore raw

Re: [Patch v2 1/2] dmaengine: Add ADM driver

In reply to Andy Gross

Hi,

Quoted 1 line · Andy Gross

<snip>

Quoted 7 lines
drivers/dma/qcom_adm.c new file +7 -0
+static struct dma_async_tx_descriptor *adm_prep_slave_sg(struct dma_chan *chan,
+	struct scatterlist *sgl, unsigned int sg_len,
+	enum dma_transfer_direction direction, unsigned long flags,
+	void *context)
+{
+	struct adm_chan *achan = to_adm_chan(chan);
+	struct adm_device *adev = achan->adev;

drivers/dma/qcom_adm.c line 259

Quoted 10 lines
drivers/dma/qcom_adm.c new file +10 -0
+	struct adm_async_desc *async_desc;
+	struct scatterlist *sg;
+	u32 i;
+	u32 single_count = 0, box_count = 0, desc_offset = 0, crci = 0;
+	struct adm_desc_hw_box *box_desc;
+	struct adm_desc_hw_single *single_desc;
+	void *desc;
+	u32 *cple, *last_cmd;
+	u32 burst;
+	int blk_size = -EINVAL;

blk_size should be set to 0 here. Otherwise async_desc->blk_size takes -EINVAL when no flow control.

Quoted 21 lines
drivers/dma/qcom_adm.c new file +21 -0
+
+
+	if (!is_slave_direction(direction)) {
+		dev_err(adev->dev, "invalid dma direction\n");
+		return NULL;
+	}
+
+	/*
+	 * get burst value from slave configuration
+	 * If zero, default to maximum burst size
+	 * If larger than the max transfer size, set to ADM_MAX_XFER
+	 */
+	burst = (direction == DMA_MEM_TO_DEV) ?
+		achan->slave.dst_maxburst :
+		achan->slave.src_maxburst;
+
+	if (!burst || burst > ADM_MAX_XFER)
+		burst = ADM_MAX_XFER;
+
+	/* if using flow control, validate burst and crci values */
+	if (achan->slave.device_fc) {

drivers/dma/qcom_adm.c line 290

Quoted 10 lines
drivers/dma/qcom_adm.c new file +10 -0
+
+		blk_size = adm_get_blksize(burst);
+		if (blk_size < 0) {
+			dev_err(adev->dev, "invalid burst value w/ crci: %d\n",
+				burst);
+			return ERR_PTR(-EINVAL);
+		}
+
+		crci = achan->slave.slave_id;
+		if (!(crci & 0xf)) {

This check isn't sufficient for the crci to lie between 1 and 15. slave_id passed as, say, 0xf5, will be valid.

<snip>

Quoted 8 lines
drivers/dma/qcom_adm.c new file +8 -0
+/**
+ * adm_dma_irq - irq handler for ADM controller
+ * @irq: IRQ of interrupt
+ * @data: callback data
+ *
+ * IRQ handler for the bam controller
+ */
+static irqreturn_t adm_dma_irq(int irq, void *data)

drivers/dma/qcom_adm.c line 541

Quoted 10 lines
drivers/dma/qcom_adm.c new file +10 -0
+{
+	struct adm_device *adev = data;
+	u32 srcs, i;
+	struct adm_async_desc *async_desc;
+	unsigned long flags;
+
+	srcs = readl_relaxed(adev->regs +
+			HI_SEC_DOMAIN_IRQ_STATUS(adev->ee));
+
+	for (i = 0; i < 16; i++) {

we could use adev->num_channels here instead of 16.

Quoted 40 lines
drivers/dma/qcom_adm.c new file +40 -0
+		struct adm_chan *achan = &adev->channels[i];
+		u32 status, result;
+
+		if (srcs & BIT(i)) {
+			status = readl_relaxed(adev->regs +
+				HI_CH_STATUS_SD(i, adev->ee));
+
+			/* if no result present, skip */
+			if (!(status & CH_STATUS_VALID))
+				continue;
+
+			result = readl_relaxed(adev->regs +
+				HI_CH_RSLT(i, adev->ee));
+
+			/* no valid results, skip */
+			if (!(result & CH_RSLT_VALID))
+				continue;
+
+			/* flag error if transaction was flushed or failed */
+			if (result & (CH_RSLT_ERR | CH_RSLT_FLUSH))
+				achan->error = 1;
+
+			spin_lock_irqsave(&achan->vc.lock, flags);
+			async_desc = achan->curr_txd;
+
+			achan->curr_txd = NULL;
+
+			if (async_desc) {
+				vchan_cookie_complete(&async_desc->vd);
+
+				/* kick off next DMA */
+				adm_start_dma(achan);
+			}
+
+			spin_unlock_irqrestore(&achan->vc.lock, flags);
+		}
+	}
+
+	return IRQ_HANDLED;
+}

<snip>

Quoted 33 lines
drivers/dma/qcom_adm.c new file +33 -0
+
+static int adm_dma_probe(struct platform_device *pdev)
+{
+	struct adm_device *adev;
+	struct resource *iores;
+	int ret;
+	u32 i;
+
+	adev = devm_kzalloc(&pdev->dev, sizeof(*adev), GFP_KERNEL);
+	if (!adev)
+		return -ENOMEM;
+
+	adev->dev = &pdev->dev;
+
+	iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+	adev->regs = devm_ioremap_resource(&pdev->dev, iores);
+	if (IS_ERR(adev->regs))
+		return PTR_ERR(adev->regs);
+
+	adev->irq = platform_get_irq(pdev, 0);
+	if (adev->irq < 0)
+		return adev->irq;
+
+	ret = of_property_read_u32(pdev->dev.of_node, "qcom,ee", &adev->ee);
+	if (ret) {
+		dev_err(adev->dev, "Execution environment unspecified\n");
+		return ret;
+	}
+
+	adev->core_clk = devm_clk_get(adev->dev, "core");
+	if (IS_ERR(adev->core_clk))
+		return PTR_ERR(adev->core_clk);
+

drivers/dma/qcom_adm.c line 737

Quoted 10 lines
drivers/dma/qcom_adm.c new file +10 -0
+	ret = clk_prepare_enable(adev->core_clk);
+	if (ret) {
+		dev_err(adev->dev, "failed to prepare/enable core clock\n");
+		return ret;
+	}
+
+	adev->iface_clk = devm_clk_get(adev->dev, "iface");
+	if (IS_ERR(adev->iface_clk))
+		return PTR_ERR(adev->iface_clk);
+

An error here or below would leave core_clk on.

Quoted 19 lines
drivers/dma/qcom_adm.c new file +19 -0
+	ret = clk_prepare_enable(adev->iface_clk);
+	if (ret) {
+		dev_err(adev->dev, "failed to prepare/enable iface clock\n");
+		return ret;
+	}
+
+	adev->clk_reset = devm_reset_control_get(&pdev->dev, "clk");
+	if (IS_ERR(adev->clk_reset)) {
+		dev_err(adev->dev, "failed to get ADM0 reset\n");
+		return PTR_ERR(adev->clk_reset);
+	}
+
+	adev->c0_reset = devm_reset_control_get(&pdev->dev, "c0");
+	if (IS_ERR(adev->c0_reset)) {
+		dev_err(adev->dev, "failed to get ADM0 C0 reset\n");
+		return PTR_ERR(adev->c0_reset);
+	}
+
+	adev->c1_reset = devm_reset_control_get(&pdev->dev, "c1");

drivers/dma/qcom_adm.c line 766

Quoted 10 lines
drivers/dma/qcom_adm.c new file +10 -0
+	if (IS_ERR(adev->c1_reset)) {
+		dev_err(adev->dev, "failed to get ADM0 C1 reset\n");
+		return PTR_ERR(adev->c1_reset);
+	}
+
+	adev->c2_reset = devm_reset_control_get(&pdev->dev, "c2");
+	if (IS_ERR(adev->c2_reset)) {
+		dev_err(adev->dev, "failed to get ADM0 C2 reset\n");
+		return PTR_ERR(adev->c2_reset);
+	}

All the devm_reset_control_get() failures should disable the clocks too.

Looks good otherwise.

Thanks,
Archit

author
#4 lore raw

Re: [Patch v2 1/2] dmaengine: Add ADM driver

Quoted 18 lines · Archit Taneja

Hi,

Quoted 1 line · Andy Gross

<snip>

Quoted 12 lines
drivers/dma/qcom_adm.c new file +12 -0
+static struct dma_async_tx_descriptor *adm_prep_slave_sg(struct dma_chan *chan,
+	struct scatterlist *sgl, unsigned int sg_len,
+	enum dma_transfer_direction direction, unsigned long flags,
+	void *context)
+{
+	struct adm_chan *achan = to_adm_chan(chan);
+	struct adm_device *adev = achan->adev;
+	struct adm_async_desc *async_desc;
+	struct scatterlist *sg;
+	u32 i;
+	u32 single_count = 0, box_count = 0, desc_offset = 0, crci = 0;
+	struct adm_desc_hw_box *box_desc;
Quoted 8 lines

drivers/dma/qcom_adm.c line 259

Quoted 5 lines
drivers/dma/qcom_adm.c new file +5 -0
+	struct adm_desc_hw_single *single_desc;
+	void *desc;
+	u32 *cple, *last_cmd;
+	u32 burst;
+	int blk_size = -EINVAL;

blk_size should be set to 0 here. Otherwise async_desc->blk_size takes -EINVAL when no flow control.

We only use the blk_size value in the start_dma function, and only if device_fc=1. So for no flow control, any value is acceptable. You can't prep a descriptor with a bad blk_size and flow control on. So we're covered both ways.

Quoted 27 lines
Quoted 27 lines
drivers/dma/qcom_adm.c new file +26 -0
+
+
+	if (!is_slave_direction(direction)) {
+		dev_err(adev->dev, "invalid dma direction\n");
+		return NULL;
+	}
+
+	/*
+	 * get burst value from slave configuration
+	 * If zero, default to maximum burst size
+	 * If larger than the max transfer size, set to ADM_MAX_XFER
+	 */
+	burst = (direction == DMA_MEM_TO_DEV) ?
+		achan->slave.dst_maxburst :
+		achan->slave.src_maxburst;
+
+	if (!burst || burst > ADM_MAX_XFER)
+		burst = ADM_MAX_XFER;
+
+	/* if using flow control, validate burst and crci values */
+	if (achan->slave.device_fc) {
+
+		blk_size = adm_get_blksize(burst);
+		if (blk_size < 0) {
+			dev_err(adev->dev, "invalid burst value w/ crci: %d\n",
+				burst);
Quoted 8 lines

drivers/dma/qcom_adm.c line 290

Quoted 5 lines
drivers/dma/qcom_adm.c new file +5 -0
+			return ERR_PTR(-EINVAL);
+		}
+
+		crci = achan->slave.slave_id;
+		if (!(crci & 0xf)) {

This check isn't sufficient for the crci to lie between 1 and 15. slave_id passed as, say, 0xf5, will be valid.

True. The real range would be 0x10->0x1F, as bit 8 denotes the mux setting. I'll put in a check here.

Quoted 16 lines

<snip>

Quoted 12 lines
drivers/dma/qcom_adm.c new file +12 -0
+/**
+ * adm_dma_irq - irq handler for ADM controller
+ * @irq: IRQ of interrupt
+ * @data: callback data
+ *
+ * IRQ handler for the bam controller
+ */
+static irqreturn_t adm_dma_irq(int irq, void *data)
+{
+	struct adm_device *adev = data;
+	u32 srcs, i;
+	struct adm_async_desc *async_desc;
Quoted 8 lines

drivers/dma/qcom_adm.c line 541

Quoted 6 lines
drivers/dma/qcom_adm.c new file +6 -0
+	unsigned long flags;
+
+	srcs = readl_relaxed(adev->regs +
+			HI_SEC_DOMAIN_IRQ_STATUS(adev->ee));
+
+	for (i = 0; i < 16; i++) {

we could use adev->num_channels here instead of 16.

Right. will fix.

Quoted 39 lines

<snip>

Quoted 37 lines
drivers/dma/qcom_adm.c new file +37 -0
+
+static int adm_dma_probe(struct platform_device *pdev)
+{
+	struct adm_device *adev;
+	struct resource *iores;
+	int ret;
+	u32 i;
+
+	adev = devm_kzalloc(&pdev->dev, sizeof(*adev), GFP_KERNEL);
+	if (!adev)
+		return -ENOMEM;
+
+	adev->dev = &pdev->dev;
+
+	iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+	adev->regs = devm_ioremap_resource(&pdev->dev, iores);
+	if (IS_ERR(adev->regs))
+		return PTR_ERR(adev->regs);
+
+	adev->irq = platform_get_irq(pdev, 0);
+	if (adev->irq < 0)
+		return adev->irq;
+
+	ret = of_property_read_u32(pdev->dev.of_node, "qcom,ee", &adev->ee);
+	if (ret) {
+		dev_err(adev->dev, "Execution environment unspecified\n");
+		return ret;
+	}
+
+	adev->core_clk = devm_clk_get(adev->dev, "core");
+	if (IS_ERR(adev->core_clk))
+		return PTR_ERR(adev->core_clk);
+
+	ret = clk_prepare_enable(adev->core_clk);
+	if (ret) {
+		dev_err(adev->dev, "failed to prepare/enable core clock\n");
+		return ret;
Quoted 8 lines

drivers/dma/qcom_adm.c line 737

Quoted 6 lines
drivers/dma/qcom_adm.c new file +6 -0
+	}
+
+	adev->iface_clk = devm_clk_get(adev->dev, "iface");
+	if (IS_ERR(adev->iface_clk))
+		return PTR_ERR(adev->iface_clk);
+

An error here or below would leave core_clk on.

Will fix, thanks.

Quoted 5 lines

drivers/dma/qcom_adm.c line 766

Quoted 3 lines
drivers/dma/qcom_adm.c new file +3 -0
+		dev_err(adev->dev, "failed to get ADM0 C2 reset\n");
+		return PTR_ERR(adev->c2_reset);
+	}

All the devm_reset_control_get() failures should disable the clocks too.

Thanks, I'll fix that up.

Signature · 3 lines
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
#5 lore raw

Re: [Patch v2 1/2] dmaengine: Add ADM driver

In reply to Andy Gross

Hi Andy,
A minor doubt.

Quoted 5 lines · Andy Gross
---
 drivers/dma/Kconfig    |   10 +
 drivers/dma/Makefile   |    1 +
 drivers/dma/qcom_adm.c |  899 ++++++++++++++++++++++++++++++++++++++++++++++++

<snip>

drivers/dma/qcom_adm.c line 630

Quoted 10 lines
drivers/dma/qcom_adm.c new file +10 -0
+
+	return ret;
+}
+
+static struct dma_chan *adm_dma_xlate(struct of_phandle_args *dma_spec,
+	struct of_dma *of)
+{
+	struct adm_device *adev = container_of(of->of_dma_data,
+			struct adm_device, common);
+	struct adm_chan *achan;

I don't see achan being used anywhere in this function? apart from below.

Quoted 8 lines
drivers/dma/qcom_adm.c new file +8 -0
+	struct dma_chan *chan;
+	unsigned int request;
+
+	if (dma_spec->args_count != 1) {
+		dev_err(adev->dev, "incorrect number of dma arguments\n");
+		return NULL;
+	}
+

drivers/dma/qcom_adm.c line 648

Quoted 10 lines
drivers/dma/qcom_adm.c new file +10 -0
+	request = dma_spec->args[0];
+	if (request >= adev->num_channels)
+		return NULL;
+
+	chan = dma_get_slave_channel(&(adev->channels[request].vc.chan));
+
+	if (!chan)
+		return NULL;
+
+	achan = to_adm_chan(chan);

Could not understand the use of achan here. unused code?

Quoted 7 lines
drivers/dma/qcom_adm.c new file +7 -0
+
+	return chan;
+}
+
+/**
+ * adm_issue_pending - starts pending transactions
+ * @chan: dma channel

<snip>

Quoted 6 lines
drivers/dma/qcom_adm.c new file +5 -0
+module_platform_driver(adm_dma_driver);
+
+MODULE_AUTHOR("Andy Gross <[email protected]>");
+MODULE_DESCRIPTION("QCOM ADM DMA engine driver");
+MODULE_LICENSE("GPL v2");
author
#6 lore raw

Re: [Patch v2 1/2] dmaengine: Add ADM driver

Quoted 3 lines · Pramod Gurav

drivers/dma/qcom_adm.c line 648

Quoted 2 lines
drivers/dma/qcom_adm.c new file +2 -0
+
+	achan = to_adm_chan(chan);

Could not understand the use of achan here. unused code?

yeah its unnecessary now. will remove. Thanks!

Quoted 2 lines
Quoted 2 lines

+

Signature · 3 lines
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
author
#7 lore raw

PATCH v2 2/2 dt/bindings: qcom_adm: Fix channel specificers

In reply to Andy Gross

This patch removes the crci information from the dma channel property. At least one client device requires using more than one CRCI value for a channel. This does not match the current binding and the crci information needs to be removed.

Instead, the client device will provide this information via other means.

---
 Documentation/devicetree/bindings/dma/qcom_adm.txt |   14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)
Documentation/devicetree/bindings/dma/qcom_adm.txt +5 -9
index 9bcab91..fba67c6 100644
@@ -4,8 +4,7 @@ Required properties:
 - compatible: must contain "qcom,adm" for IPQ/APQ8064 and MSM8960
 - reg: Address range for DMA registers
 - interrupts: Should contain one interrupt shared by all channels
-- #dma-cells: must be <2>.  First cell denotes the channel number.  Second cell
-  denotes CRCI (client rate control interface) flow control assignment.
+- #dma-cells: must be <1>.  First cell denotes the channel number.
 - clocks: Should contain the core clock and interface clock.
 - clock-names: Must contain "core" for the core clock and "iface" for the
   interface clock.
@@ -22,7 +21,7 @@ Example:
 			compatible = "qcom,adm";
 			reg = <0x18300000 0x100000>;
 			interrupts = <0 170 0>;
-			#dma-cells = <2>;
+			#dma-cells = <1>;
 
 			clocks = <&gcc ADM0_CLK>, <&gcc ADM0_PBUS_CLK>;
 			clock-names = "core", "iface";
@@ -35,15 +34,12 @@ Example:
 			qcom,ee = <0>;
 		};
 
-DMA clients must use the format descripted in the dma.txt file, using a three
+DMA clients must use the format descripted in the dma.txt file, using a two
 cell specifier for each channel.
 
 Each dmas request consists of 3 cells:
  1. phandle pointing to the DMA controller
  2. channel number
- 3. CRCI assignment, if applicable.  If no CRCI flow control is required, use 0.
-    The CRCI is used for flow control.  It identifies the peripheral device that
-    is the source/destination for the transferred data.
 
 Example:
 
@@ -56,7 +52,7 @@ Example:
 
 		cs-gpios = <&qcom_pinmux 20 0>;
 
-		dmas = <&adm_dma 6 9>,
-			<&adm_dma 5 10>;
+		dmas = <&adm_dma 6>,
+			<&adm_dma 5>;
 		dma-names = "rx", "tx";
 	};
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation
#8 lore raw

Re: [Patch v2 2/2] dt/bindings: qcom_adm: Fix channel specificers

Hi Andy,

Quoted 35 lines · Andy Gross

This patch removes the crci information from the dma channel property. At least one client device requires using more than one CRCI value for a channel. This does not match the current binding and the crci information needs to be removed.

Instead, the client device will provide this information via other means.

---
 Documentation/devicetree/bindings/dma/qcom_adm.txt |   14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)
Documentation/devicetree/bindings/dma/qcom_adm.txt +2 -3
index 9bcab91..fba67c6 100644
@@ -4,8 +4,7 @@ Required properties:
 - compatible: must contain "qcom,adm" for IPQ/APQ8064 and MSM8960
 - reg: Address range for DMA registers
 - interrupts: Should contain one interrupt shared by all channels
-- #dma-cells: must be <2>.  First cell denotes the channel number.  Second cell
-  denotes CRCI (client rate control interface) flow control assignment.
+- #dma-cells: must be <1>.  First cell denotes the channel number.
 - clocks: Should contain the core clock and interface clock.
 - clock-names: Must contain "core" for the core clock and "iface" for the
   interface clock.
@@ -22,7 +21,7 @@ Example:
 			compatible = "qcom,adm";
 			reg = <0x18300000 0x100000>;
 			interrupts = <0 170 0>;
-			#dma-cells = <2>;
+			#dma-cells = <1>;
 
 			clocks = <&gcc ADM0_CLK>, <&gcc ADM0_PBUS_CLK>;
 			clock-names = "core", "iface";

Documentation/devicetree/bindings/dma/qcom_adm.txt Example: · line 40

Quoted 8 lines
Documentation/devicetree/bindings/dma/qcom_adm.txt +1 -1
@@ -35,15 +34,12 @@ Example:
 			qcom,ee = <0>;
 		};
 
-DMA clients must use the format descripted in the dma.txt file, using a three
+DMA clients must use the format descripted in the dma.txt file, using a two
 cell specifier for each channel.
 
 Each dmas request consists of 3 cells:

Now 2 cells?

Quoted 10 lines
Documentation/devicetree/bindings/dma/qcom_adm.txt +0 -3
  1. phandle pointing to the DMA controller
  2. channel number
- 3. CRCI assignment, if applicable.  If no CRCI flow control is required, use 0.
-    The CRCI is used for flow control.  It identifies the peripheral device that
-    is the source/destination for the transferred data.
 
 Example:
 

Documentation/devicetree/bindings/dma/qcom_adm.txt Example: · line 58

Quoted 9 lines
Documentation/devicetree/bindings/dma/qcom_adm.txt +2 -2
@@ -56,7 +52,7 @@ Example:
 
 		cs-gpios = <&qcom_pinmux 20 0>;
 
-		dmas = <&adm_dma 6 9>,
-			<&adm_dma 5 10>;
+		dmas = <&adm_dma 6>,
+			<&adm_dma 5>;
 		dma-names = "rx", "tx";
 	};

Chris

Signature · 3 lines
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
author
#9 lore raw

Re: [Patch v2 2/2] dt/bindings: qcom_adm: Fix channel specificers

On Thu, Jan 08, 2015 at 11:26:30AM -0500, Christopher Covington wrote:

<snip>

Quoted 6 lines
Quoted 4 lines

+DMA clients must use the format descripted in the dma.txt file, using a two
cell specifier for each channel.

Each dmas request consists of 3 cells:

Now 2 cells?

Good catch. I'll fix in next rev. Thanks!

Quoted 6 lines
Quoted 6 lines

1. phandle pointing to the DMA controller
2. channel number
- 3. CRCI assignment, if applicable. If no CRCI flow control is required, use 0.

Documentation/devicetree/bindings/dma/qcom_adm.txt +0 -2
-    The CRCI is used for flow control.  It identifies the peripheral device that
-    is the source/destination for the transferred data.

<snip>

Signature · 3 lines
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project