@@ -953,6 +953,24 @@ int clk_enable(struct clk *clk)
EXPORT_SYMBOL_GPL(clk_enable);
/**
+ * clk_is_enabled - return the enabled state of a clk
+ * @clk: the clk whose enabled state gets returned
+ *
+ * Returns true if the clock is enabled, false otherwise.
+ */
+bool clk_is_enabled(struct clk *clk)
+{
+ bool is_en;
+
+ clk_prepare_lock();
+ is_en = __clk_is_enabled(clk);
+ clk_prepare_unlock();
+
+ return is_en;
+}
+EXPORT_SYMBOL_GPL(clk_is_enabled);
+
+/**
* __clk_round_rate - round the given rate for a clk
* @clk: round the rate of this clock
* @rate: the rate which is to be rounded
@@ -218,6 +218,14 @@ int clk_enable(struct clk *clk);
void clk_disable(struct clk *clk);
/**
+ * clk_is_enabled - return the enabled state of a clk
+ * @clk: the clk whose enabled state gets returned
+ *
+ * Returns true if the clock is enabled, false otherwise.
+ */
+bool clk_is_enabled(struct clk *clk);
+
+/**
* clk_get_rate - obtain the current clock rate (in Hz) for a clock source.
* This is only valid once the clock source has been enabled.
* @clk: clock source
@@ -330,6 +338,11 @@ static inline int clk_enable(struct clk *clk)
static inline void clk_disable(struct clk *clk) {}
+static inline bool clk_is_enabled(struct clk *clk)
+{
+ return false;
+}
+
static inline unsigned long clk_get_rate(struct clk *clk)
{
return 0;