]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
clk: ti: mux: convert TI mux clock to use its internal data representation
authorTero Kristo <t-kristo@ti.com>
Thu, 9 Feb 2017 12:40:40 +0000 (14:40 +0200)
committerTero Kristo <t-kristo@ti.com>
Wed, 8 Mar 2017 11:03:22 +0000 (13:03 +0200)
Instead of using the generic clock driver data struct, use one internal
for the TI clock driver itself. This allows modifying the register access
parts in subsequent patch.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
drivers/clk/ti/clock.h
drivers/clk/ti/mux.c

index cb906a199e66a714f43ec7771d270918f22c0354..41913bfa63a5a09f122d5e5819d4d82a6e66f470 100644 (file)
 #ifndef __DRIVERS_CLK_TI_CLOCK__
 #define __DRIVERS_CLK_TI_CLOCK__
 
+struct clk_omap_mux {
+       struct clk_hw           hw;
+       void __iomem            *reg;
+       u32                     *table;
+       u32                     mask;
+       u8                      shift;
+       u8                      flags;
+};
+
+#define to_clk_omap_mux(_hw) container_of(_hw, struct clk_omap_mux, hw)
+
 enum {
        TI_CLK_FIXED,
        TI_CLK_MUX,
index 3cc6db4b31fbd7e9afd7d7f088119217d8cc09ec..daa2dee6bafea6dc049613710123bc51c4100c8a 100644 (file)
@@ -28,7 +28,7 @@
 
 static u8 ti_clk_mux_get_parent(struct clk_hw *hw)
 {
-       struct clk_mux *mux = to_clk_mux(hw);
+       struct clk_omap_mux *mux = to_clk_omap_mux(hw);
        int num_parents = clk_hw_get_num_parents(hw);
        u32 val;
 
@@ -65,7 +65,7 @@ static u8 ti_clk_mux_get_parent(struct clk_hw *hw)
 
 static int ti_clk_mux_set_parent(struct clk_hw *hw, u8 index)
 {
-       struct clk_mux *mux = to_clk_mux(hw);
+       struct clk_omap_mux *mux = to_clk_omap_mux(hw);
        u32 val;
 
        if (mux->table) {
@@ -102,7 +102,7 @@ static struct clk *_register_mux(struct device *dev, const char *name,
                                 void __iomem *reg, u8 shift, u32 mask,
                                 u8 clk_mux_flags, u32 *table)
 {
-       struct clk_mux *mux;
+       struct clk_omap_mux *mux;
        struct clk *clk;
        struct clk_init_data init;
 
@@ -229,7 +229,7 @@ CLK_OF_DECLARE(mux_clk, "ti,mux-clock", of_mux_clk_setup);
 
 struct clk_hw *ti_clk_build_component_mux(struct ti_clk_mux *setup)
 {
-       struct clk_mux *mux;
+       struct clk_omap_mux *mux;
        struct clk_omap_reg *reg;
        int num_parents;
 
@@ -260,7 +260,7 @@ struct clk_hw *ti_clk_build_component_mux(struct ti_clk_mux *setup)
 
 static void __init of_ti_composite_mux_clk_setup(struct device_node *node)
 {
-       struct clk_mux *mux;
+       struct clk_omap_mux *mux;
        unsigned int num_parents;
        u32 val;