blob: 539dc08afbbaf3cb93536f600a5bb930b35d7d55 [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);
24unsigned long omap2_dpllcore_recalc(struct clk_hw *hw,
25 unsigned long parent_rate);
26int omap2_reprogram_dpllcore(struct clk_hw *clk, unsigned long rate,
27 unsigned long parent_rate);
28void omap2xxx_clkt_dpllcore_init(struct clk_hw *hw);
Paul Walmsley7a2bd1c2012-09-14 23:18:20 -060029unsigned long omap2_clk_apll54_recalc(struct clk_hw *hw,
30 unsigned long parent_rate);
31unsigned long omap2_clk_apll96_recalc(struct clk_hw *hw,
32 unsigned long parent_rate);
Paul Walmsley5f039372012-10-29 20:55:53 -060033unsigned long omap2xxx_clk_get_core_rate(void);
Paul Walmsley49214642010-01-26 20:13:06 -070034u32 omap2xxx_get_apll_clkin(void);
Paul Walmsley87a1b262010-01-26 20:13:07 -070035u32 omap2xxx_get_sysclkdiv(void);
Paul Walmsleyfeec1272010-01-26 20:13:11 -070036void omap2xxx_clk_prepare_for_reboot(void);
Paul Walmsleybaa689b2012-10-29 20:56:00 -060037void omap2xxx_clkt_vps_check_bootloader_rates(void);
38void omap2xxx_clkt_vps_late_init(void);
Paul Walmsleyd8a94452009-12-08 16:21:29 -070039
Tony Lindgren59b479e2011-01-27 16:39:40 -080040#ifdef CONFIG_SOC_OMAP2420
Paul Walmsley81b34fb2010-02-22 22:09:22 -070041int omap2420_clk_init(void);
Paul Walmsleyd8a94452009-12-08 16:21:29 -070042#else
Felipe Balbib481cea2011-03-09 18:44:28 -070043#define omap2420_clk_init() do { } while(0)
Paul Walmsleyd8a94452009-12-08 16:21:29 -070044#endif
45
Tony Lindgren59b479e2011-01-27 16:39:40 -080046#ifdef CONFIG_SOC_OMAP2430
Paul Walmsley81b34fb2010-02-22 22:09:22 -070047int omap2430_clk_init(void);
48#else
Felipe Balbib481cea2011-03-09 18:44:28 -070049#define omap2430_clk_init() do { } while(0)
Paul Walmsley81b34fb2010-02-22 22:09:22 -070050#endif
51
Paul Walmsleyb6ffa052012-10-29 20:56:17 -060052extern void __iomem *prcm_clksrc_ctrl;
Paul Walmsleyd8a94452009-12-08 16:21:29 -070053
Rajendra Nayaked1ebc42012-04-27 15:59:32 +053054extern struct clk_hw *dclk_hw;
55int omap2_enable_osc_ck(struct clk_hw *hw);
56void omap2_disable_osc_ck(struct clk_hw *hw);
57int omap2_clk_apll96_enable(struct clk_hw *hw);
58int omap2_clk_apll54_enable(struct clk_hw *hw);
59void omap2_clk_apll96_disable(struct clk_hw *hw);
60void omap2_clk_apll54_disable(struct clk_hw *hw);
Paul Walmsleyd8a94452009-12-08 16:21:29 -070061
62#endif