diff options
Diffstat (limited to 'firmware/backlight.c')
-rw-r--r-- | firmware/backlight.c | 37 |
1 files changed, 3 insertions, 34 deletions
diff --git a/firmware/backlight.c b/firmware/backlight.c index 997e26daa7..46e28824d3 100644 --- a/firmware/backlight.c +++ b/firmware/backlight.c | |||
@@ -61,13 +61,7 @@ static inline void __backlight_off(void) | |||
61 | #ifndef TARGET_TREE | 61 | #ifndef TARGET_TREE |
62 | static inline void __backlight_on(void) | 62 | static inline void __backlight_on(void) |
63 | { | 63 | { |
64 | #if CONFIG_BACKLIGHT == BL_IRIVER_H100 | 64 | #if CONFIG_BACKLIGHT == BL_RTC |
65 | and_l(~0x00020000, &GPIO1_OUT); | ||
66 | #elif CONFIG_BACKLIGHT == BL_IRIVER_H300 | ||
67 | lcd_enable(true); | ||
68 | sleep(HZ/100); /* lcd needs time - avoid flashing for dark screens */ | ||
69 | or_l(0x00020000, &GPIO1_OUT); | ||
70 | #elif CONFIG_BACKLIGHT == BL_RTC | ||
71 | /* Enable square wave */ | 65 | /* Enable square wave */ |
72 | rtc_write(0x0a, rtc_read(0x0a) | 0x40); | 66 | rtc_write(0x0a, rtc_read(0x0a) | 0x40); |
73 | #elif CONFIG_BACKLIGHT == BL_PA14_LO /* Player */ | 67 | #elif CONFIG_BACKLIGHT == BL_PA14_LO /* Player */ |
@@ -84,12 +78,7 @@ static inline void __backlight_on(void) | |||
84 | 78 | ||
85 | static inline void __backlight_off(void) | 79 | static inline void __backlight_off(void) |
86 | { | 80 | { |
87 | #if CONFIG_BACKLIGHT == BL_IRIVER_H100 | 81 | #if CONFIG_BACKLIGHT == BL_RTC |
88 | or_l(0x00020000, &GPIO1_OUT); | ||
89 | #elif CONFIG_BACKLIGHT == BL_IRIVER_H300 | ||
90 | and_l(~0x00020000, &GPIO1_OUT); | ||
91 | lcd_enable(false); | ||
92 | #elif CONFIG_BACKLIGHT == BL_RTC | ||
93 | /* Disable square wave */ | 82 | /* Disable square wave */ |
94 | rtc_write(0x0a, rtc_read(0x0a) & ~0x40); | 83 | rtc_write(0x0a, rtc_read(0x0a) & ~0x40); |
95 | #elif CONFIG_BACKLIGHT == BL_PA14_LO /* Player */ | 84 | #elif CONFIG_BACKLIGHT == BL_PA14_LO /* Player */ |
@@ -162,7 +151,7 @@ static int lcd_sleep_timeout = 10*HZ; | |||
162 | 151 | ||
163 | #if defined(HAVE_BACKLIGHT_PWM_FADING) && !defined(SIMULATOR) | 152 | #if defined(HAVE_BACKLIGHT_PWM_FADING) && !defined(SIMULATOR) |
164 | /* backlight fading */ | 153 | /* backlight fading */ |
165 | #define BL_PWM_INTERVAL 5000 /* Cycle interval in µs */ | 154 | #define BL_PWM_INTERVAL 5000 /* Cycle interval in s */ |
166 | #define BL_PWM_COUNT 100 | 155 | #define BL_PWM_COUNT 100 |
167 | static const char backlight_fade_value[8] = { 0, 1, 2, 4, 6, 8, 10, 20 }; | 156 | static const char backlight_fade_value[8] = { 0, 1, 2, 4, 6, 8, 10, 20 }; |
168 | static int fade_in_count = 1; | 157 | static int fade_in_count = 1; |
@@ -352,26 +341,6 @@ static void __remote_backlight_off(void) | |||
352 | { | 341 | { |
353 | sim_remote_backlight(0); | 342 | sim_remote_backlight(0); |
354 | } | 343 | } |
355 | #else | ||
356 | #ifndef TARGET_TREE | ||
357 | static void __remote_backlight_on(void) | ||
358 | { | ||
359 | #if defined(IRIVER_H300_SERIES) | ||
360 | and_l(~0x00000002, &GPIO1_OUT); | ||
361 | #else | ||
362 | and_l(~0x00000800, &GPIO_OUT); | ||
363 | #endif | ||
364 | } | ||
365 | |||
366 | static void __remote_backlight_off(void) | ||
367 | { | ||
368 | #if defined(IRIVER_H300_SERIES) | ||
369 | or_l(0x00000002, &GPIO1_OUT); | ||
370 | #else | ||
371 | or_l(0x00000800, &GPIO_OUT); | ||
372 | #endif | ||
373 | } | ||
374 | #endif /* TARGET_TREE */ | ||
375 | #endif /* SIMULATOR */ | 344 | #endif /* SIMULATOR */ |
376 | #endif /* HAVE_REMOTE_LCD */ | 345 | #endif /* HAVE_REMOTE_LCD */ |
377 | 346 | ||