summaryrefslogtreecommitdiff
path: root/firmware/target/sh/archos/ondio/power-ondio.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/sh/archos/ondio/power-ondio.c')
-rw-r--r--firmware/target/sh/archos/ondio/power-ondio.c78
1 files changed, 0 insertions, 78 deletions
diff --git a/firmware/target/sh/archos/ondio/power-ondio.c b/firmware/target/sh/archos/ondio/power-ondio.c
deleted file mode 100644
index d7bbc08f4f..0000000000
--- a/firmware/target/sh/archos/ondio/power-ondio.c
+++ /dev/null
@@ -1,78 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2002 by Linus Nielsen Feltzing
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21#include "config.h"
22#include "cpu.h"
23#include <stdbool.h>
24#include "kernel.h"
25#include "system.h"
26#include "power.h"
27#include "usb.h"
28#include "backlight-target.h"
29
30#if CONFIG_TUNER
31
32static bool powered = false;
33
34bool tuner_power(bool status)
35{
36 bool old_status = powered;
37
38 powered = status;
39 if (status)
40 {
41 and_b(~0x04, &PADRL); /* drive PA2 low for tuner enable */
42 sleep(1); /* let the voltage settle */
43 }
44 else
45 or_b(0x04, &PADRL); /* drive PA2 high for tuner disable */
46 return old_status;
47}
48
49#endif /* #if CONFIG_TUNER */
50
51void power_init(void)
52{
53 PBCR2 &= ~0x0c00; /* GPIO for PB5 */
54 or_b(0x20, &PBIORL);
55 or_b(0x20, &PBDRL); /* hold power */
56#ifndef HAVE_BACKLIGHT
57 /* Disable backlight on backlight-modded Ondios when running
58 * a standard build (always on otherwise). */
59 PACR1 &= ~0x3000; /* Set PA14 (backlight control) to GPIO */
60 and_b(~0x40, &PADRH); /* drive it low */
61 or_b(0x40, &PAIORH); /* ..and output */
62#endif
63 PACR2 &= ~0x0030; /* GPIO for PA2 */
64 or_b(0x04, &PADRL); /* drive PA2 high for tuner disable */
65 or_b(0x04, &PAIORL); /* output for PA2 */
66}
67
68void power_off(void)
69{
70 disable_irq();
71#ifdef HAVE_BACKLIGHT
72 /* Switch off the light on backlight-modded Ondios */
73 backlight_hw_off();
74#endif
75 and_b(~0x20, &PBDRL);
76 or_b(0x20, &PBIORL);
77 while(1);
78}