All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V2 0/4] Add generic DMA DT binding support
@ 2013-02-01 12:51 ` Padmavathi Venna
  0 siblings, 0 replies; 24+ messages in thread
From: Padmavathi Venna @ 2013-02-01 12:51 UTC (permalink / raw)
  To: linux-samsung-soc, devicetree-discuss, linux-arm-kernel, padma.v,
	padma.kvr
  Cc: sbkim73, broonie, kgene.kim, jassisinghbrar, arnd, vinod.koul,
	grant.likely, jon-hunter, boojin.kim, thomas.abraham

Changes since V1:
        - Address the review comments by Arnd Bergmann as below
        - Wording of the properties.
        - Pass pdmac as third parameter to of_dma_controller_register
        - Filter the dma channel based on channel number and dma_device

This patch set adds support for generic dma device tree bindings for
Samsung platforms and is dependent on the following patches from
Vinod Koul next branch
1)of: Add generic device tree DMA helpers
2)dmaengine: add helper function to request a slave DMA channel

This patch set is made based Mark Brown next branch

Padmavathi Venna (4):
  DMA: PL330: Add xlate function
  DMA: PL330: Register the DMA controller with the generic DMA helpers
  ARM: dts: Add #dma-cells for generic dma binding support
  DMA: PL330: Modify pl330 filter based on new generic dma dt bindings.

 .../devicetree/bindings/dma/arm-pl330.txt          |   15 ++++--
 arch/arm/boot/dts/exynos5250.dtsi                  |    4 ++
 drivers/dma/pl330.c                                |   56 ++++++++++++++++---
 3 files changed, 62 insertions(+), 13 deletions(-)

-- 
1.7.4.4

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH V2 0/4] Add generic DMA DT binding support
@ 2013-02-01 12:51 ` Padmavathi Venna
  0 siblings, 0 replies; 24+ messages in thread
From: Padmavathi Venna @ 2013-02-01 12:51 UTC (permalink / raw)
  To: linux-arm-kernel

Changes since V1:
        - Address the review comments by Arnd Bergmann as below
        - Wording of the properties.
        - Pass pdmac as third parameter to of_dma_controller_register
        - Filter the dma channel based on channel number and dma_device

This patch set adds support for generic dma device tree bindings for
Samsung platforms and is dependent on the following patches from
Vinod Koul next branch
1)of: Add generic device tree DMA helpers
2)dmaengine: add helper function to request a slave DMA channel

This patch set is made based Mark Brown next branch

Padmavathi Venna (4):
  DMA: PL330: Add xlate function
  DMA: PL330: Register the DMA controller with the generic DMA helpers
  ARM: dts: Add #dma-cells for generic dma binding support
  DMA: PL330: Modify pl330 filter based on new generic dma dt bindings.

 .../devicetree/bindings/dma/arm-pl330.txt          |   15 ++++--
 arch/arm/boot/dts/exynos5250.dtsi                  |    4 ++
 drivers/dma/pl330.c                                |   56 ++++++++++++++++---
 3 files changed, 62 insertions(+), 13 deletions(-)

-- 
1.7.4.4

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH V2 1/4] DMA: PL330: Add xlate function
  2013-02-01 12:51 ` Padmavathi Venna
@ 2013-02-01 12:51   ` Padmavathi Venna
  -1 siblings, 0 replies; 24+ messages in thread
From: Padmavathi Venna @ 2013-02-01 12:51 UTC (permalink / raw)
  To: linux-samsung-soc, devicetree-discuss, linux-arm-kernel, padma.v,
	padma.kvr
  Cc: sbkim73, broonie, kgene.kim, jassisinghbrar, arnd, vinod.koul,
	grant.likely, jon-hunter, boojin.kim, thomas.abraham

Add xlate to translate the device-tree binding information into
the appropriate format. The filter function requires the dma
controller device and dma channel number as filter_params.

Signed-off-by: Padmavathi Venna <padma.v@samsung.com>
---
 drivers/dma/pl330.c |   31 +++++++++++++++++++++++++++++++
 1 files changed, 31 insertions(+), 0 deletions(-)

diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
index 80680ee..6196cc0 100644
--- a/drivers/dma/pl330.c
+++ b/drivers/dma/pl330.c
@@ -25,6 +25,7 @@
 #include <linux/amba/pl330.h>
 #include <linux/scatterlist.h>
 #include <linux/of.h>
+#include <linux/of_dma.h>
 
 #include "dmaengine.h"
 #define PL330_MAX_CHAN		8
@@ -606,6 +607,11 @@ struct dma_pl330_desc {
 	struct dma_pl330_chan *pchan;
 };
 
+struct dma_pl330_filter_args {
+	struct dma_pl330_dmac *pdmac;
+	unsigned int chan_id;
+};
+
 static inline void _callback(struct pl330_req *r, enum pl330_op_err err)
 {
 	if (r && r->xfer_cb)
@@ -2352,6 +2358,31 @@ static void dma_pl330_rqcb(void *token, enum pl330_op_err err)
 	tasklet_schedule(&pch->task);
 }
 
