diff options
| author | Gerhard Sittig <gsi@denx.de> | 2013-07-22 08:14:40 -0400 |
|---|---|---|
| committer | Mike Turquette <mturquette@linaro.org> | 2013-08-27 20:50:38 -0400 |
| commit | aa514ce34b65e3dc01f95a0b470b39bbb7e09998 (patch) | |
| tree | 6d83d3f8e7560e5cd46fafe39960cd78cdfdc815 /include/linux/clk-provider.h | |
| parent | 29f79cb713c5173457b80602adab357403f22c48 (diff) | |
clk: wrap I/O access for improved portability
the common clock drivers were motivated/initiated by ARM development
and apparently assume little endian peripherals
wrap register/peripherals access in the common code (div, gate, mux)
in preparation of adding COMMON_CLK support for other platforms
Signed-off-by: Gerhard Sittig <gsi@denx.de>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
Diffstat (limited to 'include/linux/clk-provider.h')
| -rw-r--r-- | include/linux/clk-provider.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h index 1f0285b2f422..73bdb69f0c08 100644 --- a/include/linux/clk-provider.h +++ b/include/linux/clk-provider.h | |||
| @@ -12,6 +12,7 @@ | |||
| 12 | #define __LINUX_CLK_PROVIDER_H | 12 | #define __LINUX_CLK_PROVIDER_H |
| 13 | 13 | ||
| 14 | #include <linux/clk.h> | 14 | #include <linux/clk.h> |
| 15 | #include <linux/io.h> | ||
| 15 | 16 | ||
| 16 | #ifdef CONFIG_COMMON_CLK | 17 | #ifdef CONFIG_COMMON_CLK |
| 17 | 18 | ||
| @@ -504,5 +505,21 @@ static inline const char *of_clk_get_parent_name(struct device_node *np, | |||
| 504 | #define of_clk_init(matches) \ | 505 | #define of_clk_init(matches) \ |
| 505 | { while (0); } | 506 | { while (0); } |
| 506 | #endif /* CONFIG_OF */ | 507 | #endif /* CONFIG_OF */ |
| 508 | |||
| 509 | /* | ||
| 510 | * wrap access to peripherals in accessor routines | ||
| 511 | * for improved portability across platforms | ||
| 512 | */ | ||
| 513 | |||
| 514 | static inline u32 clk_readl(u32 __iomem *reg) | ||
| 515 | { | ||
| 516 | return readl(reg); | ||
| 517 | } | ||
| 518 | |||
| 519 | static inline void clk_writel(u32 val, u32 __iomem *reg) | ||
| 520 | { | ||
| 521 | writel(val, reg); | ||
| 522 | } | ||
| 523 | |||
| 507 | #endif /* CONFIG_COMMON_CLK */ | 524 | #endif /* CONFIG_COMMON_CLK */ |
| 508 | #endif /* CLK_PROVIDER_H */ | 525 | #endif /* CLK_PROVIDER_H */ |
