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: David Dai <daidavid1@codeaurora.org>
This commit is contained in:
committed by
Gerrit - the friendly Code Review server
parent
25518a1eb2
commit
0d8060cd6b
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user