aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorgi Djakov <georgi.djakov@linaro.org>2018-03-20 09:57:34 +0800
committerGeorgi Djakov <georgi.djakov@linaro.org>2018-05-21 16:09:47 +0300
commitb20423ef2c0d38d89ffb16de66bd26addc81dd34 (patch)
treeda5a8051dd7e2d6bf43c201dc532b968b54ed63c
parente97dd6a590668821b97dcdf87ea9e9c893d43717 (diff)
PCI: qcom: Use the interconnect API
Signed-off-by: Georgi Djakov <georgi.djakov@linaro.org>
-rw-r--r--drivers/pci/dwc/pcie-qcom.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/pci/dwc/pcie-qcom.c b/drivers/pci/dwc/pcie-qcom.c
index 75896b49741e..585f6e3a88ca 100644
--- a/drivers/pci/dwc/pcie-qcom.c
+++ b/drivers/pci/dwc/pcie-qcom.c
@@ -11,6 +11,7 @@
#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/gpio.h>
+#include <linux/interconnect.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/iopoll.h>
@@ -110,6 +111,7 @@ struct qcom_pcie_resources_2_3_2 {
struct clk *cfg_clk;
struct clk *pipe_clk;
struct regulator_bulk_data supplies[QCOM_PCIE_2_3_2_MAX_SUPPLY];
+ struct icc_path *path;
};
struct qcom_pcie_resources_2_4_0 {
@@ -522,6 +524,10 @@ static int qcom_pcie_get_resources_2_3_2(struct qcom_pcie *pcie)
if (ret)
return ret;
+ res->path = of_icc_get(dev, "ddr");
+ if (IS_ERR(res->path))
+ return PTR_ERR(res->path);
+
res->aux_clk = devm_clk_get(dev, "aux");
if (IS_ERR(res->aux_clk))
return PTR_ERR(res->aux_clk);
@@ -552,6 +558,7 @@ static void qcom_pcie_deinit_2_3_2(struct qcom_pcie *pcie)
clk_disable_unprepare(res->aux_clk);
regulator_bulk_disable(ARRAY_SIZE(res->supplies), res->supplies);
+ icc_put(res->path);
}
static void qcom_pcie_post_deinit_2_3_2(struct qcom_pcie *pcie)
@@ -599,6 +606,8 @@ static int qcom_pcie_init_2_3_2(struct qcom_pcie *pcie)
goto err_slave_clk;
}
+ icc_set(res->path, 500, 800);
+
/* enable PCIe clocks and resets */
val = readl(pcie->parf + PCIE20_PARF_PHY_CTRL);
val &= ~BIT(0);