Saravana Kannan | c85ecf9 | 2013-01-21 17:58:35 -0800 | [diff] [blame] | 1 | /* Copyright (c) 2009, 2012-2013 The Linux Foundation. All rights reserved. |
Daniel Walker | 5e96da5 | 2010-05-12 13:43:28 -0700 | [diff] [blame] | 2 | * |
David Brown | 3162aa2 | 2011-02-14 16:15:26 -0800 | [diff] [blame] | 3 | * 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 Walker | 5e96da5 | 2010-05-12 13:43:28 -0700 | [diff] [blame] | 6 | * |
David Brown | 3162aa2 | 2011-02-14 16:15:26 -0800 | [diff] [blame] | 7 | * 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 Walker | 5e96da5 | 2010-05-12 13:43:28 -0700 | [diff] [blame] | 11 | */ |
| 12 | #ifndef __MACH_CLK_H |
| 13 | #define __MACH_CLK_H |
| 14 | |
Matt Wagantall | 33d01f5 | 2012-02-23 23:27:44 -0800 | [diff] [blame] | 15 | #define CLKFLAG_INVERT 0x00000001 |
| 16 | #define CLKFLAG_NOINVERT 0x00000002 |
| 17 | #define CLKFLAG_NONEST 0x00000004 |
| 18 | #define CLKFLAG_NORESET 0x00000008 |
Matt Wagantall | 7637779 | 2013-04-10 19:37:58 -0700 | [diff] [blame] | 19 | #define CLKFLAG_RETAIN_PERIPH 0x00000010 |
| 20 | #define CLKFLAG_NORETAIN_PERIPH 0x00000020 |
| 21 | #define CLKFLAG_RETAIN_MEM 0x00000040 |
| 22 | #define CLKFLAG_NORETAIN_MEM 0x00000080 |
Matt Wagantall | 33d01f5 | 2012-02-23 23:27:44 -0800 | [diff] [blame] | 23 | #define CLKFLAG_SKIP_HANDOFF 0x00000100 |
| 24 | #define CLKFLAG_MIN 0x00000400 |
| 25 | #define CLKFLAG_MAX 0x00000800 |
Saravana Kannan | c85ecf9 | 2013-01-21 17:58:35 -0800 | [diff] [blame] | 26 | #define CLKFLAG_INIT_DONE 0x00001000 |
| 27 | #define CLKFLAG_INIT_ERR 0x00002000 |
Vikram Mulukutla | 0090eb1 | 2013-05-15 19:57:18 -0700 | [diff] [blame] | 28 | #define CLKFLAG_NO_RATE_CACHE 0x00004000 |
Matt Wagantall | 33d01f5 | 2012-02-23 23:27:44 -0800 | [diff] [blame] | 29 | |
| 30 | struct clk_lookup; |
| 31 | struct clk; |
Daniel Walker | 5e96da5 | 2010-05-12 13:43:28 -0700 | [diff] [blame] | 32 | |
| 33 | enum clk_reset_action { |
| 34 | CLK_RESET_DEASSERT = 0, |
| 35 | CLK_RESET_ASSERT = 1 |
| 36 | }; |
| 37 | |
Daniel Walker | 5e96da5 | 2010-05-12 13:43:28 -0700 | [diff] [blame] | 38 | /* Rate is maximum clock rate in Hz */ |
| 39 | int clk_set_max_rate(struct clk *clk, unsigned long rate); |
| 40 | |
| 41 | /* Assert/Deassert reset to a hardware block associated with a clock */ |
| 42 | int clk_reset(struct clk *clk, enum clk_reset_action action); |
| 43 | |
| 44 | /* Set clock-specific configuration parameters */ |
| 45 | int clk_set_flags(struct clk *clk, unsigned long flags); |
| 46 | |
| 47 | #endif |