diff options
author | Arnd Bergmann <arnd@arndb.de> | 2015-02-03 11:59:32 -0500 |
---|---|---|
committer | Michael Turquette <mturquette@linaro.org> | 2015-02-03 14:06:11 -0500 |
commit | 6793a30a0646d2cc269e66782ca30c6025c92e1f (patch) | |
tree | e389df122d167bf98d297a1a77596c4b0b9ecb36 | |
parent | f85c6edfae0fea807956fd7890fc680414800cb7 (diff) |
clk: omap: compile legacy omap3 clocks conditionally
The 'ARM: OMAP3: legacy clock data move under clk driver' patch series
causes build errors when CONFIG_OMAP3 is not set:
drivers/clk/ti/dpll.c: In function 'ti_clk_register_dpll':
drivers/clk/ti/dpll.c:199:31: error: 'omap3_dpll_ck_ops' undeclared (first use in this function)
const struct clk_ops *ops = &omap3_dpll_ck_ops;
^
drivers/clk/ti/dpll.c:199:31: note: each undeclared identifier is reported only once for each function it appears in
drivers/clk/ti/dpll.c:259:10: error: 'omap3_dpll_per_ck_ops' undeclared (first use in this function)
ops = &omap3_dpll_per_ck_ops;
^
drivers/built-in.o: In function `ti_clk_register_gate':
drivers/clk/ti/gate.c:179: undefined reference to `clkhwops_omap3430es2_dss_usbhost_wait'
drivers/clk/ti/gate.c:179: undefined reference to `clkhwops_am35xx_ipss_module_wait'
-in.o: In function `ti_clk_register_interface':
drivers/clk/ti/interface.c:100: undefined reference to `clkhwops_omap3430es2_iclk_hsotgusb_wait'
drivers/clk/ti/interface.c:100: undefined reference to `clkhwops_omap3430es2_iclk_dss_usbhost_wait'
drivers/clk/ti/interface.c:100: undefined reference to `clkhwops_omap3430es2_iclk_ssi_wait'
drivers/clk/ti/interface.c:100: undefined reference to `clkhwops_am35xx_ipss_wait'
drivers/built-in.o: In function `ti_clk_register_composite':
:(.text+0x3da768): undefined reference to `ti_clk_build_component_gate'
In order to fix that problem, this patch makes the omap3 legacy code
compiled only when both CONFIG_OMAP3 and CONFIG_ATAGS are set.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Michael Turquette <mturquette@linaro.org>
-rw-r--r-- | drivers/clk/ti/Makefile | 6 | ||||
-rw-r--r-- | drivers/clk/ti/clk.c | 2 | ||||
-rw-r--r-- | drivers/clk/ti/composite.c | 2 | ||||
-rw-r--r-- | drivers/clk/ti/dpll.c | 2 | ||||
-rw-r--r-- | drivers/clk/ti/gate.c | 2 | ||||
-rw-r--r-- | drivers/clk/ti/interface.c | 2 | ||||
-rw-r--r-- | include/linux/clk/ti.h | 8 |
7 files changed, 22 insertions, 2 deletions
diff --git a/drivers/clk/ti/Makefile b/drivers/clk/ti/Makefile index 14e6686a5eea..105ffd0f5e79 100644 --- a/drivers/clk/ti/Makefile +++ b/drivers/clk/ti/Makefile | |||
@@ -1,4 +1,3 @@ | |||
1 | ifneq ($(CONFIG_OF),) | ||
2 | obj-y += clk.o autoidle.o clockdomain.o | 1 | obj-y += clk.o autoidle.o clockdomain.o |
3 | clk-common = dpll.o composite.o divider.o gate.o \ | 2 | clk-common = dpll.o composite.o divider.o gate.o \ |
4 | fixed-factor.o mux.o apll.o | 3 | fixed-factor.o mux.o apll.o |
@@ -6,10 +5,13 @@ obj-$(CONFIG_SOC_AM33XX) += $(clk-common) clk-33xx.o | |||
6 | obj-$(CONFIG_SOC_TI81XX) += $(clk-common) fapll.o clk-816x.o | 5 | obj-$(CONFIG_SOC_TI81XX) += $(clk-common) fapll.o clk-816x.o |
7 | obj-$(CONFIG_ARCH_OMAP2) += $(clk-common) interface.o clk-2xxx.o | 6 | obj-$(CONFIG_ARCH_OMAP2) += $(clk-common) interface.o clk-2xxx.o |
8 | obj-$(CONFIG_ARCH_OMAP3) += $(clk-common) interface.o \ | 7 | obj-$(CONFIG_ARCH_OMAP3) += $(clk-common) interface.o \ |
9 | clk-3xxx.o clk-3xxx-legacy.o | 8 | clk-3xxx.o |
10 | obj-$(CONFIG_ARCH_OMAP4) += $(clk-common) clk-44xx.o | 9 | obj-$(CONFIG_ARCH_OMAP4) += $(clk-common) clk-44xx.o |
11 | obj-$(CONFIG_SOC_OMAP5) += $(clk-common) clk-54xx.o | 10 | obj-$(CONFIG_SOC_OMAP5) += $(clk-common) clk-54xx.o |
12 | obj-$(CONFIG_SOC_DRA7XX) += $(clk-common) clk-7xx.o \ | 11 | obj-$(CONFIG_SOC_DRA7XX) += $(clk-common) clk-7xx.o \ |
13 | clk-dra7-atl.o | 12 | clk-dra7-atl.o |
14 | obj-$(CONFIG_SOC_AM43XX) += $(clk-common) clk-43xx.o | 13 | obj-$(CONFIG_SOC_AM43XX) += $(clk-common) clk-43xx.o |
14 | |||
15 | ifdef CONFIG_ATAGS | ||
16 | obj-$(CONFIG_ARCH_OMAP3) += clk-3xxx-legacy.o | ||
15 | endif | 17 | endif |
diff --git a/drivers/clk/ti/clk.c b/drivers/clk/ti/clk.c index 546dae405402..e22b95646e09 100644 --- a/drivers/clk/ti/clk.c +++ b/drivers/clk/ti/clk.c | |||
@@ -186,6 +186,7 @@ void ti_dt_clk_init_retry_clks(void) | |||
186 | } | 186 | } |
187 | } | 187 | } |
188 | 188 | ||
189 | #if defined(CONFIG_ARCH_OMAP3) && defined(CONFIG_ATAGS) | ||
189 | void __init ti_clk_patch_legacy_clks(struct ti_clk **patch) | 190 | void __init ti_clk_patch_legacy_clks(struct ti_clk **patch) |
190 | { | 191 | { |
191 | while (*patch) { | 192 | while (*patch) { |
@@ -308,3 +309,4 @@ int __init ti_clk_register_legacy_clks(struct ti_clk_alias *clks) | |||
308 | 309 | ||
309 | return 0; | 310 | return 0; |
310 | } | 311 | } |
312 | #endif | ||
diff --git a/drivers/clk/ti/composite.c b/drivers/clk/ti/composite.c index 3a9665fce041..3654f61912eb 100644 --- a/drivers/clk/ti/composite.c +++ b/drivers/clk/ti/composite.c | |||
@@ -118,6 +118,7 @@ static inline struct clk_hw *_get_hw(struct clk_hw_omap_comp *clk, int idx) | |||
118 | 118 | ||
119 | #define to_clk_hw_comp(_hw) container_of(_hw, struct clk_hw_omap_comp, hw) | 119 | #define to_clk_hw_comp(_hw) container_of(_hw, struct clk_hw_omap_comp, hw) |
120 | 120 | ||
121 | #if defined(CONFIG_ARCH_OMAP3) && defined(CONFIG_ATAGS) | ||
121 | struct clk *ti_clk_register_composite(struct ti_clk *setup) | 122 | struct clk *ti_clk_register_composite(struct ti_clk *setup) |
122 | { | 123 | { |
123 | struct ti_clk_composite *comp; | 124 | struct ti_clk_composite *comp; |
@@ -153,6 +154,7 @@ struct clk *ti_clk_register_composite(struct ti_clk *setup) | |||
153 | 154 | ||
154 | return clk; | 155 | return clk; |
155 | } | 156 | } |
157 | #endif | ||
156 | 158 | ||
157 | static void __init _register_composite(struct clk_hw *hw, | 159 | static void __init _register_composite(struct clk_hw *hw, |
158 | struct device_node *node) | 160 | struct device_node *node) |
diff --git a/drivers/clk/ti/dpll.c b/drivers/clk/ti/dpll.c index 47ebff772b13..81dc4698dc41 100644 --- a/drivers/clk/ti/dpll.c +++ b/drivers/clk/ti/dpll.c | |||
@@ -176,6 +176,7 @@ cleanup: | |||
176 | kfree(clk_hw); | 176 | kfree(clk_hw); |
177 | } | 177 | } |
178 | 178 | ||
179 | #if defined(CONFIG_ARCH_OMAP3) && defined(CONFIG_ATAGS) | ||
179 | void __iomem *_get_reg(u8 module, u16 offset) | 180 | void __iomem *_get_reg(u8 module, u16 offset) |
180 | { | 181 | { |
181 | u32 reg; | 182 | u32 reg; |
@@ -271,6 +272,7 @@ cleanup: | |||
271 | kfree(clk_hw); | 272 | kfree(clk_hw); |
272 | return clk; | 273 | return clk; |
273 | } | 274 | } |
275 | #endif | ||
274 | 276 | ||
275 | #if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5) || \ | 277 | #if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5) || \ |
276 | defined(CONFIG_SOC_DRA7XX) || defined(CONFIG_SOC_AM33XX) || \ | 278 | defined(CONFIG_SOC_DRA7XX) || defined(CONFIG_SOC_AM33XX) || \ |
diff --git a/drivers/clk/ti/gate.c b/drivers/clk/ti/gate.c index d4f6cb20e16e..d493307b73f4 100644 --- a/drivers/clk/ti/gate.c +++ b/drivers/clk/ti/gate.c | |||
@@ -130,6 +130,7 @@ static struct clk *_register_gate(struct device *dev, const char *name, | |||
130 | return clk; | 130 | return clk; |
131 | } | 131 | } |
132 | 132 | ||
133 | #if defined(CONFIG_ARCH_OMAP3) && defined(CONFIG_ATAGS) | ||
133 | struct clk *ti_clk_register_gate(struct ti_clk *setup) | 134 | struct clk *ti_clk_register_gate(struct ti_clk *setup) |
134 | { | 135 | { |
135 | const struct clk_ops *ops = &omap_gate_clk_ops; | 136 | const struct clk_ops *ops = &omap_gate_clk_ops; |
@@ -208,6 +209,7 @@ struct clk_hw *ti_clk_build_component_gate(struct ti_clk_gate *setup) | |||
208 | 209 | ||
209 | return &gate->hw; | 210 | return &gate->hw; |
210 | } | 211 | } |
212 | #endif | ||
211 | 213 | ||
212 | static void __init _of_ti_gate_clk_setup(struct device_node *node, | 214 | static void __init _of_ti_gate_clk_setup(struct device_node *node, |
213 | const struct clk_ops *ops, | 215 | const struct clk_ops *ops, |
diff --git a/drivers/clk/ti/interface.c b/drivers/clk/ti/interface.c index d71cd9b5de46..265d91f071c5 100644 --- a/drivers/clk/ti/interface.c +++ b/drivers/clk/ti/interface.c | |||
@@ -68,6 +68,7 @@ static struct clk *_register_interface(struct device *dev, const char *name, | |||
68 | return clk; | 68 | return clk; |
69 | } | 69 | } |
70 | 70 | ||
71 | #if defined(CONFIG_ARCH_OMAP3) && defined(CONFIG_ATAGS) | ||
71 | struct clk *ti_clk_register_interface(struct ti_clk *setup) | 72 | struct clk *ti_clk_register_interface(struct ti_clk *setup) |
72 | { | 73 | { |
73 | const struct clk_hw_omap_ops *ops = &clkhwops_iclk_wait; | 74 | const struct clk_hw_omap_ops *ops = &clkhwops_iclk_wait; |
@@ -98,6 +99,7 @@ struct clk *ti_clk_register_interface(struct ti_clk *setup) | |||
98 | return _register_interface(NULL, setup->name, gate->parent, | 99 | return _register_interface(NULL, setup->name, gate->parent, |
99 | (void __iomem *)reg, gate->bit_shift, ops); | 100 | (void __iomem *)reg, gate->bit_shift, ops); |
100 | } | 101 | } |
102 | #endif | ||
101 | 103 | ||
102 | static void __init _of_ti_interface_clk_setup(struct device_node *node, | 104 | static void __init _of_ti_interface_clk_setup(struct device_node *node, |
103 | const struct clk_hw_omap_ops *ops) | 105 | const struct clk_hw_omap_ops *ops) |
diff --git a/include/linux/clk/ti.h b/include/linux/clk/ti.h index 0eac65054283..67844003493d 100644 --- a/include/linux/clk/ti.h +++ b/include/linux/clk/ti.h | |||
@@ -360,9 +360,17 @@ extern const struct clk_hw_omap_ops clkhwops_omap3430es2_iclk_ssi_wait; | |||
360 | extern const struct clk_hw_omap_ops clkhwops_omap3430es2_iclk_dss_usbhost_wait; | 360 | extern const struct clk_hw_omap_ops clkhwops_omap3430es2_iclk_dss_usbhost_wait; |
361 | extern const struct clk_hw_omap_ops clkhwops_omap3430es2_iclk_hsotgusb_wait; | 361 | extern const struct clk_hw_omap_ops clkhwops_omap3430es2_iclk_hsotgusb_wait; |
362 | 362 | ||
363 | #ifdef CONFIG_ATAGS | ||
363 | int omap3430_clk_legacy_init(void); | 364 | int omap3430_clk_legacy_init(void); |
364 | int omap3430es1_clk_legacy_init(void); | 365 | int omap3430es1_clk_legacy_init(void); |
365 | int omap36xx_clk_legacy_init(void); | 366 | int omap36xx_clk_legacy_init(void); |
366 | int am35xx_clk_legacy_init(void); | 367 | int am35xx_clk_legacy_init(void); |
368 | #else | ||
369 | static inline int omap3430_clk_legacy_init(void) { return -ENXIO; } | ||
370 | static inline int omap3430es1_clk_legacy_init(void) { return -ENXIO; } | ||
371 | static inline int omap36xx_clk_legacy_init(void) { return -ENXIO; } | ||
372 | static inline int am35xx_clk_legacy_init(void) { return -ENXIO; } | ||
373 | #endif | ||
374 | |||
367 | 375 | ||
368 | #endif | 376 | #endif |