Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6793a30a authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Michael Turquette
Browse files

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: default avatarArnd Bergmann <arnd@arndb.de>
Acked-by: default avatarTony Lindgren <tony@atomide.com>
Signed-off-by: default avatarMichael Turquette <mturquette@linaro.org>
parent f85c6edf
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
ifneq ($(CONFIG_OF),)
obj-y					+= clk.o autoidle.o clockdomain.o
obj-y					+= clk.o autoidle.o clockdomain.o
clk-common				= dpll.o composite.o divider.o gate.o \
clk-common				= dpll.o composite.o divider.o gate.o \
					  fixed-factor.o mux.o apll.o
					  fixed-factor.o mux.o apll.o
@@ -6,10 +5,13 @@ obj-$(CONFIG_SOC_AM33XX) += $(clk-common) clk-33xx.o
obj-$(CONFIG_SOC_TI81XX)		+= $(clk-common) fapll.o clk-816x.o
obj-$(CONFIG_SOC_TI81XX)		+= $(clk-common) fapll.o clk-816x.o
obj-$(CONFIG_ARCH_OMAP2)		+= $(clk-common) interface.o clk-2xxx.o
obj-$(CONFIG_ARCH_OMAP2)		+= $(clk-common) interface.o clk-2xxx.o
obj-$(CONFIG_ARCH_OMAP3)		+= $(clk-common) interface.o \
obj-$(CONFIG_ARCH_OMAP3)		+= $(clk-common) interface.o \
					   clk-3xxx.o clk-3xxx-legacy.o
					   clk-3xxx.o
obj-$(CONFIG_ARCH_OMAP4)		+= $(clk-common) clk-44xx.o
obj-$(CONFIG_ARCH_OMAP4)		+= $(clk-common) clk-44xx.o
obj-$(CONFIG_SOC_OMAP5)			+= $(clk-common) clk-54xx.o
obj-$(CONFIG_SOC_OMAP5)			+= $(clk-common) clk-54xx.o
obj-$(CONFIG_SOC_DRA7XX)		+= $(clk-common) clk-7xx.o \
obj-$(CONFIG_SOC_DRA7XX)		+= $(clk-common) clk-7xx.o \
					   clk-dra7-atl.o
					   clk-dra7-atl.o
obj-$(CONFIG_SOC_AM43XX)		+= $(clk-common) clk-43xx.o
obj-$(CONFIG_SOC_AM43XX)		+= $(clk-common) clk-43xx.o

ifdef CONFIG_ATAGS
obj-$(CONFIG_ARCH_OMAP3)                += clk-3xxx-legacy.o
endif
endif
+2 −0
Original line number Original line Diff line number Diff line
@@ -186,6 +186,7 @@ void ti_dt_clk_init_retry_clks(void)
	}
	}
}
}


#if defined(CONFIG_ARCH_OMAP3) && defined(CONFIG_ATAGS)
void __init ti_clk_patch_legacy_clks(struct ti_clk **patch)
void __init ti_clk_patch_legacy_clks(struct ti_clk **patch)
{
{
	while (*patch) {
	while (*patch) {
@@ -308,3 +309,4 @@ int __init ti_clk_register_legacy_clks(struct ti_clk_alias *clks)


	return 0;
	return 0;
}
}
#endif
+2 −0
Original line number Original line Diff line number Diff line
@@ -118,6 +118,7 @@ static inline struct clk_hw *_get_hw(struct clk_hw_omap_comp *clk, int idx)


#define to_clk_hw_comp(_hw) container_of(_hw, struct clk_hw_omap_comp, hw)
#define to_clk_hw_comp(_hw) container_of(_hw, struct clk_hw_omap_comp, hw)


#if defined(CONFIG_ARCH_OMAP3) && defined(CONFIG_ATAGS)
struct clk *ti_clk_register_composite(struct ti_clk *setup)
struct clk *ti_clk_register_composite(struct ti_clk *setup)
{
{
	struct ti_clk_composite *comp;
	struct ti_clk_composite *comp;
@@ -153,6 +154,7 @@ struct clk *ti_clk_register_composite(struct ti_clk *setup)


	return clk;
	return clk;
}
}
#endif


static void __init _register_composite(struct clk_hw *hw,
static void __init _register_composite(struct clk_hw *hw,
				       struct device_node *node)
				       struct device_node *node)
+2 −0
Original line number Original line Diff line number Diff line
@@ -176,6 +176,7 @@ static void __init _register_dpll(struct clk_hw *hw,
	kfree(clk_hw);
	kfree(clk_hw);
}
}


#if defined(CONFIG_ARCH_OMAP3) && defined(CONFIG_ATAGS)
void __iomem *_get_reg(u8 module, u16 offset)
void __iomem *_get_reg(u8 module, u16 offset)
{
{
	u32 reg;
	u32 reg;
@@ -271,6 +272,7 @@ struct clk *ti_clk_register_dpll(struct ti_clk *setup)
	kfree(clk_hw);
	kfree(clk_hw);
	return clk;
	return clk;
}
}
#endif


#if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5) || \
#if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5) || \
	defined(CONFIG_SOC_DRA7XX) || defined(CONFIG_SOC_AM33XX) || \
	defined(CONFIG_SOC_DRA7XX) || defined(CONFIG_SOC_AM33XX) || \
+2 −0
Original line number Original line Diff line number Diff line
@@ -130,6 +130,7 @@ static struct clk *_register_gate(struct device *dev, const char *name,
	return clk;
	return clk;
}
}


#if defined(CONFIG_ARCH_OMAP3) && defined(CONFIG_ATAGS)
struct clk *ti_clk_register_gate(struct ti_clk *setup)
struct clk *ti_clk_register_gate(struct ti_clk *setup)
{
{
	const struct clk_ops *ops = &omap_gate_clk_ops;
	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)


	return &gate->hw;
	return &gate->hw;
}
}
#endif


static void __init _of_ti_gate_clk_setup(struct device_node *node,
static void __init _of_ti_gate_clk_setup(struct device_node *node,
					 const struct clk_ops *ops,
					 const struct clk_ops *ops,
Loading