clk: Add CLK_IS_BASIC flag to identify basic clocks
authorRajendra Nayak <rnayak@ti.com>
Fri, 1 Jun 2012 08:32:47 +0000 (14:02 +0530)
committerMike Turquette <mturquette@linaro.org>
Wed, 11 Jul 2012 22:36:43 +0000 (15:36 -0700)
Most platforms end up using a mix of basic clock types and
some which use clk_hw_foo struct for filling in custom platform
information when the clocks don't fit into basic types supported.

In platform code, its useful to know if a clock is using a basic
type or clk_hw_foo, which helps platforms know if they can
safely use to_clk_hw_foo to derive the clk_hw_foo pointer from
clk_hw.

Mark all basic clocks with a CLK_IS_BASIC flag.

Signed-off-by: Rajendra Nayak <rnayak@ti.com>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
drivers/clk/clk-divider.c
drivers/clk/clk-fixed-factor.c
drivers/clk/clk-fixed-rate.c
drivers/clk/clk-gate.c
drivers/clk/clk-mux.c
include/linux/clk-private.h
include/linux/clk-provider.h

index 02a4da98176bf85d5913985f6db7b47341c9f4b7..a9204c69148d6057faee157367b860a451958d68 100644 (file)
@@ -253,7 +253,7 @@ static struct clk *_register_divider(struct device *dev, const char *name,
 
        init.name = name;
        init.ops = &clk_divider_ops;
-       init.flags = flags;
+       init.flags = flags | CLK_IS_BASIC;
        init.parent_names = (parent_name ? &parent_name: NULL);
        init.num_parents = (parent_name ? 1 : 0);
 
index c8c003e217ad1db774ea2d5cb361176cecc237aa..a4899855c0f675bcc87a37adb40a56d6ae2b609b 100644 (file)
@@ -82,7 +82,7 @@ struct clk *clk_register_fixed_factor(struct device *dev, const char *name,
 
        init.name = name;
        init.ops = &clk_fixed_factor_ops;
-       init.flags = flags;
+       init.flags = flags | CLK_IS_BASIC;
        init.parent_names = &parent_name;
        init.num_parents = 1;
 
index cbd24622978660d3cd68899e91add03e3f80852d..7e1464569727b70b4c851b00c9798ffc34fb8d91 100644 (file)
@@ -63,7 +63,7 @@ struct clk *clk_register_fixed_rate(struct device *dev, const char *name,
 
        init.name = name;
        init.ops = &clk_fixed_rate_ops;
-       init.flags = flags;
+       init.flags = flags | CLK_IS_BASIC;
        init.parent_names = (parent_name ? &parent_name: NULL);
        init.num_parents = (parent_name ? 1 : 0);
 
index 578465e04be6b900c37009a7bfe3feb3c7506728..15114febfd923a4093c7b90b33be6e7754be27e7 100644 (file)
@@ -130,7 +130,7 @@ struct clk *clk_register_gate(struct device *dev, const char *name,
 
        init.name = name;
        init.ops = &clk_gate_ops;
-       init.flags = flags;
+       init.flags = flags | CLK_IS_BASIC;
        init.parent_names = (parent_name ? &parent_name: NULL);
        init.num_parents = (parent_name ? 1 : 0);
 
index fd36a8ea73d9968455b7edc565975c5fa590b88f..508c032edce43e43259ca88ecfd9b77dc5704ce8 100644 (file)
@@ -106,7 +106,7 @@ struct clk *clk_register_mux(struct device *dev, const char *name,
 
        init.name = name;
        init.ops = &clk_mux_ops;
-       init.flags = flags;
+       init.flags = flags | CLK_IS_BASIC;
        init.parent_names = parent_names;
        init.num_parents = num_parents;
 
index cc9972d1429c17d868ab54e81476944665f0c54b..9c7f5807824b82fcf94a25771de576fe1c8cf247 100644 (file)
@@ -64,7 +64,7 @@ struct clk {
                .parent_names = _parent_names,                  \
                .num_parents = ARRAY_SIZE(_parent_names),       \
                .parents = _parents,                            \
-               .flags = _flags,                                \
+               .flags = _flags | CLK_IS_BASIC,                 \
        }
 
 #define DEFINE_CLK_FIXED_RATE(_name, _flags, _rate,            \
index 79caee9f1489149af421e9d63e3a66266d7e8187..0236f58f3e6543879ad672d524878051f8b8b59f 100644 (file)
@@ -25,6 +25,7 @@
 #define CLK_SET_RATE_PARENT    BIT(2) /* propagate rate change up one level */
 #define CLK_IGNORE_UNUSED      BIT(3) /* do not gate even if unused */
 #define CLK_IS_ROOT            BIT(4) /* root clk, has no parent */
+#define CLK_IS_BASIC           BIT(5) /* Basic clk, can't do a to_clk_foo() */
 
 struct clk_hw;