diff options
author | Jens Arnold <amiconn@rockbox.org> | 2007-11-18 14:01:58 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2007-11-18 14:01:58 +0000 |
commit | 940fe31f8102e8723856471896e463d090354aaf (patch) | |
tree | 16cf30c9123de00a83334506bb8ff77a4cce91a7 | |
parent | eafa27f2e89ba814eff7a631cce020f39ac81df4 (diff) |
Move 4th Gen (grayscale and color) backlight init where it belongs.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15661 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | firmware/target/arm/ipod/backlight-4g_color.c | 18 | ||||
-rw-r--r-- | firmware/target/arm/ipod/backlight-target.h | 10 | ||||
-rw-r--r-- | firmware/target/arm/ipod/lcd-color_nano.c | 8 | ||||
-rw-r--r-- | firmware/target/arm/ipod/lcd-gray.c | 9 |
4 files changed, 23 insertions, 22 deletions
diff --git a/firmware/target/arm/ipod/backlight-4g_color.c b/firmware/target/arm/ipod/backlight-4g_color.c index 28deba46b5..982bfd53ac 100644 --- a/firmware/target/arm/ipod/backlight-4g_color.c +++ b/firmware/target/arm/ipod/backlight-4g_color.c @@ -42,7 +42,19 @@ void _backlight_on(void) void _backlight_off(void) { - /* fades backlight off on 4g */ - GPO32_ENABLE &= ~0x2000000; - outl(0x80000000, 0x7000a010); + /* fades backlight off on 4g */ + GPO32_ENABLE &= ~0x2000000; + outl(0x80000000, 0x7000a010); +} + +bool _backlight_init(void) +{ + GPIOB_ENABLE |= 0x4; /* B02 enable */ + GPIOB_ENABLE |= 0x8; /* B03 enable */ + GPO32_ENABLE |= 0x2000000; /* D01 enable */ + GPO32_VAL |= 0x2000000; /* D01 =1 */ + DEV_EN |= 0x20000; /* PWM enable */ + + _backlight_on(); + return true; } diff --git a/firmware/target/arm/ipod/backlight-target.h b/firmware/target/arm/ipod/backlight-target.h index 4190739474..b2158c595c 100644 --- a/firmware/target/arm/ipod/backlight-target.h +++ b/firmware/target/arm/ipod/backlight-target.h @@ -42,7 +42,13 @@ void _backlight_hw_enable(bool on); #define _BACKLIGHT_FADE_ENABLE #endif /* !BOOTLOADER */ -#elif defined HAVE_BACKLIGHT_PWM_FADING +#elif defined(IPOD_4G) || defined(IPOD_COLOR) + +bool _backlight_init(void); +void _backlight_on(void); +void _backlight_off(void); + +#elif defined HAVE_BACKLIGHT_PWM_FADING /* Mini G1, G2 */ #define _backlight_init() true void _backlight_hw_on(void); @@ -58,7 +64,7 @@ void _backlight_hw_off(void); #define _backlight_off_normal() _backlight_hw_off() #endif -#else +#else /* G1, G2, G3 */ #define _backlight_init() true void _backlight_on(void); diff --git a/firmware/target/arm/ipod/lcd-color_nano.c b/firmware/target/arm/ipod/lcd-color_nano.c index fd65290872..b18b7ee712 100644 --- a/firmware/target/arm/ipod/lcd-color_nano.c +++ b/firmware/target/arm/ipod/lcd-color_nano.c @@ -102,14 +102,6 @@ void lcd_init_device(void) lcd_type = 1; } } - - GPIOB_ENABLE |= 0x4; /* B02 enable */ - GPIOB_ENABLE |= 0x8; /* B03 enable */ - GPO32_ENABLE |= 0x2000000; /* D01 enable */ - GPO32_VAL |= 0x2000000; /* D01 =1 */ - - DEV_EN |= 0x20000; /* PWM enable */ - #elif CONFIG_LCD == LCD_IPODNANO /* iPodLinux doesn't appear have any LCD init code for the Nano */ #endif diff --git a/firmware/target/arm/ipod/lcd-gray.c b/firmware/target/arm/ipod/lcd-gray.c index bbe7703a03..65fa2a779e 100644 --- a/firmware/target/arm/ipod/lcd-gray.c +++ b/firmware/target/arm/ipod/lcd-gray.c @@ -172,15 +172,6 @@ void lcd_init_device(void) #endif lcd_set_flip(false); lcd_cmd_and_data(R_ENTRY_MODE, 0x0000); - -#ifdef IPOD_4G - GPIOB_ENABLE |= 0x4; /* B02 enable */ - GPIOB_ENABLE |= 0x8; /* B03 enable */ - GPO32_ENABLE |= 0x2000000; /* D01 enable */ - GPO32_VAL |= 0x2000000; /* D01 =1 */ - - DEV_EN |= 0x20000; /* PWM enable */ -#endif } /*** hardware configuration ***/ |