diff options
author | Michael Hennerich <michael.hennerich@analog.com> | 2009-05-04 05:11:37 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2009-06-12 06:11:47 -0400 |
commit | c8d5ea8ccb1ce586131c6c549899cb5073222da0 (patch) | |
tree | 8577a765ef1b9c5c4813ed9ceed5a03a885894f1 /arch/blackfin/include | |
parent | 9ba3c24f10c948dadac2ca91ed714dfbcedd61ca (diff) |
Blackfin: update gptimers API
First we fix the prototypes for functions that return boolean values by
using "int" rather than "uint16_t". Then we introduce a get_gptimer_run()
function for checking the current run status of a timer, and then we add a
disable_gptimers_sync() function which parallels disable_gptimers() with
corresponding normal "_sync" behavior.
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'arch/blackfin/include')
-rw-r--r-- | arch/blackfin/include/asm/gptimers.h | 43 |
1 files changed, 24 insertions, 19 deletions
diff --git a/arch/blackfin/include/asm/gptimers.h b/arch/blackfin/include/asm/gptimers.h index b0f847ae4bf4..89f08decb8e0 100644 --- a/arch/blackfin/include/asm/gptimers.h +++ b/arch/blackfin/include/asm/gptimers.h | |||
@@ -30,6 +30,7 @@ | |||
30 | # else | 30 | # else |
31 | # define MAX_BLACKFIN_GPTIMERS 11 | 31 | # define MAX_BLACKFIN_GPTIMERS 11 |
32 | # define TIMER8_GROUP_REG TIMER_ENABLE1 | 32 | # define TIMER8_GROUP_REG TIMER_ENABLE1 |
33 | # define TIMER_GROUP2 1 | ||
33 | # endif | 34 | # endif |
34 | # define TIMER0_GROUP_REG TIMER_ENABLE0 | 35 | # define TIMER0_GROUP_REG TIMER_ENABLE0 |
35 | #endif | 36 | #endif |
@@ -40,10 +41,12 @@ | |||
40 | # define MAX_BLACKFIN_GPTIMERS 12 | 41 | # define MAX_BLACKFIN_GPTIMERS 12 |
41 | # define TIMER0_GROUP_REG TMRS8_ENABLE | 42 | # define TIMER0_GROUP_REG TMRS8_ENABLE |
42 | # define TIMER8_GROUP_REG TMRS4_ENABLE | 43 | # define TIMER8_GROUP_REG TMRS4_ENABLE |
44 | # define TIMER_GROUP2 1 | ||
43 | #endif | 45 | #endif |
44 | /* | 46 | /* |
45 | * All others: 3 timers: | 47 | * All others: 3 timers: |
46 | */ | 48 | */ |
49 | #define TIMER_GROUP1 0 | ||
47 | #if !defined(MAX_BLACKFIN_GPTIMERS) | 50 | #if !defined(MAX_BLACKFIN_GPTIMERS) |
48 | # define MAX_BLACKFIN_GPTIMERS 3 | 51 | # define MAX_BLACKFIN_GPTIMERS 3 |
49 | # define TIMER0_GROUP_REG TIMER_ENABLE | 52 | # define TIMER0_GROUP_REG TIMER_ENABLE |
@@ -109,8 +112,8 @@ | |||
109 | #define TIMER_ERR_PROG_PER 0x8000 | 112 | #define TIMER_ERR_PROG_PER 0x8000 |
110 | #define TIMER_ERR_PROG_PW 0xC000 | 113 | #define TIMER_ERR_PROG_PW 0xC000 |
111 | #define TIMER_EMU_RUN 0x0200 | 114 | #define TIMER_EMU_RUN 0x0200 |
112 | #define TIMER_TOGGLE_HI 0x0100 | 115 | #define TIMER_TOGGLE_HI 0x0100 |
113 | #define TIMER_CLK_SEL 0x0080 | 116 | #define TIMER_CLK_SEL 0x0080 |
114 | #define TIMER_OUT_DIS 0x0040 | 117 | #define TIMER_OUT_DIS 0x0040 |
115 | #define TIMER_TIN_SEL 0x0020 | 118 | #define TIMER_TIN_SEL 0x0020 |
116 | #define TIMER_IRQ_ENA 0x0010 | 119 | #define TIMER_IRQ_ENA 0x0010 |
@@ -169,23 +172,25 @@ | |||
169 | 172 | ||
170 | /* The actual gptimer API */ | 173 | /* The actual gptimer API */ |
171 | 174 | ||
172 | void set_gptimer_pwidth (int timer_id, uint32_t width); | 175 | void set_gptimer_pwidth(int timer_id, uint32_t width); |
173 | uint32_t get_gptimer_pwidth (int timer_id); | 176 | uint32_t get_gptimer_pwidth(int timer_id); |
174 | void set_gptimer_period (int timer_id, uint32_t period); | 177 | void set_gptimer_period(int timer_id, uint32_t period); |
175 | uint32_t get_gptimer_period (int timer_id); | 178 | uint32_t get_gptimer_period(int timer_id); |
176 | uint32_t get_gptimer_count (int timer_id); | 179 | uint32_t get_gptimer_count(int timer_id); |
177 | uint16_t get_gptimer_intr (int timer_id); | 180 | int get_gptimer_intr(int timer_id); |
178 | void clear_gptimer_intr (int timer_id); | 181 | void clear_gptimer_intr(int timer_id); |
179 | uint16_t get_gptimer_over (int timer_id); | 182 | int get_gptimer_over(int timer_id); |
180 | void clear_gptimer_over (int timer_id); | 183 | void clear_gptimer_over(int timer_id); |
181 | void set_gptimer_config (int timer_id, uint16_t config); | 184 | void set_gptimer_config(int timer_id, uint16_t config); |
182 | uint16_t get_gptimer_config (int timer_id); | 185 | uint16_t get_gptimer_config(int timer_id); |
183 | void set_gptimer_pulse_hi (int timer_id); | 186 | int get_gptimer_run(int timer_id); |
187 | void set_gptimer_pulse_hi(int timer_id); | ||
184 | void clear_gptimer_pulse_hi(int timer_id); | 188 | void clear_gptimer_pulse_hi(int timer_id); |
185 | void enable_gptimers (uint16_t mask); | 189 | void enable_gptimers(uint16_t mask); |
186 | void disable_gptimers (uint16_t mask); | 190 | void disable_gptimers(uint16_t mask); |
187 | uint16_t get_enabled_gptimers (void); | 191 | void disable_gptimers_sync(uint16_t mask); |
188 | uint32_t get_gptimer_status (int group); | 192 | uint16_t get_enabled_gptimers(void); |
189 | void set_gptimer_status (int group, uint32_t value); | 193 | uint32_t get_gptimer_status(int group); |
194 | void set_gptimer_status(int group, uint32_t value); | ||
190 | 195 | ||
191 | #endif | 196 | #endif |