devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dmaengine: xgene-dma: Add ACPI support for X-Gene DMA engine driver
@ 2015-07-21 13:14 Rameshwar Prasad Sahu
  2015-07-28 10:03 ` Rameshwar Sahu
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Rameshwar Prasad Sahu @ 2015-07-21 13:14 UTC (permalink / raw)
  To: vinod.koul-ral2JQCrhuEAvxtiuMwx3w,
	dan.j.williams-ral2JQCrhuEAvxtiuMwx3w
  Cc: dmaengine-u79uwXL29TY76Z2rM5mHXA, arnd-r2nGTMty4D4,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	jcm-H+wXaHxf7aLQT0dZR+AlfA, patches-qTEPVZfXA3Y,
	Rameshwar Prasad Sahu

This patch adds ACPI support for the APM X-Gene DMA engine driver.

Signed-off-by: Rameshwar Prasad Sahu <rsahu-qTEPVZfXA3Y@public.gmane.org>
---
 drivers/dma/xgene-dma.c | 28 +++++++++++++++++++++-------
 1 file changed, 21 insertions(+), 7 deletions(-)

diff --git a/drivers/dma/xgene-dma.c b/drivers/dma/xgene-dma.c
index dff22ab..d0a148d 100644
--- a/drivers/dma/xgene-dma.c
+++ b/drivers/dma/xgene-dma.c
@@ -21,6 +21,7 @@
  * NOTE: PM support is currently not available.
  */

+#include <linux/acpi.h>
 #include <linux/clk.h>
 #include <linux/delay.h>
 #include <linux/dma-mapping.h>
@@ -1944,16 +1945,18 @@ static int xgene_dma_probe(struct platform_device *pdev)
 		return ret;

 	pdma->clk = devm_clk_get(&pdev->dev, NULL);
-	if (IS_ERR(pdma->clk)) {
+	if (IS_ERR(pdma->clk) && !ACPI_COMPANION(&pdev->dev)) {
 		dev_err(&pdev->dev, "Failed to get clk\n");
 		return PTR_ERR(pdma->clk);
 	}

 	/* Enable clk before accessing registers */
-	ret = clk_prepare_enable(pdma->clk);
-	if (ret) {
-		dev_err(&pdev->dev, "Failed to enable clk %d\n", ret);
-		return ret;
+	if (!IS_ERR(pdma->clk)) {
+		ret = clk_prepare_enable(pdma->clk);
+		if (ret) {
+			dev_err(&pdev->dev, "Failed to enable clk %d\n", ret);
+			return ret;
+		}
 	}

 	/* Remove DMA RAM out of shutdown */
@@ -1998,7 +2001,8 @@ err_request_irq:

 err_dma_mask:
 err_clk_enable:
-	clk_disable_unprepare(pdma->clk);
+	if (!IS_ERR(pdma->clk))
+		clk_disable_unprepare(pdma->clk);

 	return ret;
 }
@@ -2022,11 +2026,20 @@ static int xgene_dma_remove(struct platform_device *pdev)
 		xgene_dma_delete_chan_rings(chan);
 	}

-	clk_disable_unprepare(pdma->clk);
+	if (!IS_ERR(pdma->clk))
+		clk_disable_unprepare(pdma->clk);

 	return 0;
 }

+#ifdef CONFIG_ACPI
+static const struct acpi_device_id xgene_dma_acpi_match_ptr[] = {
+	{"APMC0D43", 0},
+	{},
+};
+MODULE_DEVICE_TABLE(acpi, xgene_dma_acpi_match_ptr);
+#endif
+
 static const struct of_device_id xgene_dma_of_match_ptr[] = {
 	{.compatible = "apm,xgene-storm-dma",},
 	{},
@@ -2039,6 +2052,7 @@ static struct platform_driver xgene_dma_driver = {
 	.driver = {
 		.name = "X-Gene-DMA",
 		.of_match_table = xgene_dma_of_match_ptr,
+		.acpi_match_table = ACPI_PTR(xgene_dma_acpi_match_ptr),
 	},
 };

--
1.8.2.1
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] dmaengine: xgene-dma: Add ACPI support for X-Gene DMA engine driver
  2015-07-21 13:14 [PATCH] dmaengine: xgene-dma: Add ACPI support for X-Gene DMA engine driver Rameshwar Prasad Sahu
@ 2015-07-28 10:03 ` Rameshwar Sahu
  2015-07-29 14:34 ` Arnd Bergmann
       [not found] ` <1437484479-2822-1-git-send-email-rsahu-qTEPVZfXA3Y@public.gmane.org>
  2 siblings, 0 replies; 7+ messages in thread
