Paul Walmsley | d8a9445 | 2009-12-08 16:21:29 -0700 | [diff] [blame] | 1 | /* |
| 2 | * OMAP2 clock function prototypes and macros |
| 3 | * |
Paul Walmsley | 81b34fb | 2010-02-22 22:09:22 -0700 | [diff] [blame] | 4 | * Copyright (C) 2005-2010 Texas Instruments, Inc. |
| 5 | * Copyright (C) 2004-2010 Nokia Corporation |
Paul Walmsley | d8a9445 | 2009-12-08 16:21:29 -0700 | [diff] [blame] | 6 | */ |
| 7 | |
Paul Walmsley | 81b34fb | 2010-02-22 22:09:22 -0700 | [diff] [blame] | 8 | #ifndef __ARCH_ARM_MACH_OMAP2_CLOCK2XXX_H |
| 9 | #define __ARCH_ARM_MACH_OMAP2_CLOCK2XXX_H |
Paul Walmsley | d8a9445 | 2009-12-08 16:21:29 -0700 | [diff] [blame] | 10 | |
Rajendra Nayak | ed1ebc4 | 2012-04-27 15:59:32 +0530 | [diff] [blame] | 11 | #include <linux/clk-provider.h> |
| 12 | #include "clock.h" |
| 13 | |
| 14 | unsigned long omap2_table_mpu_recalc(struct clk_hw *clk, |
| 15 | unsigned long parent_rate); |
| 16 | int omap2_select_table_rate(struct clk_hw *hw, unsigned long rate, |
| 17 | unsigned long parent_rate); |
| 18 | long omap2_round_to_table_rate(struct clk_hw *hw, unsigned long rate, |
| 19 | unsigned long *parent_rate); |
| 20 | unsigned long omap2xxx_sys_clk_recalc(struct clk_hw *clk, |
| 21 | unsigned long parent_rate); |
| 22 | unsigned long omap2_osc_clk_recalc(struct clk_hw *clk, |
| 23 | unsigned long parent_rate); |
| 24 | unsigned long omap2_dpllcore_recalc(struct clk_hw *hw, |
| 25 | unsigned long parent_rate); |
| 26 | int omap2_reprogram_dpllcore(struct clk_hw *clk, unsigned long rate, |
| 27 | unsigned long parent_rate); |
| 28 | void omap2xxx_clkt_dpllcore_init(struct clk_hw *hw); |
Paul Walmsley | 7a2bd1c | 2012-09-14 23:18:20 -0600 | [diff] [blame] | 29 | unsigned long omap2_clk_apll54_recalc(struct clk_hw *hw, |
| 30 | unsigned long parent_rate); |
| 31 | unsigned long omap2_clk_apll96_recalc(struct clk_hw *hw, |
| 32 | unsigned long parent_rate); |
Paul Walmsley | 5f03937 | 2012-10-29 20:55:53 -0600 | [diff] [blame] | 33 | unsigned long omap2xxx_clk_get_core_rate(void); |
Paul Walmsley | 4921464 | 2010-01-26 20:13:06 -0700 | [diff] [blame] | 34 | u32 omap2xxx_get_apll_clkin(void); |
Paul Walmsley | 87a1b26 | 2010-01-26 20:13:07 -0700 | [diff] [blame] | 35 | u32 omap2xxx_get_sysclkdiv(void); |
Paul Walmsley | feec127 | 2010-01-26 20:13:11 -0700 | [diff] [blame] | 36 | void omap2xxx_clk_prepare_for_reboot(void); |
Paul Walmsley | baa689b | 2012-10-29 20:56:00 -0600 | [diff] [blame] | 37 | void omap2xxx_clkt_vps_check_bootloader_rates(void); |
| 38 | void omap2xxx_clkt_vps_late_init(void); |
Paul Walmsley | d8a9445 | 2009-12-08 16:21:29 -0700 | [diff] [blame] | 39 | |
Tony Lindgren | 59b479e | 2011-01-27 16:39:40 -0800 | [diff] [blame] | 40 | #ifdef CONFIG_SOC_OMAP2420 |
Paul Walmsley | 81b34fb | 2010-02-22 22:09:22 -0700 | [diff] [blame] | 41 | int omap2420_clk_init(void); |
Paul Walmsley | d8a9445 | 2009-12-08 16:21:29 -0700 | [diff] [blame] | 42 | #else |
Felipe Balbi | b481cea | 2011-03-09 18:44:28 -0700 | [diff] [blame] | 43 | #define omap2420_clk_init() do { } while(0) |
Paul Walmsley | d8a9445 | 2009-12-08 16:21:29 -0700 | [diff] [blame] | 44 | #endif |
| 45 | |
Tony Lindgren | 59b479e | 2011-01-27 16:39:40 -0800 | [diff] [blame] | 46 | #ifdef CONFIG_SOC_OMAP2430 |
Paul Walmsley | 81b34fb | 2010-02-22 22:09:22 -0700 | [diff] [blame] | 47 | int omap2430_clk_init(void); |
| 48 | #else |
Felipe Balbi | b481cea | 2011-03-09 18:44:28 -0700 | [diff] [blame] | 49 | #define omap2430_clk_init() do { } while(0) |
Paul Walmsley | 81b34fb | 2010-02-22 22:09:22 -0700 | [diff] [blame] | 50 | #endif |
| 51 | |
Paul Walmsley | b6ffa05 | 2012-10-29 20:56:17 -0600 | [diff] [blame] | 52 | extern void __iomem *prcm_clksrc_ctrl; |
Paul Walmsley | d8a9445 | 2009-12-08 16:21:29 -0700 | [diff] [blame] | 53 | |
Rajendra Nayak | ed1ebc4 | 2012-04-27 15:59:32 +0530 | [diff] [blame] | 54 | extern struct clk_hw *dclk_hw; |
| 55 | int omap2_enable_osc_ck(struct clk_hw *hw); |
| 56 | void omap2_disable_osc_ck(struct clk_hw *hw); |
| 57 | int omap2_clk_apll96_enable(struct clk_hw *hw); |
| 58 | int omap2_clk_apll54_enable(struct clk_hw *hw); |
| 59 | void omap2_clk_apll96_disable(struct clk_hw *hw); |
| 60 | void omap2_clk_apll54_disable(struct clk_hw *hw); |
Paul Walmsley | d8a9445 | 2009-12-08 16:21:29 -0700 | [diff] [blame] | 61 | |
| 62 | #endif |