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

Commit 4042fa04 authored by Veera Vegivada's avatar Veera Vegivada
Browse files

clk: qcom: common: Add support to enable critical clocks



Add support to be able to explicitly enable the critical clocks
bypassing the clock framework.

Change-Id: Ie52d3bd8338cf20f44dae20a10795bb005006eb7
Signed-off-by: default avatarVeera Vegivada <vvegivad@codeaurora.org>
parent 652771c4
Loading
Loading
Loading
Loading
+20 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2013-2014, 2017-2018, The Linux Foundation. All rights reserved.
 * Copyright (c) 2013-2014, 2017-2019, The Linux Foundation. All rights reserved.
 *
 * This software is licensed under the terms of the GNU General Public
 * License version 2, as published by the Free Software Foundation, and
@@ -346,4 +346,23 @@ int qcom_cc_register_rcg_dfs(struct platform_device *pdev,
}
EXPORT_SYMBOL(qcom_cc_register_rcg_dfs);

int qcom_cc_enable_critical_clks(const struct qcom_cc_critical_desc *desc)
{
	struct clk_regmap **clkr = desc->clks;
	size_t num_clks = desc->num_clks;
	int i, ret = 0;

	for (i = 0; i < num_clks; i++) {
		ret = clk_enable_regmap(&(clkr[i]->hw));
		if (ret) {
			pr_err("Failed to enable %s\n",
					clk_hw_get_name(&(clkr[i]->hw)));
			break;
		}
	}

	return ret;
}
EXPORT_SYMBOL(qcom_cc_enable_critical_clks);

MODULE_LICENSE("GPL v2");
+8 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2014, 2017-2018, The Linux Foundation. All rights reserved.
 * Copyright (c) 2014, 2017-2019, The Linux Foundation. All rights reserved.
 *
 * This software is licensed under the terms of the GNU General Public
 * License version 2, as published by the Free Software Foundation, and
@@ -61,6 +61,11 @@ struct qcom_cc_dfs_desc {
	size_t num_clks;
};

struct qcom_cc_critical_desc {
	struct clk_regmap **clks;
	size_t num_clks;
};

extern const struct freq_tbl *qcom_find_freq(const struct freq_tbl *f,
					     unsigned long rate);
extern const struct freq_tbl *qcom_find_freq_floor(const struct freq_tbl *f,
@@ -84,4 +89,6 @@ extern int qcom_cc_probe(struct platform_device *pdev,
extern const struct clk_ops clk_dummy_ops;
extern int qcom_cc_register_rcg_dfs(struct platform_device *pdev,
			 const struct qcom_cc_dfs_desc *desc);
extern int qcom_cc_enable_critical_clks(
		const struct qcom_cc_critical_desc *desc);
#endif