diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2009-03-22 01:50:48 +0000 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2009-03-22 01:50:48 +0000 |
commit | b7f7655dc2ae979fee8b01ed894224e5c2f7c719 (patch) | |
tree | 6540a83276514c2ea27b9c633ac9872588e126be /firmware/target/arm/imx31/gigabeat-s/timer-imx31.c | |
parent | 6a76ebbab10594f425edbd26e1fa35b0e37a61e5 (diff) | |
download | rockbox-b7f7655dc2ae979fee8b01ed894224e5c2f7c719.tar.gz rockbox-b7f7655dc2ae979fee8b01ed894224e5c2f7c719.zip |
imx31/mc13783: Do some housekeeping with register macros, function names and other defines. No functional changes (except to alter a couple int priorities).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20442 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/imx31/gigabeat-s/timer-imx31.c')
-rw-r--r-- | firmware/target/arm/imx31/gigabeat-s/timer-imx31.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/firmware/target/arm/imx31/gigabeat-s/timer-imx31.c b/firmware/target/arm/imx31/gigabeat-s/timer-imx31.c index 531baf3cc5..c4734a543b 100644 --- a/firmware/target/arm/imx31/gigabeat-s/timer-imx31.c +++ b/firmware/target/arm/imx31/gigabeat-s/timer-imx31.c | |||
@@ -35,11 +35,11 @@ static void __attribute__((interrupt("IRQ"))) EPIT2_HANDLER(void) | |||
35 | static void stop_timer(bool clock_off) | 35 | static void stop_timer(bool clock_off) |
36 | { | 36 | { |
37 | /* Ensure clock gating on (before touching any module registers) */ | 37 | /* Ensure clock gating on (before touching any module registers) */ |
38 | imx31_clkctl_module_clock_gating(CG_EPIT2, CGM_ON_ALL); | 38 | ccm_module_clock_gating(CG_EPIT2, CGM_ON_RUN_WAIT); |
39 | /* Disable insterrupt */ | 39 | /* Disable insterrupt */ |
40 | avic_disable_int(EPIT2); | 40 | avic_disable_int(INT_EPIT2); |
41 | /* Clear wakeup mask */ | 41 | /* Clear wakeup mask */ |
42 | CLKCTL_WIMR0 &= ~WIM_IPI_INT_EPIT2; | 42 | CCM_WIMR0 &= ~CCM_WIMR0_IPI_INT_EPIT2; |
43 | /* Disable counter */ | 43 | /* Disable counter */ |
44 | EPITCR2 &= ~(EPITCR_OCIEN | EPITCR_EN); | 44 | EPITCR2 &= ~(EPITCR_OCIEN | EPITCR_EN); |
45 | /* Clear pending */ | 45 | /* Clear pending */ |
@@ -48,7 +48,7 @@ static void stop_timer(bool clock_off) | |||
48 | if (clock_off) | 48 | if (clock_off) |
49 | { | 49 | { |
50 | /* Final stop, not reset; don't clock module any longer */ | 50 | /* Final stop, not reset; don't clock module any longer */ |
51 | imx31_clkctl_module_clock_gating(CG_EPIT2, CGM_OFF); | 51 | ccm_module_clock_gating(CG_EPIT2, CGM_OFF); |
52 | } | 52 | } |
53 | } | 53 | } |
54 | 54 | ||
@@ -77,7 +77,7 @@ bool _timer_set(long cycles, bool start) | |||
77 | * Reload from modulus register, | 77 | * Reload from modulus register, |
78 | * Count from load value */ | 78 | * Count from load value */ |
79 | EPITCR2 = EPITCR_CLKSRC_IPG_CLK | EPITCR_WAITEN | EPITCR_IOVW | | 79 | EPITCR2 = EPITCR_CLKSRC_IPG_CLK | EPITCR_WAITEN | EPITCR_IOVW | |
80 | EPITCR_PRESCALER(1-1) | EPITCR_RLD | EPITCR_ENMOD; | 80 | (1-1) << EPITCR_PRESCALER_POS | EPITCR_RLD | EPITCR_ENMOD; |
81 | EPITLR2 = cycles; | 81 | EPITLR2 = cycles; |
82 | /* Event when counter reaches 0 */ | 82 | /* Event when counter reaches 0 */ |
83 | EPITCMPR2 = 0; | 83 | EPITCMPR2 = 0; |
@@ -95,7 +95,8 @@ bool _timer_register(void) | |||
95 | 95 | ||
96 | /* Enable interrupt */ | 96 | /* Enable interrupt */ |
97 | EPITCR2 |= EPITCR_OCIEN; | 97 | EPITCR2 |= EPITCR_OCIEN; |
98 | avic_enable_int(EPIT2, IRQ, 8, EPIT2_HANDLER); | 98 | avic_enable_int(INT_EPIT2, INT_TYPE_IRQ, INT_PRIO_DEFAULT, |
99 | EPIT2_HANDLER); | ||
99 | /* Start timer */ | 100 | /* Start timer */ |
100 | EPITCR2 |= EPITCR_EN; | 101 | EPITCR2 |= EPITCR_EN; |
101 | 102 | ||