diff options
author | Prashant Gaikwad <pgaikwad@nvidia.com> | 2013-01-04 02:00:52 -0500 |
---|---|---|
committer | Mike Turquette <mturquette@linaro.org> | 2013-01-24 14:09:28 -0500 |
commit | f2f6c2556dcc432e50003bc8fa4d62d95906f149 (patch) | |
tree | b0ffefa1b14c1c9a0435adbd81753cca9b6fed97 /include/linux/clk-provider.h | |
parent | 4cfe54e57910b59444d34a05284db27df416f20b (diff) |
clk: add common of_clk_init() function
Modify of_clk_init function so that it will determine which
driver to initialize based on device tree instead of each driver
registering to it.
Based on a similar patch for drivers/irqchip by Thomas Petazzoni and
drivers/clocksource by Stephen Warren.
Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Tested-by: Tony Prisk <linux@prisktech.co.nz>
Tested-by: Pawel Moll <pawel.moll@arm.com>
Tested-by: Rob Herring <rob.herring@calxeda.com>
Tested-by: Josh Cartwright <josh.cartwright@ni.com>
Reviewed-by: Josh Cartwright <josh.cartwright@ni.com>
Acked-by: Maxime Ripard <maxime.ripard@anandra.org>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
[mturquette@linaro.org: merge conflict from missing CLKSRC_OF_TABLES()]
Signed-off-by: Mike Turquette <mturquette@linaro.org>
Diffstat (limited to 'include/linux/clk-provider.h')
-rw-r--r-- | include/linux/clk-provider.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h index 4989b8a7bed1..7f197d7addb0 100644 --- a/include/linux/clk-provider.h +++ b/include/linux/clk-provider.h | |||
@@ -379,7 +379,13 @@ struct clk_onecell_data { | |||
379 | }; | 379 | }; |
380 | struct clk *of_clk_src_onecell_get(struct of_phandle_args *clkspec, void *data); | 380 | struct clk *of_clk_src_onecell_get(struct of_phandle_args *clkspec, void *data); |
381 | const char *of_clk_get_parent_name(struct device_node *np, int index); | 381 | const char *of_clk_get_parent_name(struct device_node *np, int index); |
382 | |||
382 | void of_clk_init(const struct of_device_id *matches); | 383 | void of_clk_init(const struct of_device_id *matches); |
383 | 384 | ||
385 | #define CLK_OF_DECLARE(name, compat, fn) \ | ||
386 | static const struct of_device_id __clk_of_table_##name \ | ||
387 | __used __section(__clk_of_table) \ | ||
388 | = { .compatible = compat, .data = fn }; | ||
389 | |||
384 | #endif /* CONFIG_COMMON_CLK */ | 390 | #endif /* CONFIG_COMMON_CLK */ |
385 | #endif /* CLK_PROVIDER_H */ | 391 | #endif /* CLK_PROVIDER_H */ |