linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/3] dmaengine/ARM: sprd: use proper 'dma-channels/requests' properties
@ 2022-05-03  6:51 Krzysztof Kozlowski
  2022-05-03  6:51 ` [PATCH v2 1/3] dt-bindings: dmaengine: sprd: deprecate '#dma-channels' Krzysztof Kozlowski
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Krzysztof Kozlowski @ 2022-05-03  6:51 UTC (permalink / raw)
  To: Vinod Koul, Rob Herring, Krzysztof Kozlowski, Orson Zhai,
	Baolin Wang, Chunyan Zhang, dmaengine, devicetree, linux-kernel
  Cc: Krzysztof Kozlowski

Hi,

The core DT schema defines generic 'dma-channels' and 'dma-requests'
properties, so in preparation to moving bindings to DT schema, convert
existing users of '#dma-channels' and '#dma-requests' to the generic
variant.

Not tested on hardware.

The patchset is bisectable - please pick up through independent trees.

Changes since v2
================
1. Keep old properties, so the patchset is bisectable.
2. Add review tags.

See also:
[1] https://lore.kernel.org/linux-devicetree/fedb56be-f275-aabb-cdf5-dbd394b8a7bd@linaro.org/T/#m6235f451045c337d70a62dc65eab9a716618550b

Best regards,
Krzysztof

Krzysztof Kozlowski (3):
  dt-bindings: dmaengine: sprd: deprecate '#dma-channels'
  dmaengine: sprd: deprecate '#dma-channels'
  arm64: dts: sprd: use new 'dma-channels' property

 Documentation/devicetree/bindings/dma/sprd-dma.txt | 7 +++++--
 arch/arm64/boot/dts/sprd/whale2.dtsi               | 4 ++++
 drivers/dma/sprd-dma.c                             | 6 +++++-
 3 files changed, 14 insertions(+), 3 deletions(-)

-- 
2.32.0


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

* [PATCH v2 1/3] dt-bindings: dmaengine: sprd: deprecate '#dma-channels'
  2022-05-03  6:51 [PATCH v2 0/3] dmaengine/ARM: sprd: use proper 'dma-channels/requests' properties Krzysztof Kozlowski
@ 2022-05-03  6:51 ` Krzysztof Kozlowski
  2022-05-03  6:51 ` [PATCH v2 2/3] " Krzysztof Kozlowski
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Krzysztof Kozlowski @ 2022-05-03  6:51 UTC (permalink / raw)
  To: Vinod Koul, Rob Herring, Krzysztof Kozlowski, Orson Zhai,
	Baolin Wang, Chunyan Zhang, dmaengine, devicetree, linux-kernel
  Cc: Krzysztof Kozlowski, Rob Herring

The generic property, used in most of the drivers and defined in generic
dma-common DT bindings, is 'dma-channels'.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Rob Herring <robh@kernel.org>
---
 Documentation/devicetree/bindings/dma/sprd-dma.txt | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/dma/sprd-dma.txt b/Documentation/devicetree/bindings/dma/sprd-dma.txt
index adccea9941f1..c7e9b5fd50e7 100644
--- a/Documentation/devicetree/bindings/dma/sprd-dma.txt
+++ b/Documentation/devicetree/bindings/dma/sprd-dma.txt
@@ -8,10 +8,13 @@ Required properties:
 - interrupts: Should contain one interrupt shared by all channel.
 - #dma-cells: must be <1>. Used to represent the number of integer
 	cells in the dmas property of client device.
-- #dma-channels : Number of DMA channels supported. Should be 32.
+- dma-channels : Number of DMA channels supported. Should be 32.
 - clock-names: Should contain the clock of the DMA controller.
 - clocks: Should contain a clock specifier for each entry in clock-names.
 
+Deprecated properties:
+- #dma-channels : Number of DMA channels supported. Should be 32.
+
 Example:
 
 Controller:
@@ -20,7 +23,7 @@ apdma: dma-controller@20100000 {
 	reg = <0x20100000 0x4000>;
 	interrupts = <GIC_SPI 50 IRQ_TYPE_LEVEL_HIGH>;
 	#dma-cells = <1>;
-	#dma-channels = <32>;
+	dma-channels = <32>;
 	clock-names = "enable";
 	clocks = <&clk_ap_ahb_gates 5>;
 };
-- 
2.32.0


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

* [PATCH v2 2/3] dmaengine: sprd: deprecate '#dma-channels'
  2022-05-03  6:51 [PATCH v2 0/3] dmaengine/ARM: sprd: use proper 'dma-channels/requests' properties Krzysztof Kozlowski
  2022-05-03  6:51 ` [PATCH v2 1/3] dt-bindings: dmaengine: sprd: deprecate '#dma-channels' Krzysztof Kozlowski
