summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2007-11-18 14:01:58 +0000
committerJens Arnold <amiconn@rockbox.org>2007-11-18 14:01:58 +0000
commit940fe31f8102e8723856471896e463d090354aaf (patch)
tree16cf30c9123de00a83334506bb8ff77a4cce91a7
parenteafa27f2e89ba814eff7a631cce020f39ac81df4 (diff)
downloadrockbox-940fe31f8102e8723856471896e463d090354aaf.tar.gz
rockbox-940fe31f8102e8723856471896e463d090354aaf.zip
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.c18
-rw-r--r--firmware/target/arm/ipod/backlight-target.h10
-rw-r--r--firmware/target/arm/ipod/lcd-color_nano.c8
-rw-r--r--firmware/target/arm/ipod/lcd-gray.c9
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)
42 42
43void _backlight_off(void) 43void _backlight_off(void)
44{ 44{
45 /* fades backlight off on 4g */ 45 /* fades backlight off on 4g */
46 GPO32_ENABLE &= ~0x2000000; 46 GPO32_ENABLE &= ~0x2000000;
47 outl(0x80000000, 0x7000a010); 47 outl(0x80000000, 0x7000a010);
48}
49
50bool _backlight_init(void)
51{
52 GPIOB_ENABLE |= 0x4; /* B02 enable */
53 GPIOB_ENABLE |= 0x8; /* B03 enable */
54 GPO32_ENABLE |= 0x2000000; /* D01 enable */
55 GPO32_VAL |= 0x2000000; /* D01 =1 */
56 DEV_EN |= 0x20000; /* PWM enable */
57
58 _backlight_on();
59 return true;
48} 60}
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);
42#define _BACKLIGHT_FADE_ENABLE 42#define _BACKLIGHT_FADE_ENABLE
43#endif /* !BOOTLOADER */ 43#endif /* !BOOTLOADER */
44 44
45#elif defined HAVE_BACKLIGHT_PWM_FADING 45#elif defined(IPOD_4G) || defined(IPOD_COLOR)
46
47bool _backlight_init(void);
48void _backlight_on(void);
49void _backlight_off(void);
50
51#elif defined HAVE_BACKLIGHT_PWM_FADING /* Mini G1, G2 */
46 52
47#define _backlight_init() true 53#define _backlight_init() true
48void _backlight_hw_on(void); 54void _backlight_hw_on(void);
@@ -58,7 +64,7 @@ void _backlight_hw_off(void);
58#define _backlight_off_normal() _backlight_hw_off() 64#define _backlight_off_normal() _backlight_hw_off()
59#endif 65#endif
60 66
61#else 67#else /* G1, G2, G3 */
62 68
63#define _backlight_init() true 69#define _backlight_init() true
64void _backlight_on(void); 70void _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)
102 lcd_type = 1; 102 lcd_type = 1;
103 } 103 }
104 } 104 }
105
106 GPIOB_ENABLE |= 0x4; /* B02 enable */
107 GPIOB_ENABLE |= 0x8; /* B03 enable */
108 GPO32_ENABLE |= 0x2000000; /* D01 enable */
109 GPO32_VAL |= 0x2000000; /* D01 =1 */
110
111 DEV_EN |= 0x20000; /* PWM enable */
112
113#elif CONFIG_LCD == LCD_IPODNANO 105#elif CONFIG_LCD == LCD_IPODNANO
114 /* iPodLinux doesn't appear have any LCD init code for the Nano */ 106 /* iPodLinux doesn't appear have any LCD init code for the Nano */
115#endif 107#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)
172#endif 172#endif
173 lcd_set_flip(false); 173 lcd_set_flip(false);
174 lcd_cmd_and_data(R_ENTRY_MODE, 0x0000); 174 lcd_cmd_and_data(R_ENTRY_MODE, 0x0000);
175
176#ifdef IPOD_4G
177 GPIOB_ENABLE |= 0x4; /* B02 enable */
178 GPIOB_ENABLE |= 0x8; /* B03 enable */
179 GPO32_ENABLE |= 0x2000000; /* D01 enable */
180 GPO32_VAL |= 0x2000000; /* D01 =1 */
181
182 DEV_EN |= 0x20000; /* PWM enable */
183#endif
184} 175}
185 176
186/*** hardware configuration ***/ 177/*** hardware configuration ***/