+struct dma_chan *of_dma_pl330_xlate(struct of_phandle_args *dma_spec,
+						struct of_dma *ofdma)
+{
+	int count = dma_spec->args_count;
+	struct dma_pl330_dmac *pdmac = ofdma->of_dma_data;
+	struct dma_pl330_filter_args fargs;
+	dma_cap_mask_t cap;
+
+	if (!pdmac)
+		return NULL;
+
+	if (count != 1)
+		return NULL;
+
+	fargs.pdmac = pdmac;
+	fargs.chan_id = dma_spec->args[0];
+
+	dma_cap_zero(cap);
+	dma_cap_set(DMA_SLAVE, cap);
+	dma_cap_set(DMA_CYCLIC, cap);
+
+	return dma_request_channel(cap, pl330_filter, &fargs);
+}
+EXPORT_SYMBOL_GPL(of_dma_pl330_xlate);
+
 bool pl330_filter(struct dma_chan *chan, void *param)
 {
 	u8 *peri_id;
-- 
1.7.4.4

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH V2 1/4] DMA: PL330: Add xlate function
@ 2013-02-01 12:51   ` Padmavathi Venna
  0 siblings, 0 replies; 24+ messages in thread
From: Padmavathi Venna @ 2013-02-01 12:51 UTC (permalink / raw)
  To: linux-arm-kernel

Add xlate to translate the device-tree binding information into
the appropriate format. The filter function requires the dma
controller device and dma channel number as filter_params.

Signed-off-by: Padmavathi Venna <padma.v@samsung.com>
---
 drivers/dma/pl330.c |   31 +++++++++++++++++++++++++++++++
 1 files changed, 31 insertions(+), 0 deletions(-)

diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
index 80680ee..6196cc0 100644
--- a/drivers/dma/pl330.c
+++ b/drivers/dma/pl330.c
@@ -25,6 +25,7 @@
 #include <linux/amba/pl330.h>
 #include <linux/scatterlist.h>
 #include <linux/of.h>
+#include <linux/of_dma.h>
 
 #include "dmaengine.h"
 #define PL330_MAX_CHAN		8
@@ -606,6 +607,11 @@ struct dma_pl330_desc {
 	struct dma_pl330_chan *pchan;
 };
 
+struct dma_pl330_filter_args {
+	struct dma_pl330_dmac *pdmac;
+	unsigned int chan_id;
+};
+
 static inline void _callback(struct pl330_req *r, enum pl330_op_err err)
 {
 	if (r && r->xfer_cb)
@@ -2352,6 +2358,31 @@ static void dma_pl330_rqcb(void *token, enum pl330_op_err err)
 	tasklet_schedule(&pch->task);
 }
 
+struct dma_chan *of_dma_pl330_xlate(struct of_phandle_args *dma_spec,
+						struct of_dma *ofdma)
+{
+	int count = dma_spec->args_count;
+	struct dma_pl330_dmac *pdmac = ofdma->of_dma_data;
+	struct dma_pl330_filter_args fargs;
+	dma_cap_mask_t cap;
+
+	if (!pdmac)
+		return NULL;
+
+	if (count != 1)
+		return NULL;
+
+	fargs.pdmac = pdmac;
+	fargs.chan_id = dma_spec->args[0];
+
+	dma_cap_zero(cap);
+	dma_cap_set(DMA_SLAVE, cap);
+	dma_cap_set(DMA_CYCLIC, cap);
+
+	return dma_request_channel(cap, pl330_filter, &fargs);
+}
+EXPORT_SYMBOL_GPL(of_dma_pl330_xlate);
+
 bool pl330_filter(struct dma_chan *chan, void *param)
 {
 	u8 *peri_id;
-- 
1.7.4.4

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH V2 2/4] DMA: PL330: Register the DMA controller with the generic DMA helpers
  2013-02-01 12:51 ` Padmavathi Venna
@ 2013-02-01 12:51     ` Padmavathi Venna
  -1 siblings, 0 replies; 24+ messages in thread
From: Padmavathi Venna @ 2013-02-01 12:51 UTC (permalink / raw)
  To: linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	padma.v-Sze3O3UU22JBDgjK7y7TUQ, padma.kvr-Re5JQEeQqe8AvxtiuMwx3w
  Cc: jassisinghbrar-Re5JQEeQqe8AvxtiuMwx3w,
	kgene.kim-Sze3O3UU22JBDgjK7y7TUQ,
	boojin.kim-Sze3O3UU22JBDgjK7y7TUQ,
	sbkim73-Sze3O3UU22JBDgjK7y7TUQ,
	broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E,
	vinod.koul-ral2JQCrhuEAvxtiuMwx3w

This patch registers the pl330 dma controller driver with the generic
device tree dma helper functions.

Signed-off-by: Padmavathi Venna <padma.v-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
---
 drivers/dma/pl330.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
index 6196cc0..ddf4dd0 100644
--- a/drivers/dma/pl330.c
+++ b/drivers/dma/pl330.c
@@ -3004,6 +3004,14 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id)
 		pi->pcfg.data_bus_width / 8, pi->pcfg.num_chan,
 		pi->pcfg.num_peri, pi->pcfg.num_events);
 
+	ret = of_dma_controller_register(adev->dev.of_node,
+					 of_dma_pl330_xlate, pdmac);
+	if (ret) {
+		dev_err(&adev->dev,
+		"unable to register DMA to the generic DT DMA helpers\n");
+		goto probe_err2;
+	}
+
 	return 0;
 
 probe_err4:
@@ -3030,6 +3038,8 @@ static int pl330_remove(struct amba_device *adev)
 	if (!pdmac)
 		return 0;
 
+	of_dma_controller_free(adev->dev.of_node);
+
 	amba_set_drvdata(adev, NULL);
 
 	/* Idle the DMAC */
-- 
1.7.4.4

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH V2 2/4] DMA: PL330: Register the DMA controller with the generic DMA helpers
@ 2013-02-01 12:51     ` Padmavathi Venna
  0 siblings, 0 replies; 24+ messages in thread
From: Padmavathi Venna @ 2013-02-01 12:51 UTC (permalink / raw)
  To: linux-arm-kernel

This patch registers the pl330 dma controller driver with the generic
device tree dma helper functions.

Signed-off-by: Padmavathi Venna <padma.v@samsung.com>
---
 drivers/dma/pl330.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
