blob: 42d29dd7aafca23be03b074149747f74cbd8a62e [file] [log] [blame]
Brian Swetland600f7cf2008-09-09 11:04:14 -07001/* arch/arm/mach-msm/clock.h
2 *
3 * Copyright (C) 2007 Google, Inc.
Stephen Boyd8cc7f532013-06-17 10:43:19 -07004 * Copyright (c) 2007-2012, The Linux Foundation. All rights reserved.
Brian Swetland600f7cf2008-09-09 11:04:14 -07005 *
6 * This software is licensed under the terms of the GNU General Public
7 * License version 2, as published by the Free Software Foundation, and
8 * may be copied, distributed, and modified under those terms.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 */
16
17#ifndef __ARCH_ARM_MACH_MSM_CLOCK_H
18#define __ARCH_ARM_MACH_MSM_CLOCK_H
19
Stephen Boyd8cc7f532013-06-17 10:43:19 -070020#include <linux/clk-provider.h>
Daniel Walker5e96da52010-05-12 13:43:28 -070021#include <mach/clk.h>
22
Brian Swetland600f7cf2008-09-09 11:04:14 -070023#define CLK_FIRST_AVAILABLE_FLAG 0x00000100
Daniel Walker5e96da52010-05-12 13:43:28 -070024#define CLKFLAG_AUTO_OFF 0x00000200
25#define CLKFLAG_MIN 0x00000400
26#define CLKFLAG_MAX 0x00000800
27
Daniel Walker5e96da52010-05-12 13:43:28 -070028#define OFF CLKFLAG_AUTO_OFF
29#define CLK_MIN CLKFLAG_MIN
30#define CLK_MAX CLKFLAG_MAX
31#define CLK_MINMAX (CLK_MIN | CLK_MAX)
Brian Swetland600f7cf2008-09-09 11:04:14 -070032
Stephen Boyd8cc7f532013-06-17 10:43:19 -070033struct msm_clk {
34 int (*reset)(struct clk_hw *hw, enum clk_reset_action action);
35 struct clk_hw hw;
36};
Matt Wagantalld64560fe2011-01-26 16:20:54 -080037
Stephen Boyd8cc7f532013-06-17 10:43:19 -070038static inline struct msm_clk *to_msm_clk(struct clk_hw *hw)
39{
40 return container_of(hw, struct msm_clk, hw);
41}
Stephen Boyd421faca2013-06-17 10:43:18 -070042
Brian Swetland600f7cf2008-09-09 11:04:14 -070043#endif