blob: 1191bb725e5bcb7a376fb9e07e37031a8523101a [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
19#define CLKFLAG_RETAIN 0x00000040
20#define CLKFLAG_NORETAIN 0x00000080
21#define CLKFLAG_SKIP_HANDOFF 0x00000100
22#define CLKFLAG_MIN 0x00000400
23#define CLKFLAG_MAX 0x00000800
Saravana Kannanc85ecf92013-01-21 17:58:35 -080024#define CLKFLAG_INIT_DONE 0x00001000
25#define CLKFLAG_INIT_ERR 0x00002000
Matt Wagantall33d01f52012-02-23 23:27:44 -080026
27struct clk_lookup;
28struct clk;
Daniel Walker5e96da52010-05-12 13:43:28 -070029
30enum clk_reset_action {
31 CLK_RESET_DEASSERT = 0,
32 CLK_RESET_ASSERT = 1
33};
34
Daniel Walker5e96da52010-05-12 13:43:28 -070035/* Rate is maximum clock rate in Hz */
36int clk_set_max_rate(struct clk *clk, unsigned long rate);
37
38/* Assert/Deassert reset to a hardware block associated with a clock */
39int clk_reset(struct clk *clk, enum clk_reset_action action);
40
41/* Set clock-specific configuration parameters */
42int clk_set_flags(struct clk *clk, unsigned long flags);
43
44#endif