Loading drivers/dma/xgene-dma.c +21 −7 Original line number Diff line number Diff line Loading @@ -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> Loading Loading @@ -1940,17 +1941,19 @@ 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 */ 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 */ ret = xgene_dma_init_mem(pdma); Loading Loading @@ -1994,6 +1997,7 @@ err_request_irq: err_dma_mask: err_clk_enable: if (!IS_ERR(pdma->clk)) clk_disable_unprepare(pdma->clk); return ret; Loading @@ -2018,11 +2022,20 @@ static int xgene_dma_remove(struct platform_device *pdev) xgene_dma_delete_chan_rings(chan); } 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",}, {}, Loading @@ -2035,6 +2048,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), }, }; Loading Loading
drivers/dma/xgene-dma.c +21 −7 Original line number Diff line number Diff line Loading @@ -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> Loading Loading @@ -1940,17 +1941,19 @@ 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 */ 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 */ ret = xgene_dma_init_mem(pdma); Loading Loading @@ -1994,6 +1997,7 @@ err_request_irq: err_dma_mask: err_clk_enable: if (!IS_ERR(pdma->clk)) clk_disable_unprepare(pdma->clk); return ret; Loading @@ -2018,11 +2022,20 @@ static int xgene_dma_remove(struct platform_device *pdev) xgene_dma_delete_chan_rings(chan); } 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",}, {}, Loading @@ -2035,6 +2048,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), }, }; Loading