diff --git a/drivers/clk/msm/virtclk-front-8996.c b/drivers/clk/msm/virtclk-front-8996.c index 68ef5967df58..f2a70f240984 100644 --- a/drivers/clk/msm/virtclk-front-8996.c +++ b/drivers/clk/msm/virtclk-front-8996.c @@ -15,6 +15,7 @@ #include #include #include +#include "virtclk-front.h" #include "virt-reset-front.h" static struct virtclk_front gcc_blsp1_ahb_clk = { @@ -498,6 +499,33 @@ static struct virtclk_front gcc_mss_mnoc_bimc_axi_clk = { }, }; +static struct virtclk_front ipa_clk = { + .c = { + .dbg_name = "ipa", + .ops = &virtclk_front_ops, + CLK_INIT(ipa_clk.c), + }, + .flag = CLOCK_FLAG_NODE_TYPE_REMOTE, +}; + +static struct virtclk_front pnoc_clk = { + .c = { + .dbg_name = "pnoc", + .ops = &virtclk_front_ops, + CLK_INIT(pnoc_clk.c), + }, + .flag = CLOCK_FLAG_NODE_TYPE_REMOTE, +}; + +static struct virtclk_front qdss_clk = { + .c = { + .dbg_name = "qdss", + .ops = &virtclk_front_ops, + CLK_INIT(qdss_clk.c), + }, + .flag = CLOCK_FLAG_NODE_TYPE_REMOTE, +}; + static struct clk_lookup msm_clocks_8996[] = { CLK_LIST(gcc_blsp1_ahb_clk), CLK_LIST(gcc_blsp1_qup1_spi_apps_clk), @@ -559,6 +587,9 @@ static struct clk_lookup msm_clocks_8996[] = { CLK_LIST(gpll0_out_msscc), CLK_LIST(gcc_mss_snoc_axi_clk), CLK_LIST(gcc_mss_mnoc_bimc_axi_clk), + CLK_LIST(ipa_clk), + CLK_LIST(pnoc_clk), + CLK_LIST(qdss_clk), }; static struct virt_reset_map msm_resets_8996[] = { diff --git a/drivers/clk/msm/virtclk-front.c b/drivers/clk/msm/virtclk-front.c index 2d8a9e8ec61c..ad89dda6514f 100644 --- a/drivers/clk/msm/virtclk-front.c +++ b/drivers/clk/msm/virtclk-front.c @@ -62,7 +62,7 @@ static int virtclk_front_get_id(struct clk *clk) if (v->id) return ret; - msg.header.cmd = CLK_MSG_GETID; + msg.header.cmd = CLK_MSG_GETID | v->flag; msg.header.len = sizeof(msg); strlcpy(msg.name, clk->dbg_name, sizeof(msg.name)); @@ -119,7 +119,7 @@ static int virtclk_front_prepare(struct clk *clk) return ret; msg.clk_id = v->id; - msg.cmd = CLK_MSG_ENABLE; + msg.cmd = CLK_MSG_ENABLE | v->flag; msg.len = sizeof(struct clk_msg_header); rt_mutex_lock(&virtclk_front_ctx.lock); @@ -173,7 +173,7 @@ static void virtclk_front_unprepare(struct clk *clk) return; msg.clk_id = v->id; - msg.cmd = CLK_MSG_DISABLE; + msg.cmd = CLK_MSG_DISABLE | v->flag; msg.len = sizeof(struct clk_msg_header); rt_mutex_lock(&virtclk_front_ctx.lock); @@ -224,7 +224,7 @@ static int virtclk_front_reset(struct clk *clk, enum clk_reset_action action) return ret; msg.header.clk_id = v->id; - msg.header.cmd = CLK_MSG_RESET; + msg.header.cmd = CLK_MSG_RESET | v->flag; msg.header.len = sizeof(struct clk_msg_header); msg.reset = action; @@ -279,7 +279,7 @@ static int virtclk_front_set_rate(struct clk *clk, unsigned long rate) return ret; msg.header.clk_id = v->id; - msg.header.cmd = CLK_MSG_SETFREQ; + msg.header.cmd = CLK_MSG_SETFREQ | v->flag; msg.header.len = sizeof(msg); msg.freq = (u32)rate; @@ -352,7 +352,7 @@ static unsigned long virtclk_front_get_rate(struct clk *clk) return 0; msg.clk_id = v->id; - msg.cmd = CLK_MSG_GETFREQ; + msg.cmd = CLK_MSG_GETFREQ | v->flag; msg.len = sizeof(msg); rt_mutex_lock(&virtclk_front_ctx.lock); diff --git a/drivers/clk/msm/virtclk-front.h b/drivers/clk/msm/virtclk-front.h index 60650f8d1ed1..4d3bdf7cd841 100644 --- a/drivers/clk/msm/virtclk-front.h +++ b/drivers/clk/msm/virtclk-front.h @@ -23,6 +23,8 @@ enum virtclk_cmd { CLK_MSG_MAX }; +#define CLOCK_FLAG_NODE_TYPE_REMOTE 0xff00 + struct clk_msg_header { u32 cmd; u32 len; diff --git a/include/linux/clk/msm-clock-generic.h b/include/linux/clk/msm-clock-generic.h index fe019d366d0b..cb2d8787b84f 100644 --- a/include/linux/clk/msm-clock-generic.h +++ b/include/linux/clk/msm-clock-generic.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2017, The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2018, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -311,6 +311,7 @@ extern struct clk_ops clk_ops_mux_div_clk; struct virtclk_front { int id; struct clk c; + u32 flag; }; extern struct clk_ops virtclk_front_ops;