index 6196cc0..ddf4dd0 100644
--- a/drivers/dma/pl330.c
+++ b/drivers/dma/pl330.c
@@ -3004,6 +3004,14 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id)
 		pi->pcfg.data_bus_width / 8, pi->pcfg.num_chan,
 		pi->pcfg.num_peri, pi->pcfg.num_events);
 
+	ret = of_dma_controller_register(adev->dev.of_node,
+					 of_dma_pl330_xlate, pdmac);
+	if (ret) {
+		dev_err(&adev->dev,
+		"unable to register DMA to the generic DT DMA helpers\n");
+		goto probe_err2;
+	}
+
 	return 0;
 
 probe_err4:
@@ -3030,6 +3038,8 @@ static int pl330_remove(struct amba_device *adev)
 	if (!pdmac)
 		return 0;
 
+	of_dma_controller_free(adev->dev.of_node);
+
 	amba_set_drvdata(adev, NULL);
 
 	/* Idle the DMAC */
-- 
1.7.4.4

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH V2 3/4] ARM: dts: Add #dma-cells for generic dma binding support
  2013-02-01 12:51 ` Padmavathi Venna
@ 2013-02-01 12:51     ` Padmavathi Venna
  -1 siblings, 0 replies; 24+ messages in thread
From: Padmavathi Venna @ 2013-02-01 12:51 UTC (permalink / raw)
  To: linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	padma.v-Sze3O3UU22JBDgjK7y7TUQ, padma.kvr-Re5JQEeQqe8AvxtiuMwx3w
  Cc: jassisinghbrar-Re5JQEeQqe8AvxtiuMwx3w,
	kgene.kim-Sze3O3UU22JBDgjK7y7TUQ,
	boojin.kim-Sze3O3UU22JBDgjK7y7TUQ,
	sbkim73-Sze3O3UU22JBDgjK7y7TUQ,
	broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E,
	vinod.koul-ral2JQCrhuEAvxtiuMwx3w

This patch adds #dma-cells property to PL330 DMA controller
nodes for supporting generic dma dt bindings on samsung
exynos5250 platform.

Signed-off-by: Padmavathi Venna <padma.v-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
---
 .../devicetree/bindings/dma/arm-pl330.txt          |   15 +++++++++++----
 arch/arm/boot/dts/exynos5250.dtsi                  |    4 ++++
 2 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/Documentation/devicetree/bindings/dma/arm-pl330.txt b/Documentation/devicetree/bindings/dma/arm-pl330.txt
index 36e27d5..1fdbff6 100644
--- a/Documentation/devicetree/bindings/dma/arm-pl330.txt
+++ b/Documentation/devicetree/bindings/dma/arm-pl330.txt
@@ -8,6 +8,8 @@ Required properties:
   - reg: physical base address of the controller and length of memory mapped
     region.
   - interrupts: interrupt number to the cpu.
+  - #dma-cells: must be <1>. used to represent the number of integer
+    cells in the dmas property of client device.
 
 Optional properties:
 - dma-coherent      : Present if dma operations are coherent
@@ -18,16 +20,21 @@ Example:
 		compatible = "arm,pl330", "arm,primecell";
 		reg = <0x12680000 0x1000>;
 		interrupts = <99>;
+		#dma-cells = <1>;
 	};
 
 Client drivers (device nodes requiring dma transfers from dev-to-mem or
-mem-to-dev) should specify the DMA channel numbers using a two-value pair
+mem-to-dev) should specify the DMA channel numbers and dma channel names
 as shown below.
 
   [property name]  = <[phandle of the dma controller] [dma request id]>;
+  [property name]  = <[dma channel name]>
 
       where 'dma request id' is the dma request number which is connected
-      to the client controller. The 'property name' is recommended to be
-      of the form <name>-dma-channel.
+      to the client controller. The 'property name' 'dmas' and 'dma-names'
+      as required by the generic dma device tree binding helpers. The dma
+      names correspond 1:1 with the dma request ids in the dmas property.
 
-  Example:  tx-dma-channel = <&pdma0 12>;
+  Example:  dmas = <&pdma0 12
+		    &pdma1 11>;
+	    dma-names = "tx", "rx";
diff --git a/arch/arm/boot/dts/exynos5250.dtsi b/arch/arm/boot/dts/exynos5250.dtsi
index f50b4e8..724f5bd 100644
--- a/arch/arm/boot/dts/exynos5250.dtsi
+++ b/arch/arm/boot/dts/exynos5250.dtsi
@@ -312,24 +312,28 @@
 			compatible = "arm,pl330", "arm,primecell";
 			reg = <0x121A0000 0x1000>;
 			interrupts = <0 34 0>;
+			#dma-cells = <1>;
 		};
 
 		pdma1: pdma@121B0000 {
 			compatible = "arm,pl330", "arm,primecell";
 			reg = <0x121B0000 0x1000>;
 			interrupts = <0 35 0>;
+			#dma-cells = <1>;
 		};
 
 		mdma0: mdma@10800000 {
 			compatible = "arm,pl330", "arm,primecell";
 			reg = <0x10800000 0x1000>;
 			interrupts = <0 33 0>;
+			#dma-cells = <1>;
 		};
 
 		mdma1: mdma@11C10000 {
 			compatible = "arm,pl330", "arm,primecell";
 			reg = <0x11C10000 0x1000>;
 			interrupts = <0 124 0>;
+			#dma-cells = <1>;
 		};
 	};
 
