]> nv-tegra.nvidia Code Review - linux-2.6.git/blob - arch/arm/mach-tegra/timer.h
arm: tegra: cardhu: Support for PM311
[linux-2.6.git] / arch / arm / mach-tegra / timer.h
1 /*
2  * arch/arm/mach-tegra/timer.h
3  *
4  * Copyright (C) 2010-2011 NVIDIA Corporation
5  *
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 _MACH_TEGRA_TIMER_H_
18 #define _MACH_TEGRA_TIMER_H_
19
20 #define RTC_SECONDS             0x08
21 #define RTC_SHADOW_SECONDS      0x0c
22 #define RTC_MILLISECONDS        0x10
23
24 #define TIMER_PTV               0x0
25 #define TIMER_PCR               0x4
26
27 #define TIMERUS_CNTR_1US        0x10
28 #define TIMERUS_USEC_CFG        0x14
29 #define TIMERUS_CNTR_FREEZE     0x4c
30
31
32 #ifdef CONFIG_ARCH_TEGRA_2x_SOC
33 void __init tegra2_init_timer(u32 *offset, int *irq, unsigned long rate);
34 #else
35 void __init tegra3_init_timer(u32 *offset, int *irq, unsigned long rate);
36 #endif
37
38 struct tegra_twd_context {
39         u32 twd_ctrl;
40         u32 twd_load;
41         u32 twd_cnt;
42 };
43
44 #ifdef CONFIG_HAVE_ARM_TWD
45 int tegra_twd_get_state(struct tegra_twd_context *context);
46 void tegra_twd_suspend(struct tegra_twd_context *context);
47 void tegra_twd_resume(struct tegra_twd_context *context);
48 #else
49 static inline int tegra_twd_get_state(struct tegra_twd_context *context)
50 { return -ENODEV; }
51 static inline void tegra_twd_suspend(struct tegra_twd_context *context) {}
52 static inline void tegra_twd_resume(struct tegra_twd_context *context) {}
53 #endif
54
55 #endif /* _MACH_TEGRA_TIMER_H_ */