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

Commit 5293c2e7 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: msm_bus: Add support for setrate only clocks"

parents 60c5de1c f96fd792
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -81,6 +81,9 @@ node-gdsc-supply: Optional node device parameter that is a reference to a GDSC s
			that is needed before node-clock operations.
qcom,enable-only-clk:   Optional property that is represents if the clock doesn't support
                        the clk_set_rate API and should only be enabled/disabled.
qcom,setrate-only-clk:   Optional property that is indicates that bus driver should only
			set a rate on a clock handle and not call the enable/disable
			clock API.
clock-names:		Optional property that represents the clock name associated
			with the device "bus_clk", "bus_a_clk";
clocks:			Property pair that represents the clock controller and the clock
+1 −0
Original line number Diff line number Diff line
@@ -149,6 +149,7 @@ struct nodeclk {
	uint64_t rate;
	bool dirty;
	bool enable_only_clk;
	bool setrate_only_clk;
	bool enable;
	char reg_name[MAX_REG_NAME];
};
+8 −2
Original line number Diff line number Diff line
@@ -180,7 +180,7 @@ static int enable_nodeclk(struct nodeclk *nclk, struct device *dev)
{
	int ret = 0;

	if (!nclk->enable) {
	if (!nclk->enable && !nclk->setrate_only_clk) {
		if (dev && strlen(nclk->reg_name)) {
			if (IS_ERR_OR_NULL(nclk->reg)) {
				ret = bus_get_reg(nclk, dev);
@@ -214,7 +214,7 @@ static int disable_nodeclk(struct nodeclk *nclk)
{
	int ret = 0;

	if (nclk->enable) {
	if (nclk->enable && !nclk->setrate_only_clk) {
		clk_disable_unprepare(nclk->clk);
		nclk->enable = false;
		bus_disable_reg(nclk);
@@ -725,6 +725,8 @@ static int msm_bus_init_clk(struct device *bus_dev,
			node_dev->clk[ctx].clk = pdata->clk[ctx].clk;
			node_dev->clk[ctx].enable_only_clk =
					pdata->clk[ctx].enable_only_clk;
			node_dev->clk[ctx].setrate_only_clk =
					pdata->clk[ctx].setrate_only_clk;
			node_dev->clk[ctx].enable = false;
			node_dev->clk[ctx].dirty = false;
			strlcpy(node_dev->clk[ctx].reg_name,
@@ -740,6 +742,8 @@ static int msm_bus_init_clk(struct device *bus_dev,
		node_dev->bus_qos_clk.clk = pdata->bus_qos_clk.clk;
		node_dev->bus_qos_clk.enable_only_clk =
					pdata->bus_qos_clk.enable_only_clk;
		node_dev->bus_qos_clk.setrate_only_clk =
					pdata->bus_qos_clk.setrate_only_clk;
		node_dev->bus_qos_clk.enable = false;
		strlcpy(node_dev->bus_qos_clk.reg_name,
			pdata->bus_qos_clk.reg_name, MAX_REG_NAME);
@@ -763,6 +767,8 @@ static int msm_bus_init_clk(struct device *bus_dev,
					pdata->node_qos_clks[i].clk;
			node_dev->node_qos_clks[i].enable_only_clk =
					pdata->node_qos_clks[i].enable_only_clk;
			node_dev->node_qos_clks[i].setrate_only_clk =
				pdata->node_qos_clks[i].setrate_only_clk;
			node_dev->node_qos_clks[i].enable = false;
			strlcpy(node_dev->node_qos_clks[i].reg_name,
				pdata->node_qos_clks[i].reg_name, MAX_REG_NAME);
+27 −0
Original line number Diff line number Diff line
@@ -490,6 +490,7 @@ static int get_bus_node_device_data(
		struct msm_bus_node_device_type * const node_device)
{
	bool enable_only;
	bool setrate_only;

	node_device->node_info = get_node_info_data(dev_node, pdev);
	if (IS_ERR_OR_NULL(node_device->node_info)) {
@@ -519,6 +520,19 @@ static int get_bus_node_device_data(
		node_device->clk[DUAL_CTX].enable_only_clk = enable_only;
		node_device->clk[ACTIVE_CTX].enable_only_clk = enable_only;

		/*
		 * Doesn't make sense to have a clk handle you can't enable or
		 * set rate on.
		 */
		if (!enable_only) {
			setrate_only = of_property_read_bool(dev_node,
						"qcom,setrate-only-clk");
			node_device->clk[DUAL_CTX].setrate_only_clk =
								setrate_only;
			node_device->clk[ACTIVE_CTX].setrate_only_clk =
								setrate_only;
		}

		node_device->clk[DUAL_CTX].clk = of_clk_get_by_name(dev_node,
							"bus_clk");

@@ -613,6 +627,19 @@ static int get_bus_node_device_data(
		node_device->clk[DUAL_CTX].enable_only_clk = enable_only;
		node_device->bus_qos_clk.enable_only_clk = enable_only;

		/*
		 * Doesn't make sense to have a clk handle you can't enable or
		 * set rate on.
		 */
		if (!enable_only) {
			setrate_only = of_property_read_bool(dev_node,
						"qcom,setrate-only-clk");
			node_device->clk[DUAL_CTX].setrate_only_clk =
								setrate_only;
			node_device->clk[ACTIVE_CTX].setrate_only_clk =
								setrate_only;
		}

		node_device->clk[DUAL_CTX].clk = of_clk_get_by_name(dev_node,
							"node_clk");