aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinaro CI <ci_notify@linaro.org>2018-07-05 16:10:56 +0000
committerLinaro CI <ci_notify@linaro.org>2018-07-05 16:10:56 +0000
commitfbd2df1f5cde3f7397a06cd269cbc33373f3c510 (patch)
tree86f48c631b745d717eb8b4e2d7229aa40ec084fe
parentf85876833aa3c9fa7afa844f2f7aadb3e5adbb94 (diff)
parent45ddc62d62778714aca9bfbdf617f5e6e03968cb (diff)
Merge remote-tracking branch 'bus-scaling-consumers/bus-scaling-consumers' into integration-linux-qcomltintegration-linux-qcomlt-20180709-001635-v4.18-rc3-208-gfbd2df1f5cde
-rw-r--r--arch/arm64/boot/dts/qcom/msm8916.dtsi25
-rw-r--r--arch/arm64/boot/dts/qcom/msm8996.dtsi24
-rw-r--r--drivers/char/hw_random/msm-rng.c10
-rw-r--r--drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c14
-rw-r--r--drivers/gpu/drm/msm/msm_gpu.c32
-rw-r--r--drivers/gpu/drm/msm/msm_gpu.h2
-rw-r--r--drivers/i2c/busses/i2c-qup.c12
-rw-r--r--drivers/media/platform/qcom/venus/core.c22
-rw-r--r--drivers/media/platform/qcom/venus/core.h4
-rw-r--r--drivers/media/platform/qcom/venus/vdec.c2
-rw-r--r--drivers/mmc/host/sdhci-msm.c47
-rw-r--r--drivers/pci/controller/dwc/pcie-qcom.c10
-rw-r--r--drivers/phy/qualcomm/phy-qcom-usb-hs.c10
-rw-r--r--drivers/scsi/ufs/ufs-qcom.c13
14 files changed, 220 insertions, 7 deletions
diff --git a/arch/arm64/boot/dts/qcom/msm8916.dtsi b/arch/arm64/boot/dts/qcom/msm8916.dtsi
index 37b677f8f0a1..cc1040eacdf5 100644
--- a/arch/arm64/boot/dts/qcom/msm8916.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8916.dtsi
@@ -605,6 +605,8 @@
<&gcc GCC_SDCC1_AHB_CLK>,
<&xo_board>;
clock-names = "core", "iface", "xo";
+ interconnect-names = "ddr";
+ interconnects = <&pnoc MASTER_SDCC_1 &bimc SLAVE_EBI_CH0>;
mmc-ddr-1_8v;
bus-width = <8>;
non-removable;
@@ -622,6 +624,8 @@
<&gcc GCC_SDCC2_AHB_CLK>,
<&xo_board>;
clock-names = "core", "iface", "xo";
+ interconnect-names = "ddr";
+ interconnects = <&pnoc MASTER_SDCC_2 &bimc SLAVE_EBI_CH0>;
bus-width = <4>;
status = "disabled";
};
@@ -658,6 +662,8 @@
reset-names = "phy", "por";
qcom,init-seq = /bits/ 8 <0x0 0x44
0x1 0x6b 0x2 0x24 0x3 0x13>;
+ interconnect-names = "ddr";
+ interconnects = <&pnoc MASTER_USB_HS &bimc SLAVE_EBI_CH0>;
};
};
};
@@ -751,6 +757,8 @@
reg = <0x00022000 0x200>;
clocks = <&gcc GCC_PRNG_AHB_CLK>;
clock-names = "core";
+ interconnects = <&bimc MASTER_AMPSS_M0 &pnoc SLAVE_PRNG>;
+ interconnect-names = "cpu";
};
qfprom: qfprom@5c000 {
@@ -850,6 +858,8 @@
power-domains = <&gcc OXILI_GDSC>;
operating-points-v2 = <&gpu_opp_table>;
iommus = <&gpu_iommu 1>, <&gpu_iommu 2>;
+ interconnects = <&bimc MASTER_GRAPHICS_3D &bimc SLAVE_EBI_CH0>;
+ interconnect-names = "gfx";
};
mdss: mdss@1a00000 {
@@ -888,13 +898,16 @@
<&gcc GCC_MDSS_AXI_CLK>,
<&gcc GCC_MDSS_MDP_CLK>,
<&gcc GCC_MDSS_VSYNC_CLK>;
- clock-names = "iface_clk",
- "bus_clk",
- "core_clk",
- "vsync_clk";
+ clock-names = "iface",
+ "bus",
+ "core",
+ "vsync";
iommus = <&apps_iommu 4>;
+ interconnects = <&snoc MASTER_MDP_PORT0 &bimc SLAVE_EBI_CH0>;
+ interconnect-names = "port0";
+
ports {
#address-cells = <1>;
#size-cells = <0>;
@@ -1380,6 +1393,10 @@
clock-names = "core", "iface", "bus";
iommus = <&apps_iommu 5>;
memory-region = <&venus_mem>;
+ interconnects = <&snoc MASTER_VIDEO_P0 &bimc SLAVE_EBI_CH0>,
+ <&snoc MASTER_MDP_PORT0 &bimc SLAVE_EBI_CH0>,
+ <&bimc MASTER_GRAPHICS_3D &bimc SLAVE_EBI_CH0>;
+ interconnect-names = "video", "mdp0", "gpu";
status = "okay";
video-decoder {
diff --git a/arch/arm64/boot/dts/qcom/msm8996.dtsi b/arch/arm64/boot/dts/qcom/msm8996.dtsi
index 8c12ccdb0154..e7a60b7be7e1 100644
--- a/arch/arm64/boot/dts/qcom/msm8996.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8996.dtsi
@@ -715,6 +715,8 @@
pinctrl-names = "default", "sleep";
pinctrl-0 = <&blsp2_i2c0_default>;
pinctrl-1 = <&blsp2_i2c0_sleep>;
+ interconnects = <&pnoc MASTER_BLSP_2 &bimc SLAVE_EBI_CH0>;
+ interconnect-names = "ddr";
#address-cells = <1>;
#size-cells = <0>;
status = "disabled";
@@ -733,6 +735,8 @@
clocks = <&gcc GCC_BLSP2_UART2_APPS_CLK>,
<&gcc GCC_BLSP2_AHB_CLK>;
clock-names = "core", "iface";
+ interconnects = <&pnoc MASTER_BLSP_2 &bimc SLAVE_EBI_CH0>;
+ interconnect-names = "ddr";
status = "disabled";
};
@@ -746,6 +750,8 @@
pinctrl-names = "default", "sleep";
pinctrl-0 = <&blsp2_i2c1_default>;
pinctrl-1 = <&blsp2_i2c1_sleep>;
+ interconnects = <&pnoc MASTER_BLSP_2 &bimc SLAVE_EBI_CH0>;
+ interconnect-names = "ddr";
#address-cells = <1>;
#size-cells = <0>;
status = "disabled";
@@ -771,6 +777,8 @@
pinctrl-names = "default", "sleep";
pinctrl-0 = <&blsp1_i2c2_default>;
pinctrl-1 = <&blsp1_i2c2_sleep>;
+ interconnects = <&pnoc MASTER_BLSP_1 &bimc SLAVE_EBI_CH0>;
+ interconnect-names = "ddr";
#address-cells = <1>;
#size-cells = <0>;
status = "disabled";
@@ -805,6 +813,8 @@
clocks = <&gcc GCC_SDCC2_AHB_CLK>,
<&gcc GCC_SDCC2_APPS_CLK>,
<&xo_board>;
+ interconnects = <&pnoc MASTER_SDCC_2 &bimc SLAVE_EBI_CH0>;
+ interconnect-names = "ddr";
bus-width = <4>;
};
@@ -1161,6 +1171,9 @@
assigned-clock-rates = <19200000>, <60000000>;
power-domains = <&gcc USB30_GDSC>;
+
+ interconnects = <&pnoc MASTER_USB_HS &bimc SLAVE_EBI_CH0>;
+ interconnect-names = "ddr";
status = "disabled";
dwc3@7600000 {
@@ -1189,6 +1202,9 @@
<&gcc GCC_USB30_MASTER_CLK>;
assigned-clock-rates = <19200000>, <120000000>;
+ interconnects = <&pnoc MASTER_USB3 &bimc SLAVE_EBI_CH0>;
+ interconnect-names = "ddr";
+
power-domains = <&gcc USB30_GDSC>;
status = "disabled";
@@ -1259,6 +1275,8 @@
"bus_master",
"bus_slave";
+ interconnects = <&a0noc MASTER_PCIE &bimc SLAVE_EBI_CH0>;
+ interconnect-names = "ddr";
};
pcie1: pcie@608000 {
@@ -1312,6 +1330,9 @@
"cfg",
"bus_master",
"bus_slave";
+
+ interconnects = <&a0noc MASTER_PCIE_1 &bimc SLAVE_EBI_CH0>;
+ interconnect-names = "ddr";
};
pcie2: pcie@610000 {
@@ -1364,6 +1385,9 @@
"cfg",
"bus_master",
"bus_slave";
+
+ interconnects = <&a0noc MASTER_PCIE_2 &bimc SLAVE_EBI_CH0>;
+ interconnect-names = "ddr";
};
};
diff --git a/drivers/char/hw_random/msm-rng.c b/drivers/char/hw_random/msm-rng.c
index 841fee845ec9..48f2ef138d4a 100644
--- a/drivers/char/hw_random/msm-rng.c
+++ b/drivers/char/hw_random/msm-rng.c
@@ -14,6 +14,7 @@
#include <linux/clk.h>
#include <linux/err.h>
#include <linux/hw_random.h>
+#include <linux/interconnect.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/of.h>
@@ -39,6 +40,7 @@ struct msm_rng {
void __iomem *base;
struct clk *clk;
struct hwrng hwrng;
+ struct icc_path *path;
};
#define to_msm_rng(p) container_of(p, struct msm_rng, hwrng)
@@ -94,6 +96,8 @@ static int msm_rng_read(struct hwrng *hwrng, void *data, size_t max, bool wait)
if (ret)
return ret;
+ icc_set(rng->path, 0, 800);
+
/* read random data from hardware */
do {
val = readl_relaxed(rng->base + PRNG_STATUS);
@@ -112,6 +116,8 @@ static int msm_rng_read(struct hwrng *hwrng, void *data, size_t max, bool wait)
break;
} while (currsize < maxsize);
+ icc_set(rng->path, 0, 0);
+
clk_disable_unprepare(rng->clk);
return currsize;
@@ -148,6 +154,10 @@ static int msm_rng_probe(struct platform_device *pdev)
if (IS_ERR(rng->clk))
return PTR_ERR(rng->clk);
+ rng->path = of_icc_get(&pdev->dev, "cpu");
+ if (IS_ERR(rng->path))
+ return PTR_ERR(rng->path);
+
rng->hwrng.name = KBUILD_MODNAME,
rng->hwrng.init = msm_rng_init,
rng->hwrng.cleanup = msm_rng_cleanup,
diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c
index 6e12e275deba..7badbba3fc37 100644
--- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c
+++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c
@@ -16,6 +16,7 @@
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <linux/interconnect.h>
#include <linux/of_irq.h>
#include "msm_drv.h"
@@ -1048,6 +1049,19 @@ static const struct component_ops mdp5_ops = {
static int mdp5_dev_probe(struct platform_device *pdev)
{
+ struct icc_path *path0 = of_icc_get(&pdev->dev, "port0");
+ struct icc_path *path1 = of_icc_get(&pdev->dev, "port1");
+ struct icc_path *path_rot = of_icc_get(&pdev->dev, "rotator");
+
+ if (IS_ERR(path0))
+ return PTR_ERR(path0);
+ icc_set(path0, 0, 6400000);
+
+ if (!IS_ERR(path1))
+ icc_set(path1, 0, 6400000);
+ if (!IS_ERR(path_rot))
+ icc_set(path_rot, 0, 6400000);
+
DBG("");
return component_add(&pdev->dev, &mdp5_ops);
}
diff --git a/drivers/gpu/drm/msm/msm_gpu.c b/drivers/gpu/drm/msm/msm_gpu.c
index 1c09acfb4028..463f84c56623 100644
--- a/drivers/gpu/drm/msm/msm_gpu.c
+++ b/drivers/gpu/drm/msm/msm_gpu.c
@@ -84,6 +84,30 @@ static struct devfreq_dev_profile msm_devfreq_profile = {
.get_cur_freq = msm_devfreq_get_cur_freq,
};
+static int bs_init(struct msm_gpu *gpu)
+{
+ gpu->path = of_icc_get(&gpu->pdev->dev, "gfx");
+ if (IS_ERR(gpu->path))
+ return PTR_ERR(gpu->path);
+
+ return 0;
+}
+
+static void bs_fini(struct msm_gpu *gpu)
+{
+ icc_put(gpu->path);
+}
+
+static void bs_set(struct msm_gpu *gpu, int idx)
+{
+ u32 peak_bw = 0;
+
+ if (idx > 0)
+ peak_bw = 14432000;
+
+ icc_set(gpu->path, 0, peak_bw);
+}
+
static void msm_devfreq_init(struct msm_gpu *gpu)
{
/* We need target support to do devfreq */
@@ -191,6 +215,7 @@ static int enable_axi(struct msm_gpu *gpu)
{
if (gpu->ebi1_clk)
clk_prepare_enable(gpu->ebi1_clk);
+ bs_set(gpu, 1);
return 0;
}
@@ -198,6 +223,7 @@ static int disable_axi(struct msm_gpu *gpu)
{
if (gpu->ebi1_clk)
clk_disable_unprepare(gpu->ebi1_clk);
+ bs_set(gpu, 0);
return 0;
}
@@ -753,6 +779,7 @@ int msm_gpu_init(struct drm_device *drm, struct platform_device *pdev,
gpu->num_perfcntrs = ARRAY_SIZE(gpu->last_cntrs);
gpu->dev = drm;
+ gpu->pdev = pdev;
gpu->funcs = funcs;
gpu->name = name;
@@ -792,6 +819,10 @@ int msm_gpu_init(struct drm_device *drm, struct platform_device *pdev,
if (ret)
goto fail;
+ ret = bs_init(gpu);
+ if (ret)
+ goto fail;
+
gpu->ebi1_clk = msm_clk_get(pdev, "bus");
DBG("ebi1_clk: %p", gpu->ebi1_clk);
if (IS_ERR(gpu->ebi1_clk))
@@ -808,7 +839,6 @@ int msm_gpu_init(struct drm_device *drm, struct platform_device *pdev,
if (IS_ERR(gpu->gpu_cx))
gpu->gpu_cx = NULL;
- gpu->pdev = pdev;
platform_set_drvdata(pdev, gpu);
msm_devfreq_init(gpu);
diff --git a/drivers/gpu/drm/msm/msm_gpu.h b/drivers/gpu/drm/msm/msm_gpu.h
index b8241179175a..307c0711da49 100644
--- a/drivers/gpu/drm/msm/msm_gpu.h
+++ b/drivers/gpu/drm/msm/msm_gpu.h
@@ -20,6 +20,7 @@
#include <linux/clk.h>
#include <linux/regulator/consumer.h>
+#include <linux/interconnect.h>
#include "msm_drv.h"
#include "msm_fence.h"
@@ -112,6 +113,7 @@ struct msm_gpu {
int nr_clocks;
struct clk *ebi1_clk, *core_clk, *rbbmtimer_clk;
uint32_t fast_rate;
+ struct icc_path *path;
/* Hang and Inactivity Detection:
*/
diff --git a/drivers/i2c/busses/i2c-qup.c b/drivers/i2c/busses/i2c-qup.c
index c86c3ae1318f..01478dbc43ac 100644
--- a/drivers/i2c/busses/i2c-qup.c
+++ b/drivers/i2c/busses/i2c-qup.c
@@ -14,6 +14,7 @@
#include <linux/dma-mapping.h>
#include <linux/err.h>
#include <linux/i2c.h>
+#include <linux/interconnect.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/module.h>
@@ -280,6 +281,9 @@ struct qup_i2c_dev {
void (*read_rx_fifo)(struct qup_i2c_dev *qup);
/* function to write tags in tx fifo for i2c read transfer */
void (*write_rx_tags)(struct qup_i2c_dev *qup);
+
+ /* The interconnect path */
+ struct icc_path *path;
};
static irqreturn_t qup_i2c_interrupt(int irq, void *dev)
@@ -1775,6 +1779,10 @@ nodma:
return qup->irq;
}
+ qup->path = of_icc_get(qup->dev, "ddr");
+ if (IS_ERR(qup->path))
+ return PTR_ERR(qup->path);
+
if (has_acpi_companion(qup->dev)) {
ret = device_property_read_u32(qup->dev,
"src-clock-hz", &src_clk_freq);
@@ -1940,15 +1948,19 @@ static int qup_i2c_pm_suspend_runtime(struct device *device)
dev_dbg(device, "pm_runtime: suspending...\n");
qup_i2c_disable_clocks(qup);
+ icc_set(qup->path, 0, 0);
return 0;
}
static int qup_i2c_pm_resume_runtime(struct device *device)
{
struct qup_i2c_dev *qup = dev_get_drvdata(device);
+ u32 freq;
dev_dbg(device, "pm_runtime: resuming...\n");
qup_i2c_enable_clocks(qup);
+ freq = clk_get_rate(qup->clk);
+ icc_set(qup->path, 0, freq * 8);
return 0;
}
#endif
diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c
index 41eef376eb2d..3e5e60a8ac62 100644
--- a/drivers/media/platform/qcom/venus/core.c
+++ b/drivers/media/platform/qcom/venus/core.c
@@ -14,6 +14,7 @@
*/
#include <linux/clk.h>
#include <linux/init.h>
+#include <linux/interconnect.h>
#include <linux/ioctl.h>
#include <linux/list.h>
#include <linux/module.h>
@@ -171,6 +172,18 @@ static int venus_probe(struct platform_device *pdev)
if (IS_ERR(core->base))
return PTR_ERR(core->base);
+ core->path = of_icc_get(dev, "video");
+ if (IS_ERR(core->path))
+ return PTR_ERR(core->path);
+
+ core->path_mdp0 = of_icc_get(dev, "mdp0");
+ if (IS_ERR(core->path_mdp0))
+ return PTR_ERR(core->path_mdp0);
+
+ core->path_gpu = of_icc_get(dev, "gpu");
+ if (IS_ERR(core->path_gpu))
+ return PTR_ERR(core->path_gpu);
+
core->irq = platform_get_irq(pdev, 0);
if (core->irq < 0)
return core->irq;
@@ -275,6 +288,10 @@ static __maybe_unused int venus_runtime_suspend(struct device *dev)
struct venus_core *core = dev_get_drvdata(dev);
int ret;
+ icc_set(core->path, 0, 0);
+ icc_set(core->path_mdp0, 0, 1000);
+ icc_set(core->path_mdp1, 0, 1000);
+
ret = hfi_core_suspend(core);
venus_clks_disable(core);
@@ -287,6 +304,11 @@ static __maybe_unused int venus_runtime_resume(struct device *dev)
struct venus_core *core = dev_get_drvdata(dev);
int ret;
+ icc_set(core->path, 677600, 1331000);
+ icc_set(core->path_mdp0, 0, 6400000);
+ icc_set(core->path_mdp1, 0, 6400000);
+ icc_set(core->path_gpu, 1066000, 4264000);
+
ret = venus_clks_enable(core);
if (ret)
return ret;
diff --git a/drivers/media/platform/qcom/venus/core.h b/drivers/media/platform/qcom/venus/core.h
index 0360d295f4c8..d97f1fb1fd75 100644
--- a/drivers/media/platform/qcom/venus/core.h
+++ b/drivers/media/platform/qcom/venus/core.h
@@ -120,6 +120,10 @@ struct venus_core {
void *priv;
const struct hfi_ops *ops;
struct delayed_work work;
+ struct icc_path *path;
+ struct icc_path *path_mdp0;
+ struct icc_path *path_mdp1;
+ struct icc_path *path_gpu;
};
struct vdec_controls {
diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c
index 49bbd1861d3a..4867edba8b6a 100644
--- a/drivers/media/platform/qcom/venus/vdec.c
+++ b/drivers/media/platform/qcom/venus/vdec.c
@@ -767,6 +767,8 @@ static int vdec_start_streaming(struct vb2_queue *q, unsigned int count)
if (ret)
goto deinit_sess;
+ /* TODO: determine parameters and set interconnect bandwidth */
+
ret = venus_helper_vb2_start_streaming(inst);
if (ret)
goto deinit_sess;
diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c
index 646bf377ba77..1aa4120d8edb 100644
--- a/drivers/mmc/host/sdhci-msm.c
+++ b/drivers/mmc/host/sdhci-msm.c
@@ -20,6 +20,7 @@
#include <linux/mmc/mmc.h>
#include <linux/pm_runtime.h>
#include <linux/slab.h>
+#include <linux/interconnect.h>
#include <linux/iopoll.h>
#include <linux/regulator/consumer.h>
@@ -156,6 +157,7 @@ struct sdhci_msm_host {
wait_queue_head_t pwr_irq_wait;
bool pwr_irq_flag;
u32 caps_0;
+ struct icc_path *path;
};
static unsigned int msm_get_clock_rate_for_bus_mode(struct sdhci_host *host,
@@ -1392,6 +1394,28 @@ static void sdhci_msm_set_regulator_caps(struct sdhci_msm_host *msm_host)
pr_debug("%s: supported caps: 0x%08x\n", mmc_hostname(mmc), caps);
}
+static int sdhci_msm_set_icc(struct sdhci_msm_host *msm_host, unsigned int rate)
+{
+
+ if (IS_ERR(msm_host->path)) {
+ WARN_ON(1);
+ return 0;
+ }
+
+ if (rate == INT_MAX)
+ icc_set(msm_host->path, 2048000, 4096000);
+ else
+ icc_set(msm_host->path, 0, 0);
+
+ return 0;
+}
+
+static void sdhci_msm_deinit_icc(struct sdhci_msm_host *msm_host)
+{
+ if (!IS_ERR(msm_host->path))
+ icc_put(msm_host->path);
+}
+
static const struct of_device_id sdhci_msm_dt_match[] = {
{ .compatible = "qcom,sdhci-msm-v4" },
{},
@@ -1448,16 +1472,23 @@ static int sdhci_msm_probe(struct platform_device *pdev)
msm_host->saved_tuning_phase = INVALID_TUNING_PHASE;
+ msm_host->path = of_icc_get(&pdev->dev, "ddr");
+ if (IS_ERR(msm_host->path)) {
+ ret = PTR_ERR(msm_host->path);
+ goto pltfm_free;
+ }
+ sdhci_msm_set_icc(msm_host, INT_MAX);
+
/* Setup SDCC bus voter clock. */
msm_host->bus_clk = devm_clk_get(&pdev->dev, "bus");
if (!IS_ERR(msm_host->bus_clk)) {
/* Vote for max. clk rate for max. performance */
ret = clk_set_rate(msm_host->bus_clk, INT_MAX);
if (ret)
- goto pltfm_free;
+ goto icc_disable;
ret = clk_prepare_enable(msm_host->bus_clk);
if (ret)
- goto pltfm_free;
+ goto icc_disable;
}
/* Setup main peripheral bus clock */
@@ -1498,6 +1529,13 @@ static int sdhci_msm_probe(struct platform_device *pdev)
if (ret)
goto bus_clk_disable;
+ msm_host->path = of_icc_get(&pdev->dev, "ddr");
+ if (IS_ERR(msm_host->path)) {
+ ret = PTR_ERR(msm_host->path);
+ goto clk_disable;
+ }
+ sdhci_msm_set_icc(msm_host, INT_MAX);
+
/*
* xo clock is needed for FLL feature of cm_dll.
* In case if xo clock is not mentioned in DT, warn and proceed.
@@ -1625,6 +1663,8 @@ clk_disable:
bus_clk_disable:
if (!IS_ERR(msm_host->bus_clk))
clk_disable_unprepare(msm_host->bus_clk);
+icc_disable:
+ sdhci_msm_deinit_icc(msm_host);
pltfm_free:
sdhci_pltfm_free(pdev);
return ret;
@@ -1646,8 +1686,11 @@ static int sdhci_msm_remove(struct platform_device *pdev)
clk_bulk_disable_unprepare(ARRAY_SIZE(msm_host->bulk_clks),
msm_host->bulk_clks);
+ sdhci_msm_deinit_icc(msm_host);
+
if (!IS_ERR(msm_host->bus_clk))
clk_disable_unprepare(msm_host->bus_clk);
+ sdhci_msm_deinit_icc(msm_host);
sdhci_pltfm_free(pdev);
return 0;
}
diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c
index a1d0198081a6..7042a56e9583 100644
--- a/drivers/pci/controller/dwc/pcie-qcom.c
+++ b/drivers/pci/controller/dwc/pcie-qcom.c
@@ -11,6 +11,8 @@
#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/gpio/consumer.h>
+#include <linux/gpio.h>
+#include <linux/interconnect.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/iopoll.h>
@@ -110,6 +112,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 {
@@ -504,6 +507,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);
@@ -534,6 +541,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)
@@ -581,6 +589,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);
diff --git a/drivers/phy/qualcomm/phy-qcom-usb-hs.c b/drivers/phy/qualcomm/phy-qcom-usb-hs.c
index 2d0c70b5589f..81ff6f2b26b6 100644
--- a/drivers/phy/qualcomm/phy-qcom-usb-hs.c
+++ b/drivers/phy/qualcomm/phy-qcom-usb-hs.c
@@ -15,6 +15,7 @@
#include <linux/reset.h>
#include <linux/extcon.h>
#include <linux/notifier.h>
+#include <linux/interconnect.h>
#define ULPI_PWR_CLK_MNG_REG 0x88
# define ULPI_PWR_OTG_COMP_DISABLE BIT(0)
@@ -39,6 +40,7 @@ struct qcom_usb_hs_phy {
struct reset_control *reset;
struct ulpi_seq *init_seq;
struct extcon_dev *vbus_edev;
+ struct icc_path *path;
struct notifier_block vbus_notify;
};
@@ -154,6 +156,8 @@ static int qcom_usb_hs_phy_power_on(struct phy *phy)
goto err_ulpi;
}
+ icc_set(uphy->path, 80000, 6000);
+
if (uphy->vbus_edev) {
state = extcon_get_state(uphy->vbus_edev, EXTCON_USB);
/* setup initial state */
@@ -181,6 +185,8 @@ static int qcom_usb_hs_phy_power_off(struct phy *phy)
{
struct qcom_usb_hs_phy *uphy = phy_get_drvdata(phy);
+ icc_set(uphy->path, 0, 0);
+
regulator_disable(uphy->v3p3);
regulator_disable(uphy->v1p8);
clk_disable_unprepare(uphy->sleep_clk);
@@ -249,6 +255,10 @@ static int qcom_usb_hs_phy_probe(struct ulpi *ulpi)
uphy->reset = NULL;
}
+ uphy->path = of_icc_get(&ulpi->dev, "ddr");
+ if (IS_ERR(uphy->path))
+ return PTR_ERR(uphy->path);
+
uphy->phy = devm_phy_create(&ulpi->dev, ulpi->dev.of_node,
&qcom_usb_hs_phy_ops);
if (IS_ERR(uphy->phy))
diff --git a/drivers/scsi/ufs/ufs-qcom.c b/drivers/scsi/ufs/ufs-qcom.c
index db87ec8bb320..1abbe2130a78 100644
--- a/drivers/scsi/ufs/ufs-qcom.c
+++ b/drivers/scsi/ufs/ufs-qcom.c
@@ -12,6 +12,7 @@
*
*/
+#include <linux/interconnect.h>
#include <linux/time.h>
#include <linux/of.h>
#include <linux/platform_device.h>
@@ -913,6 +914,7 @@ static int ufs_qcom_bus_register(struct ufs_qcom_host *host)
}
#endif /* CONFIG_MSM_BUS_SCALING */
+
static void ufs_qcom_dev_ref_clk_ctrl(struct ufs_qcom_host *host, bool enable)
{
if (host->dev_ref_clk_ctrl_mmio &&
@@ -1716,6 +1718,17 @@ static int ufs_qcom_probe(struct platform_device *pdev)
{
int err;
struct device *dev = &pdev->dev;
+ struct icc_path *path = of_icc_get(dev, "ddr");
+ struct icc_path *path_cfg = of_icc_get(dev, "cfg");
+
+ if (IS_ERR(path))
+ return PTR_ERR(path);
+
+ if (IS_ERR(path_cfg))
+ return PTR_ERR(path_cfg);
+
+ icc_set(path, 4096000, 0);
+ icc_set(path_cfg, 1000, 0);
/* Perform generic probe */
err = ufshcd_pltfrm_init(pdev, &ufs_hba_qcom_vops);