diff options
author | Colin Cross <ccross@android.com> | 2011-02-12 19:05:31 -0500 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2011-02-21 03:10:11 -0500 |
commit | f151961173bf28047d01b410969f05e485f56d7e (patch) | |
tree | 02a9d357cf99d2002b98c8a18002322ef5c5c3d8 /arch/arm/mach-tegra/clock.h | |
parent | 3ec349fbf1e88e84d4dffc54b6cb32129a32b7b0 (diff) |
ARM: tegra: clock: Move unshared clk struct members into union
Creates a union of a struct for each type of clock to reduce memory
usage and clarify which members are used by all clocks and which are
used by a single type.
Acked-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Colin Cross <ccross@android.com>
Diffstat (limited to 'arch/arm/mach-tegra/clock.h')
-rw-r--r-- | arch/arm/mach-tegra/clock.h | 85 |
1 files changed, 44 insertions, 41 deletions
diff --git a/arch/arm/mach-tegra/clock.h b/arch/arm/mach-tegra/clock.h index 198f2344d02f..20f0ce69bbaf 100644 --- a/arch/arm/mach-tegra/clock.h +++ b/arch/arm/mach-tegra/clock.h | |||
@@ -47,7 +47,7 @@ struct clk_mux_sel { | |||
47 | u32 value; | 47 | u32 value; |
48 | }; | 48 | }; |
49 | 49 | ||
50 | struct clk_pll_table { | 50 | struct clk_pll_freq_table { |
51 | unsigned long input_rate; | 51 | unsigned long input_rate; |
52 | unsigned long output_rate; | 52 | unsigned long output_rate; |
53 | u16 n; | 53 | u16 n; |
@@ -74,51 +74,54 @@ enum clk_state { | |||
74 | 74 | ||
75 | struct clk { | 75 | struct clk { |
76 | /* node for master clocks list */ | 76 | /* node for master clocks list */ |
77 | struct list_head node; | 77 | struct list_head node; /* node for list of all clocks */ |
78 | struct list_head children; /* list of children */ | 78 | struct list_head children; /* list of children */ |
79 | struct list_head sibling; /* node for children */ | 79 | struct list_head sibling; /* node for children */ |
80 | #ifdef CONFIG_DEBUG_FS | 80 | struct clk_lookup lookup; |
81 | struct dentry *dent; | 81 | |
82 | struct dentry *parent_dent; | ||
83 | #endif | ||
84 | struct clk_ops *ops; | ||
85 | struct clk *parent; | ||
86 | struct clk_lookup lookup; | ||
87 | unsigned long rate; | ||
88 | unsigned long max_rate; | ||
89 | u32 flags; | ||
90 | u32 refcnt; | ||
91 | const char *name; | ||
92 | u32 reg; | ||
93 | u32 reg_shift; | ||
94 | unsigned int clk_num; | ||
95 | enum clk_state state; | ||
96 | #ifdef CONFIG_DEBUG_FS | 82 | #ifdef CONFIG_DEBUG_FS |
97 | bool set; | 83 | struct dentry *dent; |
84 | bool set; | ||
98 | #endif | 85 | #endif |
86 | struct clk_ops *ops; | ||
87 | unsigned long rate; | ||
88 | unsigned long max_rate; | ||
89 | u32 flags; | ||
90 | const char *name; | ||
91 | |||
92 | u32 refcnt; | ||
93 | enum clk_state state; | ||
94 | struct clk *parent; | ||
95 | u32 div; | ||
96 | u32 mul; | ||
99 | 97 | ||
100 | /* PLL */ | ||
101 | unsigned long input_min; | ||
102 | unsigned long input_max; | ||
103 | unsigned long cf_min; | ||
104 | unsigned long cf_max; | ||
105 | unsigned long vco_min; | ||
106 | unsigned long vco_max; | ||
107 | const struct clk_pll_table *pll_table; | ||
108 | int pll_lock_delay; | ||
109 | |||
110 | /* DIV */ | ||
111 | u32 div; | ||
112 | u32 mul; | ||
113 | |||
114 | /* MUX */ | ||
115 | const struct clk_mux_sel *inputs; | 98 | const struct clk_mux_sel *inputs; |
116 | u32 sel; | 99 | u32 reg; |
117 | u32 reg_mask; | 100 | u32 reg_shift; |
118 | 101 | ||
119 | /* Virtual cpu clock */ | 102 | union { |
120 | struct clk *main; | 103 | struct { |
121 | struct clk *backup; | 104 | unsigned int clk_num; |
105 | } periph; | ||
106 | struct { | ||
107 | unsigned long input_min; | ||
108 | unsigned long input_max; | ||
109 | unsigned long cf_min; | ||
110 | unsigned long cf_max; | ||
111 | unsigned long vco_min; | ||
112 | unsigned long vco_max; | ||
113 | const struct clk_pll_freq_table *freq_table; | ||
114 | int lock_delay; | ||
115 | } pll; | ||
116 | struct { | ||
117 | u32 sel; | ||
118 | u32 reg_mask; | ||
119 | } mux; | ||
120 | struct { | ||
121 | struct clk *main; | ||
122 | struct clk *backup; | ||
123 | } cpu; | ||
124 | } u; | ||
122 | }; | 125 | }; |
123 | 126 | ||
124 | 127 | ||