Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ee652c63 authored by Taniya Das's avatar Taniya Das
Browse files

clk: qcom: gcc: Add support for measure only clocks for CPU



Measure clocks are required to be supported for CPU/L3 clocks, so add
support for the same.

Change-Id: Ieda7c215cad19262148bb0728381a008d9d3794a
Signed-off-by: default avatarTaniya Das <tdas@codeaurora.org>
parent 6e9f8d30
Loading
Loading
Loading
Loading
+46 −1
Original line number Diff line number Diff line
@@ -2354,6 +2354,45 @@ static struct clk_branch gcc_video_xo_clk = {
	},
};

/* Measure only clocks */
static struct clk_dummy l3_clk = {
	.rrate = 1000,
	.hw.init = &(struct clk_init_data){
		.name = "l3_clk",
		.ops = &clk_dummy_ops,
	},
};

static struct clk_dummy pwrcl_clk = {
	.rrate = 1000,
	.hw.init = &(struct clk_init_data){
		.name = "pwrcl_clk",
		.ops = &clk_dummy_ops,
	},
};

static struct clk_dummy perfcl_clk = {
	.rrate = 1000,
	.hw.init = &(struct clk_init_data){
		.name = "perfcl_clk",
		.ops = &clk_dummy_ops,
	},
};

static struct clk_dummy perfpcl_clk = {
	.rrate = 1000,
	.hw.init = &(struct clk_init_data){
		.name = "perfpcl_clk",
		.ops = &clk_dummy_ops,
	},
};
static struct clk_hw *gcc_lito_hws[] = {
	&l3_clk.hw,
	&pwrcl_clk.hw,
	&perfcl_clk.hw,
	&perfpcl_clk.hw,
};

static struct clk_regmap *gcc_lito_clocks[] = {
	[GCC_AGGRE_UFS_PHY_AXI_CLK] = &gcc_aggre_ufs_phy_axi_clk.clkr,
	[GCC_AGGRE_USB3_PRIM_AXI_CLK] = &gcc_aggre_usb3_prim_axi_clk.clkr,
@@ -2543,7 +2582,7 @@ MODULE_DEVICE_TABLE(of, gcc_lito_match_table);
static int gcc_lito_probe(struct platform_device *pdev)
{
	struct regmap *regmap;
	int ret;
	int ret, i;

	regmap = qcom_cc_map(pdev, &gcc_lito_desc);
	if (IS_ERR(regmap))
@@ -2574,6 +2613,12 @@ static int gcc_lito_probe(struct platform_device *pdev)
	regmap_update_bits(regmap, GCC_NPU_MISC, 0x3, 0x3);
	regmap_update_bits(regmap, GCC_GPU_MISC, 0x3, 0x3);

	for (i = 0; i < ARRAY_SIZE(gcc_lito_hws); i++) {
		ret = devm_clk_hw_register(&pdev->dev, gcc_lito_hws[i]);
		if (ret)
			return ret;
	}

	ret = qcom_cc_really_probe(pdev, &gcc_lito_desc, regmap);
	if (ret) {
		dev_err(&pdev->dev, "Failed to register GCC clocks\n");