From: Rameshwar Sahu @ 2015-07-28 10:03 UTC (permalink / raw)
  To: Vinod Koul, dan.j.williams
  Cc: dmaengine, Arnd Bergmann, linux-kernel, devicetree,
	linux-arm-kernel, jcm, patches, Rameshwar Prasad Sahu

Hi Vinod,

On Tue, Jul 21, 2015 at 6:44 PM, Rameshwar Prasad Sahu <rsahu@apm.com> wrote:
> This patch adds ACPI support for the APM X-Gene DMA engine driver.
>
> Signed-off-by: Rameshwar Prasad Sahu <rsahu@apm.com>
> ---
>  drivers/dma/xgene-dma.c | 28 +++++++++++++++++++++-------
>  1 file changed, 21 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/dma/xgene-dma.c b/drivers/dma/xgene-dma.c
> index dff22ab..d0a148d 100644
> --- a/drivers/dma/xgene-dma.c
> +++ b/drivers/dma/xgene-dma.c
> @@ -21,6 +21,7 @@
>   * NOTE: PM support is currently not available.
>   */
>
> +#include <linux/acpi.h>
>  #include <linux/clk.h>
>  #include <linux/delay.h>
>  #include <linux/dma-mapping.h>
> @@ -1944,16 +1945,18 @@ static int xgene_dma_probe(struct platform_device *pdev)
>                 return ret;
>
>         pdma->clk = devm_clk_get(&pdev->dev, NULL);
> -       if (IS_ERR(pdma->clk)) {
> +       if (IS_ERR(pdma->clk) && !ACPI_COMPANION(&pdev->dev)) {
>                 dev_err(&pdev->dev, "Failed to get clk\n");
>                 return PTR_ERR(pdma->clk);
>         }
>
>         /* Enable clk before accessing registers */
> -       ret = clk_prepare_enable(pdma->clk);
> -       if (ret) {
> -               dev_err(&pdev->dev, "Failed to enable clk %d\n", ret);
> -               return ret;
> +       if (!IS_ERR(pdma->clk)) {
> +               ret = clk_prepare_enable(pdma->clk);
> +               if (ret) {
> +                       dev_err(&pdev->dev, "Failed to enable clk %d\n", ret);
> +                       return ret;
> +               }
>         }
>
>         /* Remove DMA RAM out of shutdown */
> @@ -1998,7 +2001,8 @@ err_request_irq:
>
>  err_dma_mask:
>  err_clk_enable:
> -       clk_disable_unprepare(pdma->clk);
> +       if (!IS_ERR(pdma->clk))
> +               clk_disable_unprepare(pdma->clk);
>
>         return ret;
>  }
> @@ -2022,11 +2026,20 @@ static int xgene_dma_remove(struct platform_device *pdev)
>                 xgene_dma_delete_chan_rings(chan);
>         }
>
> -       clk_disable_unprepare(pdma->clk);
> +       if (!IS_ERR(pdma->clk))
> +               clk_disable_unprepare(pdma->clk);
>
>         return 0;
>  }
>
> +#ifdef CONFIG_ACPI
> +static const struct acpi_device_id xgene_dma_acpi_match_ptr[] = {
> +       {"APMC0D43", 0},
> +       {},
> +};
> +MODULE_DEVICE_TABLE(acpi, xgene_dma_acpi_match_ptr);
> +#endif
> +
>  static const struct of_device_id xgene_dma_of_match_ptr[] = {
>         {.compatible = "apm,xgene-storm-dma",},
>         {},
> @@ -2039,6 +2052,7 @@ static struct platform_driver xgene_dma_driver = {
>         .driver = {
>                 .name = "X-Gene-DMA",
>                 .of_match_table = xgene_dma_of_match_ptr,
> +               .acpi_match_table = ACPI_PTR(xgene_dma_acpi_match_ptr),
>         },
>  };
>
> --
> 1.8.2.1

Any comment here ??

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

* Re: [PATCH] dmaengine: xgene-dma: Add ACPI support for X-Gene DMA engine driver
  2015-07-21 13:14 [PATCH] dmaengine: xgene-dma: Add ACPI support for X-Gene DMA engine driver Rameshwar Prasad Sahu
  2015-07-28 10:03 ` Rameshwar Sahu
@ 2015-07-29 14:34 ` Arnd Bergmann
  2015-07-30  8:51   ` Rameshwar Sahu
       [not found] ` <1437484479-2822-1-git-send-email-rsahu-qTEPVZfXA3Y@public.gmane.org>
  2 siblings, 1 reply; 7+ messages in thread
From: Arnd Bergmann @ 2015-07-29 14:34 UTC (permalink / raw)
  To: Rameshwar Prasad Sahu
  Cc: vinod.koul, dan.j.williams, dmaengine, linux-kernel, devicetree,
	linux-arm-kernel, jcm, patches

On Tuesday 21 July 2015 18:44:39 Rameshwar Prasad Sahu wrote:
> This patch adds ACPI support for the APM X-Gene DMA engine driver.
> 
> Signed-off-by: Rameshwar Prasad Sahu <rsahu@apm.com>
> 

How does a slave driver refer to a channel in case of ACPI?

	Arnd

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

* Re: [PATCH] dmaengine: xgene-dma: Add ACPI support for X-Gene DMA engine driver
  2015-07-29 14:34 ` Arnd Bergmann
@ 2015-07-30  8:51   ` Rameshwar Sahu
  2015-08-01 21:28     ` Arnd Bergmann
  0 siblings, 1 reply; 7+ messages in thread
From: Rameshwar Sahu @ 2015-07-30  8:51 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Vinod Koul, dan.j.williams-ral2JQCrhuEAvxtiuMwx3w,
	dmaengine-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	jcm-H+wXaHxf7aLQT0dZR+AlfA, patches-qTEPVZfXA3Y

Hi Arnd,

On Wed, Jul 29, 2015 at 8:04 PM, Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org> wrote:
> On Tuesday 21 July 2015 18:44:39 Rameshwar Prasad Sahu wrote:
>> This patch adds ACPI support for the APM X-Gene DMA engine driver.
>>
>> Signed-off-by: Rameshwar Prasad Sahu <rsahu-qTEPVZfXA3Y@public.gmane.org>
>>
>
> How does a slave driver refer to a channel in case of ACPI?

We don't support slave dma here. This driver supports only memcp, xor,
pq, scatter-gather offloading, so,
client driver can use linux dmaengine APIs like dma_request_channel()
etc to request channel.


>
>         Arnd
> --
> To unsubscribe from this list: send the line "unsubscribe dmaengine" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] dmaengine: xgene-dma: Add ACPI support for X-Gene DMA engine driver
  2015-07-30  8:51   ` Rameshwar Sahu
@ 2015-08-01 21:28     ` Arnd Bergmann
  0 siblings, 0 replies; 7+ messages in thread
From: Arnd Bergmann @ 2015-08-01 21:28 UTC (permalink / raw)
  To: Rameshwar Sahu
  Cc: Vinod Koul, dan.j.williams, dmaengine, linux-kernel, devicetree,
	linux-arm-kernel, jcm, patches

On Thursday 30 July 2015 14:21:07 Rameshwar Sahu wrote:
> Hi Arnd,
> 
> On Wed, Jul 29, 2015 at 8:04 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> > On Tuesday 21 July 2015 18:44:39 Rameshwar Prasad Sahu wrote:
> >> This patch adds ACPI support for the APM X-Gene DMA engine driver.
> >>
> >> Signed-off-by: Rameshwar Prasad Sahu <rsahu@apm.com>
> >>
> >
> > How does a slave driver refer to a channel in case of ACPI?
> 
> We don't support slave dma here. This driver supports only memcp, xor,
> pq, scatter-gather offloading, so,
> client driver can use linux dmaengine APIs like dma_request_channel()
> etc to request channel.

Ok, makes sense. Thanks!

	Arnd

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

* Re: [PATCH] dmaengine: xgene-dma: Add ACPI support for X-Gene DMA engine driver
       [not found] ` <1437484479-2822-1-git-send-email-rsahu-qTEPVZfXA3Y@public.gmane.org>
@ 2015-08-13  7:18   ` Rameshwar Sahu
  2015-08-20  6:27   ` Vinod Koul
  1 sibling, 0 replies; 7+ messages in thread
From: Rameshwar Sahu @ 2015-08-13  7:18 UTC (permalink / raw)
  To: Vinod Koul, dan.j.williams-ral2JQCrhuEAvxtiuMwx3w
  Cc: dmaengine-u79uwXL29TY76Z2rM5mHXA, Arnd Bergmann,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	jcm-H+wXaHxf7aLQT0dZR+AlfA, patches-qTEPVZfXA3Y,
	Rameshwar Prasad Sahu

Hi Vinod,

On Tue, Jul 21, 2015 at 6:44 PM, Rameshwar Prasad Sahu <rsahu-qTEPVZfXA3Y@public.gmane.org> wrote:
> This patch adds ACPI support for the APM X-Gene DMA engine driver.
>
> Signed-off-by: Rameshwar Prasad Sahu <rsahu-qTEPVZfXA3Y@public.gmane.org>
> ---
>  drivers/dma/xgene-dma.c | 28 +++++++++++++++++++++-------
>  1 file changed, 21 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/dma/xgene-dma.c b/drivers/dma/xgene-dma.c
> index dff22ab..d0a148d 100644
> --- a/drivers/dma/xgene-dma.c
> +++ b/drivers/dma/xgene-dma.c
> @@ -21,6 +21,7 @@
>   * NOTE: PM support is currently not available.
>   */
>
> +#include <linux/acpi.h>
>  #include <linux/clk.h>
>  #include <linux/delay.h>
>  #include <linux/dma-mapping.h>
> @@ -1944,16 +1945,18 @@ static int xgene_dma_probe(struct platform_device *pdev)
>                 return ret;
>
>         pdma->clk = devm_clk_get(&pdev->dev, NULL);
> -       if (IS_ERR(pdma->clk)) {
> +       if (IS_ERR(pdma->clk) && !ACPI_COMPANION(&pdev->dev)) {
>                 dev_err(&pdev->dev, "Failed to get clk\n");
>                 return PTR_ERR(pdma->clk);
>         }
>
>         /* Enable clk before accessing registers */
> -       ret = clk_prepare_enable(pdma->clk);
> -       if (ret) {
> -               dev_err(&pdev->dev, "Failed to enable clk %d\n", ret);
> -               return ret;
> +       if (!IS_ERR(pdma->clk)) {
> +               ret = clk_prepare_enable(pdma->clk);
> +               if (ret) {
> +                       dev_err(&pdev->dev, "Failed to enable clk %d\n", ret);
> +                       return ret;
> +               }
>         }
>
>         /* Remove DMA RAM out of shutdown */
> @@ -1998,7 +2001,8 @@ err_request_irq:
>
>  err_dma_mask:
>  err_clk_enable:
> -       clk_disable_unprepare(pdma->clk);
> +       if (!IS_ERR(pdma->clk))
> +               clk_disable_unprepare(pdma->clk);
>
>         return ret;
>  }
> @@ -2022,11 +2026,20 @@ static int xgene_dma_remove(struct platform_device *pdev)
>                 xgene_dma_delete_chan_rings(chan);
>         }
>
> -       clk_disable_unprepare(pdma->clk);
> +       if (!IS_ERR(pdma->clk))
> +               clk_disable_unprepare(pdma->clk);
>
>         return 0;
>  }
>
> +#ifdef CONFIG_ACPI
> +static const struct acpi_device_id xgene_dma_acpi_match_ptr[] = {
> +       {"APMC0D43", 0},
> +       {},
> +};
> +MODULE_DEVICE_TABLE(acpi, xgene_dma_acpi_match_ptr);
> +#endif
> +
>  static const struct of_device_id xgene_dma_of_match_ptr[] = {
>         {.compatible = "apm,xgene-storm-dma",},
>         {},
> @@ -2039,6 +2052,7 @@ static struct platform_driver xgene_dma_driver = {
>         .driver = {
>                 .name = "X-Gene-DMA",
>                 .of_match_table = xgene_dma_of_match_ptr,
> +               .acpi_match_table = ACPI_PTR(xgene_dma_acpi_match_ptr),
>         },
>  };
>
> --
> 1.8.2.1


Any Comments on the above patch ??
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] dmaengine: xgene-dma: Add ACPI support for X-Gene DMA engine driver
       [not found] ` <1437484479-2822-1-git-send-email-rsahu-qTEPVZfXA3Y@public.gmane.org>
  2015-08-13  7:18   ` Rameshwar Sahu
