net: smc91x: fix SMC accesses
[firefly-linux-kernel-4.4.55.git] / include / linux / clk-provider.h
index 3ecc07d0da7767555bbe21959c5540375a9a3859..7cd0171963ae174c37a1c69b325f9430f9e44904 100644 (file)
@@ -384,6 +384,7 @@ struct clk_divider {
 #define CLK_DIVIDER_MAX_AT_ZERO                BIT(6)
 
 extern const struct clk_ops clk_divider_ops;
+extern const struct clk_ops clk_divider_ro_ops;
 
 unsigned long divider_recalc_rate(struct clk_hw *hw, unsigned long parent_rate,
                unsigned int val, const struct clk_div_table *table,
@@ -500,13 +501,14 @@ struct clk *clk_register_fixed_factor(struct device *dev, const char *name,
  *
  * Clock with adjustable fractional divider affecting its output frequency.
  */
-
 struct clk_fractional_divider {
        struct clk_hw   hw;
        void __iomem    *reg;
        u8              mshift;
+       u8              mwidth;
        u32             mmask;
        u8              nshift;
+       u8              nwidth;
        u32             nmask;
        u8              flags;
        spinlock_t      *lock;
@@ -518,6 +520,41 @@ struct clk *clk_register_fractional_divider(struct device *dev,
                void __iomem *reg, u8 mshift, u8 mwidth, u8 nshift, u8 nwidth,
                u8 clk_divider_flags, spinlock_t *lock);
 
+/**
+ * struct clk_multiplier - adjustable multiplier clock
+ *
+ * @hw:                handle between common and hardware-specific interfaces
+ * @reg:       register containing the multiplier
+ * @shift:     shift to the multiplier bit field
+ * @width:     width of the multiplier bit field
+ * @lock:      register lock
+ *
+ * Clock with an adjustable multiplier affecting its output frequency.
+ * Implements .recalc_rate, .set_rate and .round_rate
+ *
+ * Flags:
+ * CLK_MULTIPLIER_ZERO_BYPASS - By default, the multiplier is the value read
+ *     from the register, with 0 being a valid value effectively
+ *     zeroing the output clock rate. If CLK_MULTIPLIER_ZERO_BYPASS is
+ *     set, then a null multiplier will be considered as a bypass,
+ *     leaving the parent rate unmodified.
+ * CLK_MULTIPLIER_ROUND_CLOSEST - Makes the best calculated divider to be
+ *     rounded to the closest integer instead of the down one.
+ */
+struct clk_multiplier {
+       struct clk_hw   hw;
+       void __iomem    *reg;
+       u8              shift;
+       u8              width;
+       u8              flags;
+       spinlock_t      *lock;
+};
+
+#define CLK_MULTIPLIER_ZERO_BYPASS             BIT(0)
+#define CLK_MULTIPLIER_ROUND_CLOSEST   BIT(1)
+
+extern const struct clk_ops clk_multiplier_ops;
+
 /***
  * struct clk_composite - aggregate clock of mux, divider and gate clocks
  *
@@ -606,7 +643,7 @@ void clk_unregister(struct clk *clk);
 void devm_clk_unregister(struct device *dev, struct clk *clk);
 
 /* helper functions */
-const char *__clk_get_name(struct clk *clk);
+const char *__clk_get_name(const struct clk *clk);
 const char *clk_hw_get_name(const struct clk_hw *hw);
 struct clk_hw *__clk_get_hw(struct clk *clk);
 unsigned int clk_hw_get_num_parents(const struct clk_hw *hw);
@@ -618,6 +655,7 @@ unsigned long clk_hw_get_rate(const struct clk_hw *hw);
 unsigned long __clk_get_flags(struct clk *clk);
 unsigned long clk_hw_get_flags(const struct clk_hw *hw);
 bool clk_hw_is_prepared(const struct clk_hw *hw);
+bool clk_hw_is_enabled(const struct clk_hw *hw);
 bool __clk_is_enabled(struct clk *clk);
 struct clk *__clk_lookup(const char *name);
 int __clk_mux_determine_rate(struct clk_hw *hw,
@@ -690,6 +728,15 @@ static inline struct clk *of_clk_src_onecell_get(
 {
        return ERR_PTR(-ENOENT);
 }
+static inline int of_clk_get_parent_count(struct device_node *np)
+{
+       return 0;
+}
+static inline int of_clk_parent_fill(struct device_node *np,
+                                    const char **parents, unsigned int size)
+{
+       return 0;
+}
 static inline const char *of_clk_get_parent_name(struct device_node *np,
                                                 int index)
 {