-- 
1.7.4.4

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH V2 3/4] ARM: dts: Add #dma-cells for generic dma binding support
@ 2013-02-01 12:51     ` Padmavathi Venna
  0 siblings, 0 replies; 24+ messages in thread
From: Padmavathi Venna @ 2013-02-01 12:51 UTC (permalink / raw)
  To: linux-arm-kernel

This patch adds #dma-cells property to PL330 DMA controller
nodes for supporting generic dma dt bindings on samsung
exynos5250 platform.

Signed-off-by: Padmavathi Venna <padma.v@samsung.com>
---
 .../devicetree/bindings/dma/arm-pl330.txt          |   15 +++++++++++----
 arch/arm/boot/dts/exynos5250.dtsi                  |    4 ++++
 2 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/Documentation/devicetree/bindings/dma/arm-pl330.txt b/Documentation/devicetree/bindings/dma/arm-pl330.txt
index 36e27d5..1fdbff6 100644
--- a/Documentation/devicetree/bindings/dma/arm-pl330.txt
+++ b/Documentation/devicetree/bindings/dma/arm-pl330.txt
@@ -8,6 +8,8 @@ Required properties:
   - reg: physical base address of the controller and length of memory mapped
     region.
   - interrupts: interrupt number to the cpu.
+  - #dma-cells: must be <1>. used to represent the number of integer
+    cells in the dmas property of client device.
 
 Optional properties:
 - dma-coherent      : Present if dma operations are coherent
@@ -18,16 +20,21 @@ Example:
 		compatible = "arm,pl330", "arm,primecell";
 		reg = <0x12680000 0x1000>;
 		interrupts = <99>;
+		#dma-cells = <1>;
 	};
 
 Client drivers (device nodes requiring dma transfers from dev-to-mem or
-mem-to-dev) should specify the DMA channel numbers using a two-value pair
+mem-to-dev) should specify the DMA channel numbers and dma channel names
 as shown below.
 
   [property name]  = <[phandle of the dma controller] [dma request id]>;
+  [property name]  = <[dma channel name]>
 
       where 'dma request id' is the dma request number which is connected
-      to the client controller. The 'property name' is recommended to be
-      of the form <name>-dma-channel.
+      to the client controller. The 'property name' 'dmas' and 'dma-names'
+      as required by the generic dma device tree binding helpers. The dma
+      names correspond 1:1 with the dma request ids in the dmas property.
 
-  Example:  tx-dma-channel = <&pdma0 12>;
+  Example:  dmas = <&pdma0 12
+		    &pdma1 11>;
+	    dma-names = "tx", "rx";
diff --git a/arch/arm/boot/dts/exynos5250.dtsi b/arch/arm/boot/dts/exynos5250.dtsi
index f50b4e8..724f5bd 100644
--- a/arch/arm/boot/dts/exynos5250.dtsi
+++ b/arch/arm/boot/dts/exynos5250.dtsi
@@ -312,24 +312,28 @@
 			compatible = "arm,pl330", "arm,primecell";
 			reg = <0x121A0000 0x1000>;
 			interrupts = <0 34 0>;
+			#dma-cells = <1>;
 		};
 
 		pdma1: pdma at 121B0000 {
 			compatible = "arm,pl330", "arm,primecell";
 			reg = <0x121B0000 0x1000>;
 			interrupts = <0 35 0>;
+			#dma-cells = <1>;
 		};
 
 		mdma0: mdma at 10800000 {
 			compatible = "arm,pl330", "arm,primecell";
 			reg = <0x10800000 0x1000>;
 			interrupts = <0 33 0>;
+			#dma-cells = <1>;
 		};
 
 		mdma1: mdma at 11C10000 {
 			compatible = "arm,pl330", "arm,primecell";
 			reg = <0x11C10000 0x1000>;
 			interrupts = <0 124 0>;
+			#dma-cells = <1>;
 		};
 	};
 
-- 
1.7.4.4

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH V2 4/4] DMA: PL330: Modify pl330 filter based on new generic dma dt bindings.
  2013-02-01 12:51 ` Padmavathi Venna
@ 2013-02-01 12:51     ` Padmavathi Venna
  -1 siblings, 0 replies; 24+ messages in thread
From: Padmavathi Venna @ 2013-02-01 12:51 UTC (permalink / raw)
  To: linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	padma.v-Sze3O3UU22JBDgjK7y7TUQ, padma.kvr-Re5JQEeQqe8AvxtiuMwx3w
  Cc: jassisinghbrar-Re5JQEeQqe8AvxtiuMwx3w,
	kgene.kim-Sze3O3UU22JBDgjK7y7TUQ,
	boojin.kim-Sze3O3UU22JBDgjK7y7TUQ,
	sbkim73-Sze3O3UU22JBDgjK7y7TUQ,
	broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E,
	vinod.koul-ral2JQCrhuEAvxtiuMwx3w

This patch modify the filter function to filter the required channel
based on new filter params.

Signed-off-by: Padmavathi Venna <padma.v-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
---
 drivers/dma/pl330.c |   15 ++++++---------
 1 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
index ddf4dd0..14d84a4 100644
--- a/drivers/dma/pl330.c
+++ b/drivers/dma/pl330.c
@@ -2392,15 +2392,12 @@ bool pl330_filter(struct dma_chan *chan, void *param)
 
 #ifdef CONFIG_OF
 	if (chan->device->dev->of_node) {
-		const __be32 *prop_value;
-		phandle phandle;
-		struct device_node *node;
-
-		prop_value = ((struct property *)param)->value;
-		phandle = be32_to_cpup(prop_value++);
-		node = of_find_node_by_phandle(phandle);
-		return ((chan->private == node) &&
-				(chan->chan_id == be32_to_cpup(prop_value)));
+		struct dma_pl330_filter_args *fargs = param;
+
+		if (chan->device != &fargs->pdmac->ddma)
+			return false;
+
+		return (chan->chan_id == fargs->chan_id);
 	}
 #endif
 
-- 
1.7.4.4

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH V2 4/4] DMA: PL330: Modify pl330 filter based on new generic dma dt bindings.
@ 2013-02-01 12:51     ` Padmavathi Venna
  0 siblings, 0 replies; 24+ messages in thread
