From 13618007b36b60dda1425ada261308a3624224c3 Mon Sep 17 00:00:00 2001 From: Linus Nielsen Feltzing Date: Wed, 22 Mar 2006 14:17:45 +0000 Subject: Backlight for iAudio X5 git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9185 a1c6a512-1295-4272-9138-f99709370657 --- firmware/SOURCES | 1 + firmware/backlight.c | 6 +++- .../target/coldfire/iaudio/x5/backlight-target.h | 25 ++++++++++++++ firmware/target/coldfire/iaudio/x5/backlight-x5.c | 38 ++++++++++++++++++++++ 4 files changed, 69 insertions(+), 1 deletion(-) create mode 100755 firmware/target/coldfire/iaudio/x5/backlight-target.h create mode 100755 firmware/target/coldfire/iaudio/x5/backlight-x5.c (limited to 'firmware') 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 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 9aace01b2e..89a9939213 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 0000000000..5b6f7e1f8f --- /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 0000000000..e48e55d27b --- /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); +} + -- cgit v1.2.3