diff options
author | Maxime Ripard <maxime@cerno.tech> | 2022-02-25 17:35:29 +0300 |
---|---|---|
committer | Stephen Boyd <sboyd@kernel.org> | 2022-03-12 06:15:03 +0300 |
commit | c97448437847bd76116b3a077e44808e946bb1ae (patch) | |
tree | ab81413331c8fc78080bb4c17b2a7d6c2c8bb3a0 /include/linux/clk.h | |
parent | c80ac50cbb378a4029129a596251747386e3c8e9 (diff) | |
download | linux-c97448437847bd76116b3a077e44808e946bb1ae.tar.xz |
clk: Add clk_drop_range
In order to reset the range on a clock, we need to call
clk_set_rate_range with a minimum of 0 and a maximum of ULONG_MAX. Since
it's fairly inconvenient, let's introduce a clk_drop_range() function
that will do just this.
Suggested-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://lore.kernel.org/r/20220225143534.405820-8-maxime@cerno.tech
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Diffstat (limited to 'include/linux/clk.h')
-rw-r--r-- | include/linux/clk.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/clk.h b/include/linux/clk.h index 266e8de3cb51..39faa54efe88 100644 --- a/include/linux/clk.h +++ b/include/linux/clk.h @@ -987,6 +987,17 @@ static inline void clk_bulk_disable_unprepare(int num_clks, } /** + * clk_drop_range - Reset any range set on that clock + * @clk: clock source + * + * Returns success (0) or negative errno. + */ +static inline int clk_drop_range(struct clk *clk) +{ + return clk_set_rate_range(clk, 0, ULONG_MAX); +} + +/** * clk_get_optional - lookup and obtain a reference to an optional clock * producer. * @dev: device for clock "consumer" |