diff options
author | Linus Nielsen Feltzing <linus@haxx.se> | 2006-03-22 14:17:45 +0000 |
---|---|---|
committer | Linus Nielsen Feltzing <linus@haxx.se> | 2006-03-22 14:17:45 +0000 |
commit | 13618007b36b60dda1425ada261308a3624224c3 (patch) | |
tree | aa893db25dd138de4ed0aaf0fa055f76a4fbaeea | |
parent | cff2a54e7cbc369621c41a04a1bb67110da81443 (diff) | |
download | rockbox-13618007b36b60dda1425ada261308a3624224c3.tar.gz rockbox-13618007b36b60dda1425ada261308a3624224c3.zip |
Backlight for iAudio X5
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9185 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | firmware/SOURCES | 1 | ||||
-rw-r--r-- | firmware/backlight.c | 6 | ||||
-rwxr-xr-x | firmware/target/coldfire/iaudio/x5/backlight-target.h | 25 | ||||
-rwxr-xr-x | firmware/target/coldfire/iaudio/x5/backlight-x5.c | 38 |
4 files changed, 69 insertions, 1 deletions
diff --git a/firmware/SOURCES b/firmware/SOURCES index e99657c6f8..3dbe1e12b9 100644 --- a/firmware/SOURCES +++ b/firmware/SOURCES | |||
@@ -212,5 +212,6 @@ target/coldfire/iaudio/x5/adc-x5.c | |||
212 | target/coldfire/iaudio/x5/ata-x5.c | 212 | target/coldfire/iaudio/x5/ata-x5.c |
213 | target/coldfire/iaudio/x5/system-x5.c | 213 | target/coldfire/iaudio/x5/system-x5.c |
214 | target/coldfire/iaudio/x5/usb-x5.c | 214 | target/coldfire/iaudio/x5/usb-x5.c |
215 | target/coldfire/iaudio/x5/backlight-x5.c | ||
215 | #endif | 216 | #endif |
216 | #endif | 217 | #endif |
diff --git a/firmware/backlight.c b/firmware/backlight.c index 9aace01b2e..89a9939213 100644 --- a/firmware/backlight.c +++ b/firmware/backlight.c | |||
@@ -40,9 +40,13 @@ | |||
40 | #ifdef HAVE_REMOTE_LCD | 40 | #ifdef HAVE_REMOTE_LCD |
41 | #include "lcd-remote.h" | 41 | #include "lcd-remote.h" |
42 | #endif | 42 | #endif |
43 | #ifdef TARGET_TREE | ||
44 | #include "backlight-target.h" | ||
45 | #endif | ||
43 | 46 | ||
44 | /* Basic low-level code that simply switches backlight on or off. Probably | 47 | /* Basic low-level code that simply switches backlight on or off. Probably |
45 | * a nice candidate for inclusion in the target/ dir. */ | 48 | * a nice candidate for inclusion in the target/ dir. */ |
49 | #ifndef TARGET_TREE | ||
46 | static inline void __backlight_on(void) | 50 | static inline void __backlight_on(void) |
47 | { | 51 | { |
48 | #ifdef SIMULATOR | 52 | #ifdef SIMULATOR |
@@ -121,7 +125,7 @@ static inline void __backlight_off(void) | |||
121 | outl(((0x100 | 0) << 3), 0x6000d824); | 125 | outl(((0x100 | 0) << 3), 0x6000d824); |
122 | #endif | 126 | #endif |
123 | } | 127 | } |
124 | 128 | #endif | |
125 | 129 | ||
126 | #if defined(CONFIG_BACKLIGHT) && !defined(BOOTLOADER) | 130 | #if defined(CONFIG_BACKLIGHT) && !defined(BOOTLOADER) |
127 | 131 | ||
diff --git a/firmware/target/coldfire/iaudio/x5/backlight-target.h b/firmware/target/coldfire/iaudio/x5/backlight-target.h new file mode 100755 index 0000000000..5b6f7e1f8f --- /dev/null +++ b/firmware/target/coldfire/iaudio/x5/backlight-target.h | |||
@@ -0,0 +1,25 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2006 by Linus Nielsen Feltzing | ||
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 | #ifndef BACKLIGHT_TARGET_H | ||
20 | #define BACKLIGHT_TARGET_H | ||
21 | |||
22 | void __backlight_on(void); | ||
23 | void __backlight_off(void); | ||
24 | |||
25 | #endif | ||
diff --git a/firmware/target/coldfire/iaudio/x5/backlight-x5.c b/firmware/target/coldfire/iaudio/x5/backlight-x5.c new file mode 100755 index 0000000000..e48e55d27b --- /dev/null +++ b/firmware/target/coldfire/iaudio/x5/backlight-x5.c | |||
@@ -0,0 +1,38 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2006 by Linus Nielsen Feltzing | ||
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 | #include "config.h" | ||
20 | #include "cpu.h" | ||
21 | #include "system.h" | ||
22 | #include "backlight.h" | ||
23 | #include "pcf50606.h" | ||
24 | |||
25 | void __backlight_on(void) | ||
26 | { | ||
27 | int level = set_irq_level(HIGHEST_IRQ_LEVEL); | ||
28 | pcf50606_write(0x38, 0x30); /* Backlight ON */ | ||
29 | set_irq_level(level); | ||
30 | } | ||
31 | |||
32 | void __backlight_off(void) | ||
33 | { | ||
34 | int level = set_irq_level(HIGHEST_IRQ_LEVEL); | ||
35 | pcf50606_write(0x38, 0x70); /* Backlight OFF */ | ||
36 | set_irq_level(level); | ||
37 | } | ||
38 | |||