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

Commit 0d8060cd authored by David Dai's avatar David Dai Committed by Gerrit - the friendly Code Review server
Browse files

clk: add bus voting to rate_get, rate_set, enable_set debug functions



In addition to voting bandwidth for clk_summary, clk_show and
clk_print_reg, also add votes for clock debug rate_set, rate_get and
enable_set to allow access to the config space of multimedia
clock controllers including display, camera, and video.

Change-Id: Id3e56c80cc14c96b58c2c10dc713f0af056c790c
Signed-off-by: default avatarDavid Dai <daidavid1@codeaurora.org>
parent 25518a1e
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
@@ -3404,11 +3404,19 @@ static int clock_debug_rate_set(void *data, u64 val)
	struct clk_core *core = data;
	int ret;

	clk_prepare_lock();
	if (core->ops->bus_vote)
		core->ops->bus_vote(core->hw, true);

	ret = clk_set_rate(core->hw->clk, val);
	if (ret)
		pr_err("clk_set_rate(%lu) failed (%d)\n",
				(unsigned long)val, ret);

	if (core->ops->bus_vote)
		core->ops->bus_vote(core->hw, false);
	clk_prepare_unlock();

	return ret;
}

@@ -3416,8 +3424,16 @@ static int clock_debug_rate_get(void *data, u64 *val)
{
	struct clk_core *core = data;

	clk_prepare_lock();
	if (core->ops->bus_vote)
		core->ops->bus_vote(core->hw, true);

	*val = clk_get_rate(core->hw->clk);

	if (core->ops->bus_vote)
		core->ops->bus_vote(core->hw, false);
	clk_prepare_unlock();

	return 0;
}

@@ -3446,11 +3462,19 @@ static int clock_debug_enable_set(void *data, u64 val)
	struct clk_core *core = data;
	int rc = 0;

	clk_prepare_lock();
	if (core->ops->bus_vote)
		core->ops->bus_vote(core->hw, true);

	if (val)
		rc = clk_prepare_enable(core->hw->clk);
	else
		clk_disable_unprepare(core->hw->clk);

	if (core->ops->bus_vote)
		core->ops->bus_vote(core->hw, false);
	clk_prepare_unlock();

	return rc;
}