From: Padmavathi Venna @ 2013-02-01 12:51 UTC (permalink / raw)
  To: linux-arm-kernel

This patch modify the filter function to filter the required channel
based on new filter params.

Signed-off-by: Padmavathi Venna <padma.v@samsung.com>
---
 drivers/dma/pl330.c |   15 ++++++---------
 1 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
index ddf4dd0..14d84a4 100644
--- a/drivers/dma/pl330.c
+++ b/drivers/dma/pl330.c
@@ -2392,15 +2392,12 @@ bool pl330_filter(struct dma_chan *chan, void *param)
 
 #ifdef CONFIG_OF
 	if (chan->device->dev->of_node) {
-		const __be32 *prop_value;
-		phandle phandle;
-		struct device_node *node;
-
-		prop_value = ((struct property *)param)->value;
-		phandle = be32_to_cpup(prop_value++);
-		node = of_find_node_by_phandle(phandle);
-		return ((chan->private == node) &&
-				(chan->chan_id == be32_to_cpup(prop_value)));
+		struct dma_pl330_filter_args *fargs = param;
+
+		if (chan->device != &fargs->pdmac->ddma)
+			return false;
+
+		return (chan->chan_id == fargs->chan_id);
 	}
 #endif
 
-- 
1.7.4.4

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* Re: [PATCH V2 1/4] DMA: PL330: Add xlate function
  2013-02-01 12:51   ` Padmavathi Venna
@ 2013-02-01 14:57     ` Arnd Bergmann
  -1 siblings, 0 replies; 24+ messages in thread
From: Arnd Bergmann @ 2013-02-01 14:57 UTC (permalink / raw)
  To: Padmavathi Venna
  Cc: linux-samsung-soc, devicetree-discuss, linux-arm-kernel,
	padma.kvr, sbkim73, broonie, kgene.kim, jassisinghbrar,
	vinod.koul, grant.likely, jon-hunter, boojin.kim, thomas.abraham

On Friday 01 February 2013, Padmavathi Venna wrote:
> 
> Add xlate to translate the device-tree binding information into
> the appropriate format. The filter function requires the dma
> controller device and dma channel number as filter_params.
> 
> Signed-off-by: Padmavathi Venna <padma.v@samsung.com>

Acked-by: Arnd Bergmann <arnd@arndb.de>

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH V2 1/4] DMA: PL330: Add xlate function
@ 2013-02-01 14:57     ` Arnd Bergmann
  0 siblings, 0 replies; 24+ messages in thread
From: Arnd Bergmann @ 2013-02-01 14:57 UTC (permalink / raw)
  To: linux-arm-kernel

On Friday 01 February 2013, Padmavathi Venna wrote:
> 
> Add xlate to translate the device-tree binding information into
> the appropriate format. The filter function requires the dma
> controller device and dma channel number as filter_params.
> 
> Signed-off-by: Padmavathi Venna <padma.v@samsung.com>

Acked-by: Arnd Bergmann <arnd@arndb.de>

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH V2 2/4] DMA: PL330: Register the DMA controller with the generic DMA helpers
  2013-02-01 12:51     ` Padmavathi Venna
@ 2013-02-01 14:58       ` Arnd Bergmann
  -1 siblings, 0 replies; 24+ messages in thread
From: Arnd Bergmann @ 2013-02-01 14:58 UTC (permalink / raw)
  To: Padmavathi Venna
  Cc: linux-samsung-soc, devicetree-discuss, linux-arm-kernel,
	padma.kvr, sbkim73, broonie, kgene.kim, jassisinghbrar,
	vinod.koul, grant.likely, jon-hunter, boojin.kim, thomas.abraham

On Friday 01 February 2013, Padmavathi Venna wrote:
> This patch registers the pl330 dma controller driver with the generic
> device tree dma helper functions.
> 
> Signed-off-by: Padmavathi Venna <padma.v@samsung.com>

Acked-by: Arnd Bergmann <arnd@arndb.de>

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH V2 2/4] DMA: PL330: Register the DMA controller with the generic DMA helpers
@ 2013-02-01 14:58       ` Arnd Bergmann
  0 siblings, 0 replies; 24+ messages in thread
From: Arnd Bergmann @ 2013-02-01 14:58 UTC (permalink / raw)
  To: linux-arm-kernel

On Friday 01 February 2013, Padmavathi Venna wrote:
> This patch registers the pl330 dma controller driver with the generic
> device tree dma helper functions.
> 
> Signed-off-by: Padmavathi Venna <padma.v@samsung.com>

Acked-by: Arnd Bergmann <arnd@arndb.de>

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH V2 3/4] ARM: dts: Add #dma-cells for generic dma binding support
  2013-02-01 12:51     ` Padmavathi Venna
@ 2013-02-01 15:16       ` Arnd Bergmann
  -1 siblings, 0 replies; 24+ messages in thread
From: Arnd Bergmann @ 2013-02-01 15:16 UTC (permalink / raw)
  To: Padmavathi Venna
  Cc: linux-samsung-soc, devicetree-discuss, linux-arm-kernel,
	padma.kvr, sbkim73, broonie, kgene.kim, jassisinghbrar,
	vinod.koul, grant.likely, jon-hunter, boojin.kim, thomas.abraham

