|
@@ -22,7 +22,6 @@
|
|
|
#include <linux/of_device.h>
|
|
#include <linux/of_device.h>
|
|
|
#include <linux/of_dma.h>
|
|
#include <linux/of_dma.h>
|
|
|
#include <linux/of_irq.h>
|
|
#include <linux/of_irq.h>
|
|
|
-#include <linux/pm_clock.h>
|
|
|
|
|
#include <linux/pm_runtime.h>
|
|
#include <linux/pm_runtime.h>
|
|
|
#include <linux/slab.h>
|
|
#include <linux/slab.h>
|
|
|
|
|
|
|
@@ -141,6 +140,7 @@ struct tegra_adma {
|
|
|
struct dma_device dma_dev;
|
|
struct dma_device dma_dev;
|
|
|
struct device *dev;
|
|
struct device *dev;
|
|
|
void __iomem *base_addr;
|
|
void __iomem *base_addr;
|
|
|
|
|
+ struct clk *ahub_clk;
|
|
|
unsigned int nr_channels;
|
|
unsigned int nr_channels;
|
|
|
unsigned long rx_requests_reserved;
|
|
unsigned long rx_requests_reserved;
|
|
|
unsigned long tx_requests_reserved;
|
|
unsigned long tx_requests_reserved;
|
|
@@ -637,8 +637,9 @@ static int tegra_adma_runtime_suspend(struct device *dev)
|
|
|
struct tegra_adma *tdma = dev_get_drvdata(dev);
|
|
struct tegra_adma *tdma = dev_get_drvdata(dev);
|
|
|
|
|
|
|
|
tdma->global_cmd = tdma_read(tdma, ADMA_GLOBAL_CMD);
|
|
tdma->global_cmd = tdma_read(tdma, ADMA_GLOBAL_CMD);
|
|
|
|
|
+ clk_disable_unprepare(tdma->ahub_clk);
|
|
|
|
|
|
|
|
- return pm_clk_suspend(dev);
|
|
|
|
|
|
|
+ return 0;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
static int tegra_adma_runtime_resume(struct device *dev)
|
|
static int tegra_adma_runtime_resume(struct device *dev)
|
|
@@ -646,10 +647,11 @@ static int tegra_adma_runtime_resume(struct device *dev)
|
|
|
struct tegra_adma *tdma = dev_get_drvdata(dev);
|
|
struct tegra_adma *tdma = dev_get_drvdata(dev);
|
|
|
int ret;
|
|
int ret;
|
|
|
|
|
|
|
|
- ret = pm_clk_resume(dev);
|
|
|
|
|
- if (ret)
|
|
|
|
|
|
|
+ ret = clk_prepare_enable(tdma->ahub_clk);
|
|
|
|
|
+ if (ret) {
|
|
|
|
|
+ dev_err(dev, "ahub clk_enable failed: %d\n", ret);
|
|
|
return ret;
|
|
return ret;
|
|
|
-
|
|
|
|
|
|
|
+ }
|
|
|
tdma_write(tdma, ADMA_GLOBAL_CMD, tdma->global_cmd);
|
|
tdma_write(tdma, ADMA_GLOBAL_CMD, tdma->global_cmd);
|
|
|
|
|
|
|
|
return 0;
|
|
return 0;
|
|
@@ -692,13 +694,11 @@ static int tegra_adma_probe(struct platform_device *pdev)
|
|
|
if (IS_ERR(tdma->base_addr))
|
|
if (IS_ERR(tdma->base_addr))
|
|
|
return PTR_ERR(tdma->base_addr);
|
|
return PTR_ERR(tdma->base_addr);
|
|
|
|
|
|
|
|
- ret = pm_clk_create(&pdev->dev);
|
|
|
|
|
- if (ret)
|
|
|
|
|
- return ret;
|
|
|
|
|
-
|
|
|
|
|
- ret = of_pm_clk_add_clk(&pdev->dev, "d_audio");
|
|
|
|
|
- if (ret)
|
|
|
|
|
- goto clk_destroy;
|
|
|
|
|
|
|
+ tdma->ahub_clk = devm_clk_get(&pdev->dev, "d_audio");
|
|
|
|
|
+ if (IS_ERR(tdma->ahub_clk)) {
|
|
|
|
|
+ dev_err(&pdev->dev, "Error: Missing ahub controller clock\n");
|
|
|
|
|
+ return PTR_ERR(tdma->ahub_clk);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
pm_runtime_enable(&pdev->dev);
|
|
pm_runtime_enable(&pdev->dev);
|
|
|
|
|
|
|
@@ -775,8 +775,6 @@ rpm_put:
|
|
|
pm_runtime_put_sync(&pdev->dev);
|
|
pm_runtime_put_sync(&pdev->dev);
|
|
|
rpm_disable:
|
|
rpm_disable:
|
|
|
pm_runtime_disable(&pdev->dev);
|
|
pm_runtime_disable(&pdev->dev);
|
|
|
-clk_destroy:
|
|
|
|
|
- pm_clk_destroy(&pdev->dev);
|
|
|
|
|
|
|
|
|
|
return ret;
|
|
return ret;
|
|
|
}
|
|
}
|
|
@@ -794,7 +792,6 @@ static int tegra_adma_remove(struct platform_device *pdev)
|
|
|
|
|
|
|
|
pm_runtime_put_sync(&pdev->dev);
|
|
pm_runtime_put_sync(&pdev->dev);
|
|
|
pm_runtime_disable(&pdev->dev);
|
|
pm_runtime_disable(&pdev->dev);
|
|
|
- pm_clk_destroy(&pdev->dev);
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
return 0;
|
|
|
}
|
|
}
|