blob: a090225ceeba9d1f09a79b34c5b763da363ae4a0 [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#include <linux/clk-provider.h>
12#include "clock.h"
13
14unsigned long omap2_table_mpu_recalc(struct clk_hw *clk,
15 unsigned long parent_rate);
16int omap2_select_table_rate(struct clk_hw *hw, unsigned long rate,
17 unsigned long parent_rate);
18long omap2_round_to_table_rate(struct clk_hw *hw, unsigned long rate,
19 unsigned long *parent_rate);
20unsigned long omap2xxx_sys_clk_recalc(struct clk_hw *clk,
21 unsigned long parent_rate);
22unsigned long omap2_osc_clk_recalc(struct clk_hw *clk,
23 unsigned long parent_rate);
Rajendra Nayaked1ebc42012-04-27 15:59:32 +053024void omap2xxx_clkt_dpllcore_init(struct clk_hw *hw);
Paul Walmsley7a2bd1c2012-09-14 23:18:20 -060025unsigned long omap2_clk_apll54_recalc(struct clk_hw *hw,
26 unsigned long parent_rate);
27unsigned long omap2_clk_apll96_recalc(struct clk_hw *hw,
28 unsigned long parent_rate);
Paul Walmsley5f039372012-10-29 20:55:53 -060029unsigned long omap2xxx_clk_get_core_rate(void);
Paul Walmsley49214642010-01-26 20:13:06 -070030u32 omap2xxx_get_apll_clkin(void);
Paul Walmsley87a1b262010-01-26 20:13:07 -070031u32 omap2xxx_get_sysclkdiv(void);
Paul Walmsleyfeec1272010-01-26 20:13:11 -070032void omap2xxx_clk_prepare_for_reboot(void);
Paul Walmsleybaa689b2012-10-29 20:56:00 -060033void omap2xxx_clkt_vps_check_bootloader_rates(void);
34void omap2xxx_clkt_vps_late_init(void);
Paul Walmsleyd8a94452009-12-08 16:21:29 -070035
Tony Lindgren59b479e2011-01-27 16:39:40 -080036#ifdef CONFIG_SOC_OMAP2420
Paul Walmsley81b34fb2010-02-22 22:09:22 -070037int omap2420_clk_init(void);
Paul Walmsleyd8a94452009-12-08 16:21:29 -070038#else
Felipe Balbib481cea2011-03-09 18:44:28 -070039#define omap2420_clk_init() do { } while(0)
Paul Walmsleyd8a94452009-12-08 16:21:29 -070040#endif
41
Tony Lindgren59b479e2011-01-27 16:39:40 -080042#ifdef CONFIG_SOC_OMAP2430
Paul Walmsley81b34fb2010-02-22 22:09:22 -070043int omap2430_clk_init(void);
44#else
Felipe Balbib481cea2011-03-09 18:44:28 -070045#define omap2430_clk_init() do { } while(0)
Paul Walmsley81b34fb2010-02-22 22:09:22 -070046#endif
47
Rajendra Nayaked1ebc42012-04-27 15:59:32 +053048extern struct clk_hw *dclk_hw;
49int omap2_enable_osc_ck(struct clk_hw *hw);
50void omap2_disable_osc_ck(struct clk_hw *hw);
51int omap2_clk_apll96_enable(struct clk_hw *hw);
52int omap2_clk_apll54_enable(struct clk_hw *hw);
53void omap2_clk_apll96_disable(struct clk_hw *hw);
54void omap2_clk_apll54_disable(struct clk_hw *hw);
Paul Walmsleyd8a94452009-12-08 16:21:29 -070055
56#endif