diff options
-rw-r--r-- | include/linux/clk-provider.h | 47 |
1 files changed, 39 insertions, 8 deletions
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h index 11860985fecb..265f384f1e01 100644 --- a/include/linux/clk-provider.h +++ b/include/linux/clk-provider.h | |||
@@ -423,6 +423,17 @@ struct of_device_id; | |||
423 | 423 | ||
424 | typedef void (*of_clk_init_cb_t)(struct device_node *); | 424 | typedef void (*of_clk_init_cb_t)(struct device_node *); |
425 | 425 | ||
426 | struct clk_onecell_data { | ||
427 | struct clk **clks; | ||
428 | unsigned int clk_num; | ||
429 | }; | ||
430 | |||
431 | #define CLK_OF_DECLARE(name, compat, fn) \ | ||
432 | static const struct of_device_id __clk_of_table_##name \ | ||
433 | __used __section(__clk_of_table) \ | ||
434 | = { .compatible = compat, .data = fn }; | ||
435 | |||
436 | #ifdef CONFIG_OF | ||
426 | int of_clk_add_provider(struct device_node *np, | 437 | int of_clk_add_provider(struct device_node *np, |
427 | struct clk *(*clk_src_get)(struct of_phandle_args *args, | 438 | struct clk *(*clk_src_get)(struct of_phandle_args *args, |
428 | void *data), | 439 | void *data), |
@@ -430,19 +441,39 @@ int of_clk_add_provider(struct device_node *np, | |||
430 | void of_clk_del_provider(struct device_node *np); | 441 | void of_clk_del_provider(struct device_node *np); |
431 | struct clk *of_clk_src_simple_get(struct of_phandle_args *clkspec, | 442 | struct clk *of_clk_src_simple_get(struct of_phandle_args *clkspec, |
432 | void *data); | 443 | void *data); |
433 | struct clk_onecell_data { | ||
434 | struct clk **clks; | ||
435 | unsigned int clk_num; | ||
436 | }; | ||
437 | struct clk *of_clk_src_onecell_get(struct of_phandle_args *clkspec, void *data); | 444 | struct clk *of_clk_src_onecell_get(struct of_phandle_args *clkspec, void *data); |
438 | const char *of_clk_get_parent_name(struct device_node *np, int index); | 445 | const char *of_clk_get_parent_name(struct device_node *np, int index); |
439 | 446 | ||
440 | void of_clk_init(const struct of_device_id *matches); | 447 | void of_clk_init(const struct of_device_id *matches); |
441 | 448 | ||
442 | #define CLK_OF_DECLARE(name, compat, fn) \ | 449 | #else /* !CONFIG_OF */ |
443 | static const struct of_device_id __clk_of_table_##name \ | ||
444 | __used __section(__clk_of_table) \ | ||
445 | = { .compatible = compat, .data = fn }; | ||
446 | 450 | ||
451 | static inline int of_clk_add_provider(struct device_node *np, | ||
452 | struct clk *(*clk_src_get)(struct of_phandle_args *args, | ||
453 | void *data), | ||
454 | void *data) | ||
455 | { | ||
456 | return 0; | ||
457 | } | ||
458 | #define of_clk_del_provider(np) \ | ||
459 | { while (0); } | ||
460 | static inline struct clk *of_clk_src_simple_get( | ||
461 | struct of_phandle_args *clkspec, void *data) | ||
462 | { | ||
463 | return ERR_PTR(-ENOENT); | ||
464 | } | ||
465 | static inline struct clk *of_clk_src_onecell_get( | ||
466 | struct of_phandle_args *clkspec, void *data) | ||
467 | { | ||
468 | return ERR_PTR(-ENOENT); | ||
469 | } | ||
470 | static inline const char *of_clk_get_parent_name(struct device_node *np, | ||
471 | int index) | ||
472 | { | ||
473 | return NULL; | ||
474 | } | ||
475 | #define of_clk_init(matches) \ | ||
476 | { while (0); } | ||
477 | #endif /* CONFIG_OF */ | ||
447 | #endif /* CONFIG_COMMON_CLK */ | 478 | #endif /* CONFIG_COMMON_CLK */ |
448 | #endif /* CLK_PROVIDER_H */ | 479 | #endif /* CLK_PROVIDER_H */ |