On Friday 01 February 2013, Padmavathi Venna wrote:
> 
> This patch adds #dma-cells property to PL330 DMA controller
> nodes for supporting generic dma dt bindings on samsung
> exynos5250 platform.
> 
> Signed-off-by: Padmavathi Venna <padma.v@samsung.com>

The generic binding also lists the dma-channels and dma-requests
properties. Those are currently not required by the code, but I think
it would be good to list them anyway, to be future-proof in case
we ever need them.

Otherwise

Acked-by: Arnd Bergmann <arnd@arndb.de>

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH V2 3/4] ARM: dts: Add #dma-cells for generic dma binding support
@ 2013-02-01 15:16       ` Arnd Bergmann
  0 siblings, 0 replies; 24+ messages in thread
From: Arnd Bergmann @ 2013-02-01 15:16 UTC (permalink / raw)
  To: linux-arm-kernel

On Friday 01 February 2013, Padmavathi Venna wrote:
> 
> This patch adds #dma-cells property to PL330 DMA controller
> nodes for supporting generic dma dt bindings on samsung
> exynos5250 platform.
> 
> Signed-off-by: Padmavathi Venna <padma.v@samsung.com>

The generic binding also lists the dma-channels and dma-requests
properties. Those are currently not required by the code, but I think
it would be good to list them anyway, to be future-proof in case
we ever need them.

Otherwise

Acked-by: Arnd Bergmann <arnd@arndb.de>

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH V2 4/4] DMA: PL330: Modify pl330 filter based on new generic dma dt bindings.
  2013-02-01 12:51     ` Padmavathi Venna
@ 2013-02-01 15:23       ` Arnd Bergmann
  -1 siblings, 0 replies; 24+ messages in thread
From: Arnd Bergmann @ 2013-02-01 15:23 UTC (permalink / raw)
  To: Padmavathi Venna
  Cc: linux-samsung-soc, devicetree-discuss, linux-arm-kernel,
	padma.kvr, sbkim73, broonie, kgene.kim, jassisinghbrar,
	vinod.koul, grant.likely, jon-hunter, boojin.kim, thomas.abraham

On Friday 01 February 2013, Padmavathi Venna wrote:
> This patch modify the filter function to filter the required channel
> based on new filter params.
> 
> Signed-off-by: Padmavathi Venna <padma.v@samsung.com>

The result of this looks good, but I fear that changing the filter function
like this wil break all drivers that currently use the plat-samsung/dma-ops.c
code. For migration purposes, I think the best way is to change
samsung_dmadev_request() to match the new filter_param format.

After that is done, you can migrate all the drivers using samsung_dma_get_ops
over to the new dma_request_slave_channel interface without breaking
anything when only part of the series is applied.

	Arnd

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH V2 4/4] DMA: PL330: Modify pl330 filter based on new generic dma dt bindings.
@ 2013-02-01 15:23       ` Arnd Bergmann
  0 siblings, 0 replies; 24+ messages in thread
From: Arnd Bergmann @ 2013-02-01 15:23 UTC (permalink / raw)
  To: linux-arm-kernel

On Friday 01 February 2013, Padmavathi Venna wrote:
> This patch modify the filter function to filter the required channel
> based on new filter params.
> 
> Signed-off-by: Padmavathi Venna <padma.v@samsung.com>

The result of this looks good, but I fear that changing the filter function
like this wil break all drivers that currently use the plat-samsung/dma-ops.c
code. For migration purposes, I think the best way is to change
samsung_dmadev_request() to match the new filter_param format.

After that is done, you can migrate all the drivers using samsung_dma_get_ops
over to the new dma_request_slave_channel interface without breaking
anything when only part of the series is applied.

	Arnd

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH V2 4/4] DMA: PL330: Modify pl330 filter based on new generic dma dt bindings.
  2013-02-01 15:23       ` Arnd Bergmann
@ 2013-02-02  2:30         ` Padma Venkat
  -1 siblings, 0 replies; 24+ messages in thread
From: Padma Venkat @ 2013-02-02  2:30 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Padmavathi Venna, linux-samsung-soc, devicetree-discuss,
	linux-arm-kernel, sbkim73, broonie, kgene.kim, jassisinghbrar,
	vinod.koul, grant.likely, jon-hunter, boojin.kim, thomas.abraham

Hi Arnd,

On Fri, Feb 1, 2013 at 8:53 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Friday 01 February 2013, Padmavathi Venna wrote:
>> This patch modify the filter function to filter the required channel
>> based on new filter params.
>>
>> Signed-off-by: Padmavathi Venna <padma.v@samsung.com>
>
> The result of this looks good, but I fear that changing the filter function
> like this wil break all drivers that currently use the plat-samsung/dma-ops.c
> code. For migration purposes, I think the best way is to change
> samsung_dmadev_request() to match the new filter_param format.
>
> After that is done, you can migrate all the drivers using samsung_dma_get_ops
> over to the new dma_request_slave_channel interface without breaking
> anything when only part of the series is applied.
>
>         Arnd

Please check the below link where I made the dma request compatible to
both DT and non-DT

http://git.kernel.org/?p=linux/kernel/git/broonie/sound.git;a=commit;h=e7ba5f1d0f6292e1b99c63cc4bb74c70232e9065
http://git.kernel.org/?p=linux/kernel/git/broonie/sound.git;a=commit;h=b5be04d35dbb2e00ab27a97bfd26e17019e857ef

Please let me know if any changes required.

