summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2006-03-22 14:17:45 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2006-03-22 14:17:45 +0000
commit13618007b36b60dda1425ada261308a3624224c3 (patch)
treeaa893db25dd138de4ed0aaf0fa055f76a4fbaeea
parentcff2a54e7cbc369621c41a04a1bb67110da81443 (diff)
downloadrockbox-13618007b36b60dda1425ada261308a3624224c3.zip
rockbox-13618007b36b60dda1425ada261308a3624224c3.tar.gz
rockbox-13618007b36b60dda1425ada261308a3624224c3.tar.bz2
rockbox-13618007b36b60dda1425ada261308a3624224c3.tar.xz
Backlight for iAudio X5
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9185 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/SOURCES1
-rw-r--r--firmware/backlight.c6
-rwxr-xr-xfirmware/target/coldfire/iaudio/x5/backlight-target.h25
-rwxr-xr-xfirmware/target/coldfire/iaudio/x5/backlight-x5.c38
4 files changed, 69 insertions, 1 deletions
diff --git a/firmware/SOURCES b/firmware/SOURCES
index e99657c..3dbe1e1 100644
--- a/firmware/SOURCES
+++ b/firmware/SOURCES
@@ -212,5 +212,6 @@ target/coldfire/iaudio/x5/adc-x5.c
target/coldfire/iaudio/x5/ata-x5.c
target/coldfire/iaudio/x5/system-x5.c
target/coldfire/iaudio/x5/usb-x5.c
+target/coldfire/iaudio/x5/backlight-x5.c
#endif
#endif
diff --git a/firmware/backlight.c b/firmware/backlight.c
index 9aace01..89a9939 100644
--- a/firmware/backlight.c
+++ b/firmware/backlight.c
@@ -40,9 +40,13 @@
#ifdef HAVE_REMOTE_LCD
#include "lcd-remote.h"
#endif
+#ifdef TARGET_TREE
+#include "backlight-target.h"
+#endif
/* Basic low-level code that simply switches backlight on or off. Probably
* a nice candidate for inclusion in the target/ dir. */
+#ifndef TARGET_TREE
static inline void __backlight_on(void)
{
#ifdef SIMULATOR
@@ -121,7 +125,7 @@ static inline void __backlight_off(void)
outl(((0x100 | 0) << 3), 0x6000d824);
#endif
}
-
+#endif
#if defined(CONFIG_BACKLIGHT) && !defined(BOOTLOADER)
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 0000000..5b6f7e1
--- /dev/null
+++ b/firmware/target/coldfire/iaudio/x5/backlight-target.h
@@ -0,0 +1,25 @@
+/***************************************************************************
+ * __________ __ ___.
+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+ * \/ \/ \/ \/ \/
+ * $Id$
+ *
+ * Copyright (C) 2006 by Linus Nielsen Feltzing
+ *
+ * All files in this archive are subject to the GNU General Public License.
+ * See the file COPYING in the source tree root for full license agreement.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ****************************************************************************/
+#ifndef BACKLIGHT_TARGET_H
+#define BACKLIGHT_TARGET_H
+
+void __backlight_on(void);
+void __backlight_off(void);
+
+#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 0000000..e48e55d
--- /dev/null
+++ b/firmware/target/coldfire/iaudio/x5/backlight-x5.c
@@ -0,0 +1,38 @@
+/***************************************************************************
+ * __________ __ ___.
+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+ * \/ \/ \/ \/ \/
+ * $Id$
+ *
+ * Copyright (C) 2006 by Linus Nielsen Feltzing
+ *
+ * All files in this archive are subject to the GNU General Public License.
+ * See the file COPYING in the source tree root for full license agreement.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ****************************************************************************/
+#include "config.h"
+#include "cpu.h"
+#include "system.h"
+#include "backlight.h"
+#include "pcf50606.h"
+
+void __backlight_on(void)
+{
+ int level = set_irq_level(HIGHEST_IRQ_LEVEL);
+ pcf50606_write(0x38, 0x30); /* Backlight ON */
+ set_irq_level(level);
+}
+
+void __backlight_off(void)
+{
+ int level = set_irq_level(HIGHEST_IRQ_LEVEL);
+ pcf50606_write(0x38, 0x70); /* Backlight OFF */
+ set_irq_level(level);
+}
+