@ 2022-05-03  6:51 ` Krzysztof Kozlowski
  2022-05-04  2:28   ` Baolin Wang
  2022-05-03  6:51 ` [PATCH v2 3/3] arm64: dts: sprd: use new 'dma-channels' property Krzysztof Kozlowski
  2022-05-16 13:05 ` [PATCH v2 0/3] dmaengine/ARM: sprd: use proper 'dma-channels/requests' properties Vinod Koul
  3 siblings, 1 reply; 7+ messages in thread
From: Krzysztof Kozlowski @ 2022-05-03  6:51 UTC (permalink / raw)
  To: Vinod Koul, Rob Herring, Krzysztof Kozlowski, Orson Zhai,
	Baolin Wang, Chunyan Zhang, dmaengine, devicetree, linux-kernel
  Cc: Krzysztof Kozlowski

The generic property, used in most of the drivers and defined in generic
dma-common DT bindings, is 'dma-channels'.  Switch to new property while
keeping backward compatibility.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 drivers/dma/sprd-dma.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/dma/sprd-dma.c b/drivers/dma/sprd-dma.c
index 7f158ef5672d..2138b80435ab 100644
--- a/drivers/dma/sprd-dma.c
+++ b/drivers/dma/sprd-dma.c
@@ -1117,7 +1117,11 @@ static int sprd_dma_probe(struct platform_device *pdev)
 	u32 chn_count;
 	int ret, i;
 
