aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/clk/clk-fixed-rate.c
diff options
context:
space:
mode:
authorStephen Boyd <sboyd@kernel.org>2019-08-30 08:09:18 -0700
committerStephen Boyd <sboyd@kernel.org>2020-01-06 23:07:34 -0800
commit58f0c4ba565d91bb76e8ac2a809e99bfe75b4935 (patch)
tree949c78d73b6de91d976540c9e77fe6c9174fa0de /drivers/clk/clk-fixed-rate.c
parentclk: fixed-rate: Add support for specifying parents via DT/pointers (diff)
downloadwireguard-linux-58f0c4ba565d91bb76e8ac2a809e99bfe75b4935.tar.xz
wireguard-linux-58f0c4ba565d91bb76e8ac2a809e99bfe75b4935.zip
clk: fixed-rate: Add clk flags for parent accuracy
Some clk providers want to use the accuracy of the parent clk and use the fixed rate basic type clk to do that. This requires getting the parent clk and extracting the accuracy before registering the fixed rate clk. Let's add a flag for this and update the clk_ops to support this. Cc: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Signed-off-by: Stephen Boyd <sboyd@kernel.org> Link: https://lkml.kernel.org/r/20190830150923.259497-8-sboyd@kernel.org
Diffstat (limited to 'drivers/clk/clk-fixed-rate.c')
-rw-r--r--drivers/clk/clk-fixed-rate.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/clk/clk-fixed-rate.c b/drivers/clk/clk-fixed-rate.c
index e11ccdaf14a6..77499a27c8fb 100644
--- a/drivers/clk/clk-fixed-rate.c
+++ b/drivers/clk/clk-fixed-rate.c
@@ -35,7 +35,12 @@ static unsigned long clk_fixed_rate_recalc_rate(struct clk_hw *hw,
static unsigned long clk_fixed_rate_recalc_accuracy(struct clk_hw *hw,
unsigned long parent_accuracy)
{
- return to_clk_fixed_rate(hw)->fixed_accuracy;
+ struct clk_fixed_rate *fixed = to_clk_fixed_rate(hw);
+
+ if (fixed->flags & CLK_FIXED_RATE_PARENT_ACCURACY)
+ return parent_accuracy;
+
+ return fixed->fixed_accuracy;
}
const struct clk_ops clk_fixed_rate_ops = {