diff options
Diffstat (limited to 'firmware/target/arm/tms320dm320/mrobe-500/power-mr500.c')
-rw-r--r-- | firmware/target/arm/tms320dm320/mrobe-500/power-mr500.c | 95 |
1 files changed, 95 insertions, 0 deletions
diff --git a/firmware/target/arm/tms320dm320/mrobe-500/power-mr500.c b/firmware/target/arm/tms320dm320/mrobe-500/power-mr500.c new file mode 100644 index 0000000000..3a6dad77f4 --- /dev/null +++ b/firmware/target/arm/tms320dm320/mrobe-500/power-mr500.c | |||
@@ -0,0 +1,95 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2007 by Karl Kurbjun | ||
11 | * | ||
12 | * All files in this archive are subject to the GNU General Public License. | ||
13 | * See the file COPYING in the source tree root for full license agreement. | ||
14 | * | ||
15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
16 | * KIND, either express or implied. | ||
17 | * | ||
18 | ****************************************************************************/ | ||
19 | |||
20 | #include "config.h" | ||
21 | #include "cpu.h" | ||
22 | #include <stdbool.h> | ||
23 | #include "kernel.h" | ||
24 | #include "system.h" | ||
25 | #include "power.h" | ||
26 | #include "pcf50606.h" | ||
27 | #include "backlight.h" | ||
28 | #include "backlight-target.h" | ||
29 | |||
30 | #ifndef SIMULATOR | ||
31 | |||
32 | void power_init(void) | ||
33 | { | ||
34 | /* Initialize IDE power pin */ | ||
35 | /* set GIO17 (ATA power) on and output */ | ||
36 | ide_power_enable(true); | ||
37 | IO_GIO_DIR1&=~(1<<1); | ||
38 | /* Charger detect */ | ||
39 | } | ||
40 | |||
41 | bool charger_inserted(void) | ||
42 | { | ||
43 | return false; | ||
44 | } | ||
45 | |||
46 | /* Returns true if the unit is charging the batteries. */ | ||
47 | bool charging_state(void) { | ||
48 | return false; | ||
49 | } | ||
50 | |||
51 | void ide_power_enable(bool on) | ||
52 | { | ||
53 | if (on) | ||
54 | IO_GIO_BITCLR1=(1<<1); | ||
55 | else | ||
56 | IO_GIO_BITSET1=(1<<1); | ||
57 | } | ||
58 | |||
59 | bool ide_powered(void) | ||
60 | { | ||
61 | return !(IO_GIO_BITSET1&(1<<1)); | ||
62 | } | ||
63 | |||
64 | void power_off(void) | ||
65 | { | ||
66 | /* turn off backlight and wait for 1 second */ | ||
67 | __backlight_off(); | ||
68 | sleep(HZ); | ||
69 | /* Hard shutdown */ | ||
70 | IO_GIO_BITSET1|=1<<10; | ||
71 | } | ||
72 | |||
73 | #else /* SIMULATOR */ | ||
74 | |||
75 | bool charger_inserted(void) | ||
76 | { | ||
77 | return false; | ||
78 | } | ||
79 | |||
80 | void charger_enable(bool on) | ||
81 | { | ||
82 | (void)on; | ||
83 | } | ||
84 | |||
85 | void power_off(void) | ||
86 | { | ||
87 | } | ||
88 | |||
89 | void ide_power_enable(bool on) | ||
90 | { | ||
91 | (void)on; | ||
92 | } | ||
93 | |||
94 | #endif /* SIMULATOR */ | ||
95 | |||