@ 2015-08-20  6:27   ` Vinod Koul
  1 sibling, 0 replies; 7+ messages in thread
From: Vinod Koul @ 2015-08-20  6:27 UTC (permalink / raw)
  To: Rameshwar Prasad Sahu
  Cc: dan.j.williams-ral2JQCrhuEAvxtiuMwx3w,
	dmaengine-u79uwXL29TY76Z2rM5mHXA, arnd-r2nGTMty4D4,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	jcm-H+wXaHxf7aLQT0dZR+AlfA, patches-qTEPVZfXA3Y

On Tue, Jul 21, 2015 at 06:44:39PM +0530, Rameshwar Prasad Sahu wrote:
> This patch adds ACPI support for the APM X-Gene DMA engine driver.

Applied, thanks

-- 
~Vinod

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2015-08-20  6:27 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-21 13:14 [PATCH] dmaengine: xgene-dma: Add ACPI support for X-Gene DMA engine driver Rameshwar Prasad Sahu
2015-07-28 10:03 ` Rameshwar Sahu
2015-07-29 14:34 ` Arnd Bergmann
2015-07-30  8:51   ` Rameshwar Sahu
2015-08-01 21:28     ` Arnd Bergmann
     [not found] ` <1437484479-2822-1-git-send-email-rsahu-qTEPVZfXA3Y@public.gmane.org>
2015-08-13  7:18   ` Rameshwar Sahu
2015-08-20  6:27   ` 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).