diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2024-02-15 13:18:35 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2024-02-16 13:11:23 +0100 |
commit | 2098731f7cf44cb04de503d355b3b52568554fab (patch) | |
tree | b80f58552aa543ae04dc1822af766ab8b8a33cd1 | |
parent | e90bf7a1c54b1b46d316cc0ca91e1355eb515b96 (diff) | |
download | barebox-2098731f7cf4.tar.gz barebox-2098731f7cf4.tar.xz |
clk: add dummy definitions for CLK_SET_RATE_GATE, CLK_SET_PARENT_GATE
CLK_SET_RATE_GATE and CLK_SET_PARENT_GATE mean that the clk itself or
its parent, respectively, needs to be gated before attempting a set
rate.
If this is not the case, the operation would fail in Linux with -EBUSY.
The usual way this is ported to barebox is by just omitting the flag,
because a well-behaving driver shouldn't be gating clocks before setting
rate anyway. Embrace this guard rail free life by defining the macros as
zero.
If in future, we decide to add them, we can always redefine them and
implement appropriate behavior.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20240215121837.251013-2-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | Documentation/devel/porting.rst | 1 | ||||
-rw-r--r-- | include/linux/clk.h | 5 |
2 files changed, 5 insertions, 1 deletions
diff --git a/Documentation/devel/porting.rst b/Documentation/devel/porting.rst index 4e14ace691..6d6cf059fc 100644 --- a/Documentation/devel/porting.rst +++ b/Documentation/devel/porting.rst @@ -391,7 +391,6 @@ Miscellaneous Linux porting advice: * ``jiffies``: use ``get_time_ns()`` * ``time_before``: use ``!is_timeout()`` * ``clk_hw_register_fixed_rate_with_accuracy``: use ``clk_hw_register_fixed_rate`` without accuracy - * ``CLK_SET_RATE_GATE`` can be ignored * ``clk_prepare``: is for the non-atomic code preparing for clk enablement. Merge it into ``clk_enable`` *************************** diff --git a/include/linux/clk.h b/include/linux/clk.h index 1bdfb21d50..d76f175bbd 100644 --- a/include/linux/clk.h +++ b/include/linux/clk.h @@ -240,6 +240,11 @@ static inline void clk_put(struct clk *clk) #define CLK_GATE_SET_TO_DISABLE (1 << 0) #define CLK_GATE_HIWORD_MASK (1 << 1) +/* Ignored sanity checking flags */ +#define CLK_SET_RATE_GATE 0 /* must be gated across rate change */ +#define CLK_SET_PARENT_GATE 0 /* must be gated across re-parent */ + + /** * struct clk_ops - Callback operations for hardware clocks; these are to * be provided by the clock implementation, and will be called by drivers |