1 /* arch/arm/mach-msm/clock.h
3 * Copyright (C) 2007 Google, Inc.
4 * Copyright (c) 2007-2010, Code Aurora Forum. All rights reserved.
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.
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.
17 #ifndef __ARCH_ARM_MACH_MSM_CLOCK_H
18 #define __ARCH_ARM_MACH_MSM_CLOCK_H
20 #include <linux/list.h>
23 #include "clock-pcom.h"
25 #define CLKFLAG_INVERT 0x00000001
26 #define CLKFLAG_NOINVERT 0x00000002
27 #define CLKFLAG_NONEST 0x00000004
28 #define CLKFLAG_NORESET 0x00000008
30 #define CLK_FIRST_AVAILABLE_FLAG 0x00000100
31 #define CLKFLAG_AUTO_OFF 0x00000200
32 #define CLKFLAG_MIN 0x00000400
33 #define CLKFLAG_MAX 0x00000800
36 int (*enable)(unsigned id);
37 void (*disable)(unsigned id);
38 void (*auto_off)(unsigned id);
39 int (*reset)(unsigned id, enum clk_reset_action action);
40 int (*set_rate)(unsigned id, unsigned rate);
41 int (*set_min_rate)(unsigned id, unsigned rate);
42 int (*set_max_rate)(unsigned id, unsigned rate);
43 int (*set_flags)(unsigned id, unsigned flags);
44 unsigned (*get_rate)(unsigned id);
45 unsigned (*is_enabled)(unsigned id);
46 long (*round_rate)(unsigned id, unsigned rate);
57 struct list_head list;
61 #define A11S_CLK_CNTL_ADDR (MSM_CSR_BASE + 0x100)
62 #define A11S_CLK_SEL_ADDR (MSM_CSR_BASE + 0x104)
63 #define A11S_VDD_SVS_PLEVEL_ADDR (MSM_CSR_BASE + 0x124)
65 #ifdef CONFIG_DEBUG_FS
66 #define CLOCK_DBG_NAME(x) .dbg_name = x,
68 #define CLOCK_DBG_NAME(x)
71 #define CLOCK(clk_name, clk_id, clk_dev, clk_flags) { \
76 CLOCK_DBG_NAME(#clk_id) \
79 #define OFF CLKFLAG_AUTO_OFF
80 #define CLK_MIN CLKFLAG_MIN
81 #define CLK_MAX CLKFLAG_MAX
82 #define CLK_MINMAX (CLK_MIN | CLK_MAX)
83 #define NR_CLKS P_NR_CLKS
102 int msm_clock_require_tcxo(unsigned long *reason, int nbits);
103 int msm_clock_get_name(uint32_t id, char *name, uint32_t size);
104 int ebi1_clk_set_min_rate(enum clkvote_client client, unsigned long rate);
105 unsigned long clk_get_max_axi_khz(void);