Thanks for the suggestions.
Padma

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH V2 4/4] DMA: PL330: Modify pl330 filter based on new generic dma dt bindings.
@ 2013-02-02  2:30         ` Padma Venkat
  0 siblings, 0 replies; 24+ messages in thread
From: Padma Venkat @ 2013-02-02  2:30 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Arnd,

On Fri, Feb 1, 2013 at 8:53 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Friday 01 February 2013, Padmavathi Venna wrote:
>> This patch modify the filter function to filter the required channel
>> based on new filter params.
>>
>> Signed-off-by: Padmavathi Venna <padma.v@samsung.com>
>
> The result of this looks good, but I fear that changing the filter function
> like this wil break all drivers that currently use the plat-samsung/dma-ops.c
> code. For migration purposes, I think the best way is to change
> samsung_dmadev_request() to match the new filter_param format.
>
> After that is done, you can migrate all the drivers using samsung_dma_get_ops
> over to the new dma_request_slave_channel interface without breaking
> anything when only part of the series is applied.
>
>         Arnd

Please check the below link where I made the dma request compatible to
both DT and non-DT

http://git.kernel.org/?p=linux/kernel/git/broonie/sound.git;a=commit;h=e7ba5f1d0f6292e1b99c63cc4bb74c70232e9065
http://git.kernel.org/?p=linux/kernel/git/broonie/sound.git;a=commit;h=b5be04d35dbb2e00ab27a97bfd26e17019e857ef

Please let me know if any changes required.

Thanks for the suggestions.
Padma

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH V2 4/4] DMA: PL330: Modify pl330 filter based on new generic dma dt bindings.
  2013-02-02  2:30         ` Padma Venkat
@ 2013-02-02 15:09           ` Arnd Bergmann
  -1 siblings, 0 replies; 24+ messages in thread
From: Arnd Bergmann @ 2013-02-02 15:09 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Padma Venkat, boojin.kim, jassisinghbrar, linux-samsung-soc,
	Padmavathi Venna, sbkim73, devicetree-discuss, broonie,
	grant.likely, vinod.koul, kgene.kim, thomas.abraham, jon-hunter

On Saturday 02 February 2013 08:00:54 Padma Venkat wrote:

> > The result of this looks good, but I fear that changing the filter function
> > like this wil break all drivers that currently use the plat-samsung/dma-ops.c
> > code. For migration purposes, I think the best way is to change
> > samsung_dmadev_request() to match the new filter_param format.
> >
> > After that is done, you can migrate all the drivers using samsung_dma_get_ops
> > over to the new dma_request_slave_channel interface without breaking
> > anything when only part of the series is applied.
> >
> >         Arnd
> 
> Please check the below link where I made the dma request compatible to
> both DT and non-DT
> 
> http://git.kernel.org/?p=linux/kernel/git/broonie/sound.git;a=commit;h=e7ba5f1d0f6292e1b99c63cc4bb74c70232e9065
> http://git.kernel.org/?p=linux/kernel/git/broonie/sound.git;a=commit;h=b5be04d35dbb2e00ab27a97bfd26e17019e857ef
> 
> Please let me know if any changes required.
> 

Those two changes by themselves still look ok, I think but you
still break the non-DT case in this 4/4 patch by changing the
pl330_filter function in an incompatible way. You will still
have to either change the filter_param argument in the
samsung_dmadev_request() function, or provide separate filter
functions, one to be used by samsung_dmadev_request and
one for the pl330_xlate function.

In the long run, I think it would be better to move the slave
drivers away from the samsung_dma wrappers and use
dma_request_slave_channel directly, but that is an independent
discussion.

	Arnd

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH V2 4/4] DMA: PL330: Modify pl330 filter based on new generic dma dt bindings.
@ 2013-02-02 15:09           ` Arnd Bergmann
  0 siblings, 0 replies; 24+ messages in thread
From: Arnd Bergmann @ 2013-02-02 15:09 UTC (permalink / raw)
  To: linux-arm-kernel

On Saturday 02 February 2013 08:00:54 Padma Venkat wrote:

> > The result of this looks good, but I fear that changing the filter function
> > like this wil break all drivers that currently use the plat-samsung/dma-ops.c
> > code. For migration purposes, I think the best way is to change
> > samsung_dmadev_request() to match the new filter_param format.
> >
> > After that is done, you can migrate all the drivers using samsung_dma_get_ops
> > over to the new dma_request_slave_channel interface without breaking
> > anything when only part of the series is applied.
> >
> >         Arnd
> 
> Please check the below link where I made the dma request compatible to
> both DT and non-DT
> 
> http://git.kernel.org/?p=linux/kernel/git/broonie/sound.git;a=commit;h=e7ba5f1d0f6292e1b99c63cc4bb74c70232e9065
> http://git.kernel.org/?p=linux/kernel/git/broonie/sound.git;a=commit;h=b5be04d35dbb2e00ab27a97bfd26e17019e857ef
> 
> Please let me know if any changes required.
> 

Those two changes by themselves still look ok, I think but you
still break the non-DT case in this 4/4 patch by changing the
pl330_filter function in an incompatible way. You will still
have to either change the filter_param argument in the
samsung_dmadev_request() function, or provide separate filter
functions, one to be used by samsung_dmadev_request and
one for the pl330_xlate function.

In the long run, I think it would be better to move the slave
drivers away from the samsung_dma wrappers and use
dma_request_slave_channel directly, but that is an independent
discussion.

	Arnd

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH V2 4/4] DMA: PL330: Modify pl330 filter based on new generic dma dt bindings.
  2013-02-02 15:09           ` Arnd Bergmann
@ 2013-02-04  5:21             ` Padma Venkat
  -1 siblings, 0 replies; 24+ messages in thread
From: Padma Venkat @ 2013-02-04  5:21 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: linux-arm-kernel, boojin.kim, jassisinghbrar, linux-samsung-soc,
	Padmavathi Venna, sbkim73, devicetree-discuss, broonie,
	grant.likely, vinod.koul, kgene.kim, thomas.abraham, jon-hunter

