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
This commit is contained in:
Jens Arnold 2007-11-18 14:01:58 +00:00
parent eafa27f2e8
commit 940fe31f81
4 changed files with 23 additions and 22 deletions

View file

@ -42,7 +42,19 @@ void _backlight_on(void)
void _backlight_off(void) void _backlight_off(void)
{ {
/* fades backlight off on 4g */ /* fades backlight off on 4g */
GPO32_ENABLE &= ~0x2000000; GPO32_ENABLE &= ~0x2000000;
outl(0x80000000, 0x7000a010); 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;
} }

View file

@ -42,7 +42,13 @@ void _backlight_hw_enable(bool on);
#define _BACKLIGHT_FADE_ENABLE #define _BACKLIGHT_FADE_ENABLE
#endif /* !BOOTLOADER */ #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 #define _backlight_init() true
void _backlight_hw_on(void); void _backlight_hw_on(void);
@ -58,7 +64,7 @@ void _backlight_hw_off(void);
#define _backlight_off_normal() _backlight_hw_off() #define _backlight_off_normal() _backlight_hw_off()
#endif #endif
#else #else /* G1, G2, G3 */
#define _backlight_init() true #define _backlight_init() true
void _backlight_on(void); void _backlight_on(void);

View file

@ -102,14 +102,6 @@ void lcd_init_device(void)
lcd_type = 1; 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 #elif CONFIG_LCD == LCD_IPODNANO
/* iPodLinux doesn't appear have any LCD init code for the Nano */ /* iPodLinux doesn't appear have any LCD init code for the Nano */
#endif #endif

View file

@ -172,15 +172,6 @@ void lcd_init_device(void)
#endif #endif
lcd_set_flip(false); lcd_set_flip(false);
lcd_cmd_and_data(R_ENTRY_MODE, 0x0000); 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 ***/ /*** hardware configuration ***/