blob: fae0777d34e0fa78a47553bbec7bef91e139c9a2 [file] [log] [blame]
Saravana Kannanc85ecf92013-01-21 17:58:35 -08001/* Copyright (c) 2009, 2012-2013 The Linux Foundation. All rights reserved.
Daniel Walker5e96da52010-05-12 13:43:28 -07002 *
David Brown3162aa22011-02-14 16:15:26 -08003 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
Daniel Walker5e96da52010-05-12 13:43:28 -07006 *
David Brown3162aa22011-02-14 16:15:26 -08007 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
Daniel Walker5e96da52010-05-12 13:43:28 -070011 */
12#ifndef __MACH_CLK_H
13#define __MACH_CLK_H
14
Matt Wagantall33d01f52012-02-23 23:27:44 -080015#define CLKFLAG_INVERT 0x00000001
16#define CLKFLAG_NOINVERT 0x00000002
17#define CLKFLAG_NONEST 0x00000004
18#define CLKFLAG_NORESET 0x00000008
Matt Wagantall76377792013-04-10 19:37:58 -070019#define CLKFLAG_RETAIN_PERIPH 0x00000010
20#define CLKFLAG_NORETAIN_PERIPH 0x00000020
21#define CLKFLAG_RETAIN_MEM 0x00000040
22#define CLKFLAG_NORETAIN_MEM 0x00000080
Matt Wagantall33d01f52012-02-23 23:27:44 -080023#define CLKFLAG_SKIP_HANDOFF 0x00000100
24#define CLKFLAG_MIN 0x00000400
25#define CLKFLAG_MAX 0x00000800
Saravana Kannanc85ecf92013-01-21 17:58:35 -080026#define CLKFLAG_INIT_DONE 0x00001000
27#define CLKFLAG_INIT_ERR 0x00002000
Vikram Mulukutla0090eb12013-05-15 19:57:18 -070028#define CLKFLAG_NO_RATE_CACHE 0x00004000
Matt Wagantall33d01f52012-02-23 23:27:44 -080029
30struct clk_lookup;
31struct clk;
Daniel Walker5e96da52010-05-12 13:43:28 -070032
33enum clk_reset_action {
34 CLK_RESET_DEASSERT = 0,
35 CLK_RESET_ASSERT = 1
36};
37
Daniel Walker5e96da52010-05-12 13:43:28 -070038/* Rate is maximum clock rate in Hz */
39int clk_set_max_rate(struct clk *clk, unsigned long rate);
40
41/* Assert/Deassert reset to a hardware block associated with a clock */
42int clk_reset(struct clk *clk, enum clk_reset_action action);
43
44/* Set clock-specific configuration parameters */
45int clk_set_flags(struct clk *clk, unsigned long flags);
46
47#endif