On Sat, Feb 2, 2013 at 8:39 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Saturday 02 February 2013 08:00:54 Padma Venkat wrote:
>
>> > The result of this looks good, but I fear that changing the filter function
>> > like this wil break all drivers that currently use the plat-samsung/dma-ops.c
>> > code. For migration purposes, I think the best way is to change
>> > samsung_dmadev_request() to match the new filter_param format.
>> >
>> > After that is done, you can migrate all the drivers using samsung_dma_get_ops
>> > over to the new dma_request_slave_channel interface without breaking
>> > anything when only part of the series is applied.
>> >
>> >         Arnd
>>
>> Please check the below link where I made the dma request compatible to
>> both DT and non-DT
>>
>> http://git.kernel.org/?p=linux/kernel/git/broonie/sound.git;a=commit;h=e7ba5f1d0f6292e1b99c63cc4bb74c70232e9065
>> http://git.kernel.org/?p=linux/kernel/git/broonie/sound.git;a=commit;h=b5be04d35dbb2e00ab27a97bfd26e17019e857ef
>>
>> Please let me know if any changes required.
>>
>
> Those two changes by themselves still look ok, I think but you
> still break the non-DT case in this 4/4 patch by changing the
> pl330_filter function in an incompatible way. You will still
> have to either change the filter_param argument in the
> samsung_dmadev_request() function, or provide separate filter
> functions, one to be used by samsung_dmadev_request and
> one for the pl330_xlate function.

I missed out to delete this part. Thanks for your point. I will send
another patch.

>
> In the long run, I think it would be better to move the slave
> drivers away from the samsung_dma wrappers and use
> dma_request_slave_channel directly, but that is an independent
> discussion.
>
>         Arnd

Regards
Padma

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH V2 4/4] DMA: PL330: Modify pl330 filter based on new generic dma dt bindings.
@ 2013-02-04  5:21             ` Padma Venkat
  0 siblings, 0 replies; 24+ messages in thread
From: Padma Venkat @ 2013-02-04  5:21 UTC (permalink / raw)
  To: linux-arm-kernel

On Sat, Feb 2, 2013 at 8:39 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Saturday 02 February 2013 08:00:54 Padma Venkat wrote:
>
>> > The result of this looks good, but I fear that changing the filter function
>> > like this wil break all drivers that currently use the plat-samsung/dma-ops.c
>> > code. For migration purposes, I think the best way is to change
>> > samsung_dmadev_request() to match the new filter_param format.
>> >
>> > After that is done, you can migrate all the drivers using samsung_dma_get_ops
>> > over to the new dma_request_slave_channel interface without breaking
>> > anything when only part of the series is applied.
>> >
>> >         Arnd
>>
>> Please check the below link where I made the dma request compatible to
>> both DT and non-DT
>>
>> http://git.kernel.org/?p=linux/kernel/git/broonie/sound.git;a=commit;h=e7ba5f1d0f6292e1b99c63cc4bb74c70232e9065
>> http://git.kernel.org/?p=linux/kernel/git/broonie/sound.git;a=commit;h=b5be04d35dbb2e00ab27a97bfd26e17019e857ef
>>
>> Please let me know if any changes required.
>>
>
> Those two changes by themselves still look ok, I think but you
> still break the non-DT case in this 4/4 patch by changing the
> pl330_filter function in an incompatible way. You will still
> have to either change the filter_param argument in the
> samsung_dmadev_request() function, or provide separate filter
> functions, one to be used by samsung_dmadev_request and
> one for the pl330_xlate function.

I missed out to delete this part. Thanks for your point. I will send
another patch.

>
> In the long run, I think it would be better to move the slave
> drivers away from the samsung_dma wrappers and use
> dma_request_slave_channel directly, but that is an independent
> discussion.
>
>         Arnd

Regards
Padma

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2013-02-04  5:21 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-01 12:51 [PATCH V2 0/4] Add generic DMA DT binding support Padmavathi Venna
2013-02-01 12:51 ` Padmavathi Venna
2013-02-01 12:51 ` [PATCH V2 1/4] DMA: PL330: Add xlate function Padmavathi Venna
2013-02-01 12:51   ` Padmavathi Venna
2013-02-01 14:57   ` Arnd Bergmann
2013-02-01 14:57     ` Arnd Bergmann
     [not found] ` <1359723116-18173-1-git-send-email-padma.v-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2013-02-01 12:51   ` [PATCH V2 2/4] DMA: PL330: Register the DMA controller with the generic DMA helpers Padmavathi Venna
2013-02-01 12:51     ` Padmavathi Venna
2013-02-01 14:58     ` Arnd Bergmann
2013-02-01 14:58       ` Arnd Bergmann
2013-02-01 12:51   ` [PATCH V2 3/4] ARM: dts: Add #dma-cells for generic dma binding support Padmavathi Venna
2013-02-01 12:51     ` Padmavathi Venna
2013-02-01 15:16     ` Arnd Bergmann
2013-02-01 15:16       ` Arnd Bergmann
2013-02-01 12:51   ` [PATCH V2 4/4] DMA: PL330: Modify pl330 filter based on new generic dma dt bindings Padmavathi Venna
2013-02-01 12:51     ` Padmavathi Venna
2013-02-01 15:23     ` Arnd Bergmann
2013-02-01 15:23       ` Arnd Bergmann
2013-02-02  2:30       ` Padma Venkat
2013-02-02  2:30         ` Padma Venkat
2013-02-02 15:09         ` Arnd Bergmann
2013-02-02 15:09           ` Arnd Bergmann
2013-02-04  5:21           ` Padma Venkat
2013-02-04  5:21             ` Padma Venkat

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.