-	ret = device_property_read_u32(&pdev->dev, "#dma-channels", &chn_count);
+	/* Parse new and deprecated dma-channels properties */
+	ret = device_property_read_u32(&pdev->dev, "dma-channels", &chn_count);
+	if (ret)
+		ret = device_property_read_u32(&pdev->dev, "#dma-channels",
+					       &chn_count);
 	if (ret) {
 		dev_err(&pdev->dev, "get dma channels count failed\n");
 		return ret;
-- 
2.32.0


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

* [PATCH v2 3/3] arm64: dts: sprd: use new 'dma-channels' property
  2022-05-03  6:51 [PATCH v2 0/3] dmaengine/ARM: sprd: use proper 'dma-channels/requests' properties Krzysztof Kozlowski
  2022-05-03  6:51 ` [PATCH v2 1/3] dt-bindings: dmaengine: sprd: deprecate '#dma-channels' Krzysztof Kozlowski
  2022-05-03  6:51 ` [PATCH v2 2/3] " Krzysztof Kozlowski
@ 2022-05-03  6:51 ` Krzysztof Kozlowski
  2022-05-04  2:29   ` Baolin Wang
  2022-05-16 13:05 ` [PATCH v2 0/3] dmaengine/ARM: sprd: use proper 'dma-channels/requests' properties Vinod Koul
  3 siblings, 1 reply; 7+ messages in thread
From: Krzysztof Kozlowski @ 2022-05-03  6:51 UTC (permalink / raw)
  To: Vinod Koul, Rob Herring, Krzysztof Kozlowski, Orson Zhai,
	Baolin Wang, Chunyan Zhang, dmaengine, devicetree, linux-kernel
  Cc: Krzysztof Kozlowski

The '#dma-channels' property was deprecated in favor of one defined by
generic dma-common DT bindings.  Add new property while keeping old one
for backwards compatibility.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 arch/arm64/boot/dts/sprd/whale2.dtsi | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm64/boot/dts/sprd/whale2.dtsi b/arch/arm64/boot/dts/sprd/whale2.dtsi
index 79b9591c37aa..89d91abbd5d1 100644
--- a/arch/arm64/boot/dts/sprd/whale2.dtsi
+++ b/arch/arm64/boot/dts/sprd/whale2.dtsi
@@ -126,7 +126,9 @@ ap_dma: dma-controller@20100000 {
 				reg = <0 0x20100000 0 0x4000>;
 				interrupts = <GIC_SPI 42 IRQ_TYPE_LEVEL_HIGH>;
 				#dma-cells = <1>;
+				/* For backwards compatibility: */
 				#dma-channels = <32>;
+				dma-channels = <32>;
 				clock-names = "enable";
 				clocks = <&apahb_gate CLK_DMA_EB>;
 			};
@@ -272,7 +274,9 @@ agcp_dma: dma-controller@41580000 {
 				compatible = "sprd,sc9860-dma";
 				reg = <0 0x41580000 0 0x4000>;
 				#dma-cells = <1>;
+				/* For backwards compatibility: */
 				#dma-channels = <32>;
+				dma-channels = <32>;
 				clock-names = "enable", "ashb_eb";
 				clocks = <&agcp_gate CLK_AGCP_DMAAP_EB>,
 				       <&agcp_gate CLK_AGCP_AP_ASHB_EB>;
-- 
2.32.0


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

* Re: [PATCH v2 2/3] dmaengine: sprd: deprecate '#dma-channels'
  2022-05-03  6:51 ` [PATCH v2 2/3] " Krzysztof Kozlowski
@ 2022-05-04  2:28   ` Baolin Wang
  0 siblings, 0 replies; 7+ messages in thread
From: Baolin Wang @ 2022-05-04  2:28 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Vinod Koul, Rob Herring, Krzysztof Kozlowski, Orson Zhai,
	Chunyan Zhang, dmaengine, Devicetree List, LKML

On Tue, May 3, 2022 at 2:51 PM Krzysztof Kozlowski
<krzysztof.kozlowski@linaro.org> wrote:
>
> The generic property, used in most of the drivers and defined in generic
> dma-common DT bindings, is 'dma-channels'.  Switch to new property while
> keeping backward compatibility.
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Thanks.
Reviewed-by: Baolin Wang <baolin.wang7@gmail.com>

> ---
>  drivers/dma/sprd-dma.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/dma/sprd-dma.c b/drivers/dma/sprd-dma.c
> index 7f158ef5672d..2138b80435ab 100644
> --- a/drivers/dma/sprd-dma.c
> +++ b/drivers/dma/sprd-dma.c
> @@ -1117,7 +1117,11 @@ static int sprd_dma_probe(struct platform_device *pdev)
>         u32 chn_count;
>         int ret, i;
>
> -       ret = device_property_read_u32(&pdev->dev, "#dma-channels", &chn_count);
> +       /* Parse new and deprecated dma-channels properties */
> +       ret = device_property_read_u32(&pdev->dev, "dma-channels", &chn_count);
> +       if (ret)
> +               ret = device_property_read_u32(&pdev->dev, "#dma-channels",
> +                                              &chn_count);
>         if (ret) {
>                 dev_err(&pdev->dev, "get dma channels count failed\n");
>                 return ret;
> --
> 2.32.0
>


-- 
Baolin Wang

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

* Re: [PATCH v2 3/3] arm64: dts: sprd: use new 'dma-channels' property
  2022-05-03  6:51 ` [PATCH v2 3/3] arm64: dts: sprd: use new 'dma-channels' property Krzysztof Kozlowski
@ 2022-05-04  2:29   ` Baolin Wang
  0 siblings, 0 replies; 7+ messages in thread
From: Baolin Wang @ 2022-05-04  2:29 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Vinod Koul, Rob Herring, Krzysztof Kozlowski, Orson Zhai,
	Chunyan Zhang, dmaengine, Devicetree List, LKML

On Tue, May 3, 2022 at 2:51 PM Krzysztof Kozlowski
<krzysztof.kozlowski@linaro.org> wrote:
>
> The '#dma-channels' property was deprecated in favor of one defined by
> generic dma-common DT bindings.  Add new property while keeping old one
> for backwards compatibility.
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Thanks.
Reviewed-by: Baolin Wang <baolin.wang7@gmail.com>

> ---
>  arch/arm64/boot/dts/sprd/whale2.dtsi | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/sprd/whale2.dtsi b/arch/arm64/boot/dts/sprd/whale2.dtsi
> index 79b9591c37aa..89d91abbd5d1 100644
> --- a/arch/arm64/boot/dts/sprd/whale2.dtsi
> +++ b/arch/arm64/boot/dts/sprd/whale2.dtsi
> @@ -126,7 +126,9 @@ ap_dma: dma-controller@20100000 {
>                                 reg = <0 0x20100000 0 0x4000>;
>                                 interrupts = <GIC_SPI 42 IRQ_TYPE_LEVEL_HIGH>;
>                                 #dma-cells = <1>;
> +                               /* For backwards compatibility: */
>                                 #dma-channels = <32>;
> +                               dma-channels = <32>;
>                                 clock-names = "enable";
>                                 clocks = <&apahb_gate CLK_DMA_EB>;
>                         };
> @@ -272,7 +274,9 @@ agcp_dma: dma-controller@41580000 {
>                                 compatible = "sprd,sc9860-dma";
>                                 reg = <0 0x41580000 0 0x4000>;
>                                 #dma-cells = <1>;
> +                               /* For backwards compatibility: */
>                                 #dma-channels = <32>;
> +                               dma-channels = <32>;
>                                 clock-names = "enable", "ashb_eb";
>                                 clocks = <&agcp_gate CLK_AGCP_DMAAP_EB>,
>                                        <&agcp_gate CLK_AGCP_AP_ASHB_EB>;
> --
> 2.32.0
>


-- 
Baolin Wang

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

* Re: [PATCH v2 0/3] dmaengine/ARM: sprd: use proper 'dma-channels/requests' properties
  2022-05-03  6:51 [PATCH v2 0/3] dmaengine/ARM: sprd: use proper 'dma-channels/requests' properties Krzysztof Kozlowski
                   ` (2 preceding siblings ...)
  2022-05-03  6:51 ` [PATCH v2 3/3] arm64: dts: sprd: use new 'dma-channels' property Krzysztof Kozlowski
@ 2022-05-16 13:05 ` Vinod Koul
  3 siblings, 0 replies; 7+ messages in thread
From: Vinod Koul @ 2022-05-16 13:05 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Rob Herring, Krzysztof Kozlowski, Orson Zhai, Baolin Wang,
	Chunyan Zhang, dmaengine, devicetree, linux-kernel

On 03-05-22, 08:51, Krzysztof Kozlowski wrote:
> Hi,
> 
> The core DT schema defines generic 'dma-channels' and 'dma-requests'
> properties, so in preparation to moving bindings to DT schema, convert
> existing users of '#dma-channels' and '#dma-requests' to the generic
> variant.

Applied 1-2 to dmaengine tree, thanks

> 
> Not tested on hardware.
> 
> The patchset is bisectable - please pick up through independent trees.
> 
> Changes since v2
> ================
> 1. Keep old properties, so the patchset is bisectable.
> 2. Add review tags.
> 
> See also:
> [1] https://lore.kernel.org/linux-devicetree/fedb56be-f275-aabb-cdf5-dbd394b8a7bd@linaro.org/T/#m6235f451045c337d70a62dc65eab9a716618550b
> 
> Best regards,
> Krzysztof
> 
> Krzysztof Kozlowski (3):
>   dt-bindings: dmaengine: sprd: deprecate '#dma-channels'
>   dmaengine: sprd: deprecate '#dma-channels'
>   arm64: dts: sprd: use new 'dma-channels' property
> 
>  Documentation/devicetree/bindings/dma/sprd-dma.txt | 7 +++++--
>  arch/arm64/boot/dts/sprd/whale2.dtsi               | 4 ++++
>  drivers/dma/sprd-dma.c                             | 6 +++++-
>  3 files changed, 14 insertions(+), 3 deletions(-)
> 
> -- 
> 2.32.0

-- 
~Vinod

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

end of thread, other threads:[~2022-05-16 13:05 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-03  6:51 [PATCH v2 0/3] dmaengine/ARM: sprd: use proper 'dma-channels/requests' properties Krzysztof Kozlowski
2022-05-03  6:51 ` [PATCH v2 1/3] dt-bindings: dmaengine: sprd: deprecate '#dma-channels' Krzysztof Kozlowski
2022-05-03  6:51 ` [PATCH v2 2/3] " Krzysztof Kozlowski
2022-05-04  2:28   ` Baolin Wang
2022-05-03  6:51 ` [PATCH v2 3/3] arm64: dts: sprd: use new 'dma-channels' property Krzysztof Kozlowski
2022-05-04  2:29   ` Baolin Wang
2022-05-16 13:05 ` [PATCH v2 0/3] dmaengine/ARM: sprd: use proper 'dma-channels/requests' properties Vinod Koul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).