summaryrefslogtreecommitdiff
path: root/firmware/target/arm/tms320dm320/mrobe-500/power-mr500.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/tms320dm320/mrobe-500/power-mr500.c')
-rw-r--r--firmware/target/arm/tms320dm320/mrobe-500/power-mr500.c95
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
32void 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
41bool charger_inserted(void)
42{
43 return false;
44}
45
46/* Returns true if the unit is charging the batteries. */
47bool charging_state(void) {
48 return false;
49}
50
51void 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
59bool ide_powered(void)
60{
61 return !(IO_GIO_BITSET1&(1<<1));
62}
63
64void 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
75bool charger_inserted(void)
76{
77 return false;
78}
79
80void charger_enable(bool on)
81{
82 (void)on;
83}
84
85void power_off(void)
86{
87}
88
89void ide_power_enable(bool on)
90{
91 (void)on;
92}
93
94#endif /* SIMULATOR */
95