blob: 58581511d79576010be16a46e470e4b6a764ec06 [file] [log] [blame]
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001/*
2 * OMAP2 clock function prototypes and macros
3 *
Paul Walmsley81b34fb2010-02-22 22:09:22 -07004 * Copyright (C) 2005-2010 Texas Instruments, Inc.
5 * Copyright (C) 2004-2010 Nokia Corporation
Paul Walmsleyd8a94452009-12-08 16:21:29 -07006 */
7
Paul Walmsley81b34fb2010-02-22 22:09:22 -07008#ifndef __ARCH_ARM_MACH_OMAP2_CLOCK2XXX_H
9#define __ARCH_ARM_MACH_OMAP2_CLOCK2XXX_H
Paul Walmsleyd8a94452009-12-08 16:21:29 -070010
Rajendra Nayaked1ebc42012-04-27 15:59:32 +053011#ifdef CONFIG_COMMON_CLK
12#include <linux/clk-provider.h>
13#include "clock.h"
14
15unsigned long omap2_table_mpu_recalc(struct clk_hw *clk,
16 unsigned long parent_rate);
17int omap2_select_table_rate(struct clk_hw *hw, unsigned long rate,
18 unsigned long parent_rate);
19long omap2_round_to_table_rate(struct clk_hw *hw, unsigned long rate,
20 unsigned long *parent_rate);
21unsigned long omap2xxx_sys_clk_recalc(struct clk_hw *clk,
22 unsigned long parent_rate);
23unsigned long omap2_osc_clk_recalc(struct clk_hw *clk,
24 unsigned long parent_rate);
25unsigned long omap2_dpllcore_recalc(struct clk_hw *hw,
26 unsigned long parent_rate);
27int omap2_reprogram_dpllcore(struct clk_hw *clk, unsigned long rate,
28 unsigned long parent_rate);
29void omap2xxx_clkt_dpllcore_init(struct clk_hw *hw);
30#else
Paul Walmsleyd8a94452009-12-08 16:21:29 -070031unsigned long omap2_table_mpu_recalc(struct clk *clk);
32int omap2_select_table_rate(struct clk *clk, unsigned long rate);
33long omap2_round_to_table_rate(struct clk *clk, unsigned long rate);
Paul Walmsley44da0a52010-01-26 20:13:08 -070034unsigned long omap2xxx_sys_clk_recalc(struct clk *clk);
Paul Walmsleyd8a94452009-12-08 16:21:29 -070035unsigned long omap2_osc_clk_recalc(struct clk *clk);
Paul Walmsleyd8a94452009-12-08 16:21:29 -070036unsigned long omap2_dpllcore_recalc(struct clk *clk);
37int omap2_reprogram_dpllcore(struct clk *clk, unsigned long rate);
Rajendra Nayaked1ebc42012-04-27 15:59:32 +053038void omap2xxx_clkt_dpllcore_init(struct clk *clk);
39#endif
Paul Walmsley5f039372012-10-29 20:55:53 -060040unsigned long omap2xxx_clk_get_core_rate(void);
Paul Walmsley49214642010-01-26 20:13:06 -070041u32 omap2xxx_get_apll_clkin(void);
Paul Walmsley87a1b262010-01-26 20:13:07 -070042u32 omap2xxx_get_sysclkdiv(void);
Paul Walmsleyfeec1272010-01-26 20:13:11 -070043void omap2xxx_clk_prepare_for_reboot(void);
Paul Walmsleybaa689b2012-10-29 20:56:00 -060044void omap2xxx_clkt_vps_check_bootloader_rates(void);
45void omap2xxx_clkt_vps_late_init(void);
Paul Walmsleyd8a94452009-12-08 16:21:29 -070046
Tony Lindgren59b479e2011-01-27 16:39:40 -080047#ifdef CONFIG_SOC_OMAP2420
Paul Walmsley81b34fb2010-02-22 22:09:22 -070048int omap2420_clk_init(void);
Paul Walmsleyd8a94452009-12-08 16:21:29 -070049#else
Felipe Balbib481cea2011-03-09 18:44:28 -070050#define omap2420_clk_init() do { } while(0)
Paul Walmsleyd8a94452009-12-08 16:21:29 -070051#endif
52
Tony Lindgren59b479e2011-01-27 16:39:40 -080053#ifdef CONFIG_SOC_OMAP2430
Paul Walmsley81b34fb2010-02-22 22:09:22 -070054int omap2430_clk_init(void);
55#else
Felipe Balbib481cea2011-03-09 18:44:28 -070056#define omap2430_clk_init() do { } while(0)
Paul Walmsley81b34fb2010-02-22 22:09:22 -070057#endif
58
Paul Walmsleyb6ffa052012-10-29 20:56:17 -060059extern void __iomem *prcm_clksrc_ctrl;
Paul Walmsleyd8a94452009-12-08 16:21:29 -070060
Rajendra Nayaked1ebc42012-04-27 15:59:32 +053061#ifdef CONFIG_COMMON_CLK
62extern struct clk_hw *dclk_hw;
63int omap2_enable_osc_ck(struct clk_hw *hw);
64void omap2_disable_osc_ck(struct clk_hw *hw);
65int omap2_clk_apll96_enable(struct clk_hw *hw);
66int omap2_clk_apll54_enable(struct clk_hw *hw);
67void omap2_clk_apll96_disable(struct clk_hw *hw);
68void omap2_clk_apll54_disable(struct clk_hw *hw);
69#else
Paul Walmsleyd8a94452009-12-08 16:21:29 -070070extern const struct clkops clkops_omap2430_i2chs_wait;
71extern const struct clkops clkops_oscck;
72extern const struct clkops clkops_apll96;
73extern const struct clkops clkops_apll54;
Rajendra Nayaked1ebc42012-04-27 15:59:32 +053074#endif
Paul Walmsleyd8a94452009-12-08 16:21:29 -070075
76#endif