Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933393AbbG1KDQ (ORCPT ); Tue, 28 Jul 2015 06:03:16 -0400 Received: from mail-ig0-f182.google.com ([209.85.213.182]:36079 "EHLO mail-ig0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755538AbbG1KDJ (ORCPT ); Tue, 28 Jul 2015 06:03:09 -0400 MIME-Version: 1.0 In-Reply-To: <1437484479-2822-1-git-send-email-rsahu@apm.com> References: <1437484479-2822-1-git-send-email-rsahu@apm.com> Date: Tue, 28 Jul 2015 15:33:08 +0530 Message-ID: Subject: Re: [PATCH] dmaengine: xgene-dma: Add ACPI support for X-Gene DMA engine driver From: Rameshwar Sahu To: Vinod Koul , dan.j.williams@intel.com Cc: dmaengine@vger.kernel.org, Arnd Bergmann , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, jcm@redhat.com, patches@apm.com, Rameshwar Prasad Sahu Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3086 Lines: 95 Hi Vinod, On Tue, Jul 21, 2015 at 6:44 PM, Rameshwar Prasad Sahu wrote: > This patch adds ACPI support for the APM X-Gene DMA engine driver. > > Signed-off-by: Rameshwar Prasad Sahu > --- > 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 > #include > #include > #include > @@ -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 ?? -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/