summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
Diffstat (limited to 'firmware')
-rw-r--r--firmware/backlight.c18
-rw-r--r--firmware/export/config-h100.h2
-rw-r--r--firmware/export/config-h120.h2
-rw-r--r--firmware/export/config-h300.h2
-rw-r--r--firmware/export/config.h15
5 files changed, 24 insertions, 15 deletions
diff --git a/firmware/backlight.c b/firmware/backlight.c
index 1e9d1ce743..fa6a42be44 100644
--- a/firmware/backlight.c
+++ b/firmware/backlight.c
@@ -61,7 +61,7 @@ static int remote_backlight_timer;
61static unsigned int remote_backlight_timeout = 5; 61static unsigned int remote_backlight_timeout = 5;
62#endif 62#endif
63 63
64#if CONFIG_BACKLIGHT == BL_IRIVER 64#if CONFIG_BACKLIGHT == BL_IRIVER_H100
65/* backlight fading */ 65/* backlight fading */
66#define BL_PWM_INTERVAL 5000 /* Cycle interval in µs */ 66#define BL_PWM_INTERVAL 5000 /* Cycle interval in µs */
67#define BL_PWM_COUNT 100 67#define BL_PWM_COUNT 100
@@ -195,7 +195,7 @@ void backlight_set_fade_out(int index)
195 195
196static void __backlight_off(void) 196static void __backlight_off(void)
197{ 197{
198#if CONFIG_BACKLIGHT == BL_IRIVER 198#if CONFIG_BACKLIGHT == BL_IRIVER_H100
199 if (fade_out_count > 0) 199 if (fade_out_count > 0)
200 backlight_dim(0); 200 backlight_dim(0);
201 else 201 else
@@ -203,6 +203,8 @@ static void __backlight_off(void)
203 bl_dim_target = bl_dim_current = 0; 203 bl_dim_target = bl_dim_current = 0;
204 or_l(0x00020000, &GPIO1_OUT); 204 or_l(0x00020000, &GPIO1_OUT);
205 } 205 }
206#elif CONFIG_BACKLIGHT == BL_IRIVER_H300
207 and_l(~0x00020000, &GPIO1_OUT);
206#elif CONFIG_BACKLIGHT == BL_RTC 208#elif CONFIG_BACKLIGHT == BL_RTC
207 /* Disable square wave */ 209 /* Disable square wave */
208 rtc_write(0x0a, rtc_read(0x0a) & ~0x40); 210 rtc_write(0x0a, rtc_read(0x0a) & ~0x40);
@@ -227,7 +229,7 @@ static void __backlight_off(void)
227 229
228static void __backlight_on(void) 230static void __backlight_on(void)
229{ 231{
230#if CONFIG_BACKLIGHT == BL_IRIVER 232#if CONFIG_BACKLIGHT == BL_IRIVER_H100
231 if (fade_in_count > 0) 233 if (fade_in_count > 0)
232 backlight_dim(BL_PWM_COUNT); 234 backlight_dim(BL_PWM_COUNT);
233 else 235 else
@@ -235,6 +237,8 @@ static void __backlight_on(void)
235 bl_dim_target = bl_dim_current = BL_PWM_COUNT; 237 bl_dim_target = bl_dim_current = BL_PWM_COUNT;
236 and_l(~0x00020000, &GPIO1_OUT); 238 and_l(~0x00020000, &GPIO1_OUT);
237 } 239 }
240#elif CONFIG_BACKLIGHT == BL_IRIVER_H300
241 or_l(0x00020000, &GPIO1_OUT);
238#elif CONFIG_BACKLIGHT == BL_RTC 242#elif CONFIG_BACKLIGHT == BL_RTC
239 /* Enable square wave */ 243 /* Enable square wave */
240 rtc_write(0x0a, rtc_read(0x0a) | 0x40); 244 rtc_write(0x0a, rtc_read(0x0a) | 0x40);
@@ -317,7 +321,7 @@ void backlight_thread(void)
317 __backlight_off(); 321 __backlight_off();
318 break; 322 break;
319 323
320#if CONFIG_BACKLIGHT == BL_IRIVER 324#if CONFIG_BACKLIGHT == BL_IRIVER_H100
321 case BACKLIGHT_UNBOOST_CPU: 325 case BACKLIGHT_UNBOOST_CPU:
322 cpu_boost(false); 326 cpu_boost(false);
323 break; 327 break;
@@ -430,10 +434,14 @@ void backlight_init(void)
430 create_thread(backlight_thread, backlight_stack, 434 create_thread(backlight_thread, backlight_stack,
431 sizeof(backlight_stack), backlight_thread_name); 435 sizeof(backlight_stack), backlight_thread_name);
432 436
433#if CONFIG_BACKLIGHT == BL_IRIVER 437#if CONFIG_BACKLIGHT == BL_IRIVER_H100
434 or_l(0x00020000, &GPIO1_ENABLE); 438 or_l(0x00020000, &GPIO1_ENABLE);
435 or_l(0x00020000, &GPIO1_FUNCTION); 439 or_l(0x00020000, &GPIO1_FUNCTION);
436 and_l(~0x00020000, &GPIO1_OUT); /* Start with the backlight ON */ 440 and_l(~0x00020000, &GPIO1_OUT); /* Start with the backlight ON */
441#elif CONFIG_BACKLIGHT == BL_IRIVER_H300
442 or_l(0x00020000, &GPIO1_ENABLE);
443 or_l(0x00020000, &GPIO1_FUNCTION);
444 or_l(0x00020000, &GPIO1_OUT); /* Start with the backlight ON */
437#elif CONFIG_BACKLIGHT == BL_PA14_LO || CONFIG_BACKLIGHT == BL_PA14_HI 445#elif CONFIG_BACKLIGHT == BL_PA14_LO || CONFIG_BACKLIGHT == BL_PA14_HI
438 PACR1 &= ~0x3000; /* Set PA14 (backlight control) to GPIO */ 446 PACR1 &= ~0x3000; /* Set PA14 (backlight control) to GPIO */
439 or_b(0x40, &PAIORH); /* ..and output */ 447 or_b(0x40, &PAIORH); /* ..and output */
diff --git a/firmware/export/config-h100.h b/firmware/export/config-h100.h
index 1426913d41..19bb99bc04 100644
--- a/firmware/export/config-h100.h
+++ b/firmware/export/config-h100.h
@@ -75,7 +75,7 @@
75#define FLASH_SIZE 0x200000 75#define FLASH_SIZE 0x200000
76 76
77/* Define this for LCD backlight available */ 77/* Define this for LCD backlight available */
78#define CONFIG_BACKLIGHT BL_IRIVER /* port controlled */ 78#define CONFIG_BACKLIGHT BL_IRIVER_H100 /* port controlled */
79 79
80/* Define this to the CPU frequency */ 80/* Define this to the CPU frequency */
81#define CPU_FREQ 11289600 81#define CPU_FREQ 11289600
diff --git a/firmware/export/config-h120.h b/firmware/export/config-h120.h
index cdfc068626..b2c34c5a55 100644
--- a/firmware/export/config-h120.h
+++ b/firmware/export/config-h120.h
@@ -72,7 +72,7 @@
72#define FLASH_SIZE 0x200000 72#define FLASH_SIZE 0x200000
73 73
74/* Define this for LCD backlight available */ 74/* Define this for LCD backlight available */
75#define CONFIG_BACKLIGHT BL_IRIVER /* port controlled */ 75#define CONFIG_BACKLIGHT BL_IRIVER_H100 /* port controlled */
76 76
77/* Define this to the CPU frequency */ 77/* Define this to the CPU frequency */
78#define CPU_FREQ 11289600 78#define CPU_FREQ 11289600
diff --git a/firmware/export/config-h300.h b/firmware/export/config-h300.h
index 9cb13c0195..b7105b74e1 100644
--- a/firmware/export/config-h300.h
+++ b/firmware/export/config-h300.h
@@ -69,7 +69,7 @@
69#define FLASH_SIZE 0x400000 69#define FLASH_SIZE 0x400000
70 70
71/* Define this for LCD backlight available */ 71/* Define this for LCD backlight available */
72#define CONFIG_BACKLIGHT BL_IRIVER /* port controlled */ 72#define CONFIG_BACKLIGHT BL_IRIVER_H300 /* port controlled PWM */
73 73
74/* Define this to the CPU frequency */ 74/* Define this to the CPU frequency */
75#define CPU_FREQ 11289600 75#define CPU_FREQ 11289600
diff --git a/firmware/export/config.h b/firmware/export/config.h
index 41e639f125..ea047cbace 100644
--- a/firmware/export/config.h
+++ b/firmware/export/config.h
@@ -77,13 +77,14 @@
77#define LCD_IPODNANO 7 /* as used by iPod Nano */ 77#define LCD_IPODNANO 7 /* as used by iPod Nano */
78 78
79/* CONFIG_BACKLIGHT */ 79/* CONFIG_BACKLIGHT */
80#define BL_PA14_LO 0 /* Player, PA14 low active */ 80#define BL_PA14_LO 0 /* Player, PA14 low active */
81#define BL_RTC 1 /* Recorder, RTC square wave output */ 81#define BL_RTC 1 /* Recorder, RTC square wave output */
82#define BL_PA14_HI 2 /* Ondio, PA14 high active */ 82#define BL_PA14_HI 2 /* Ondio, PA14 high active */
83#define BL_IRIVER 3 /* IRiver GPIO */ 83#define BL_IRIVER_H100 3 /* IRiver GPIO */
84#define BL_GMINI 4 /* Archos GMini */ 84#define BL_GMINI 4 /* Archos GMini */
85#define BL_IPOD4G 5 /* Apple iPod 4G */ 85#define BL_IPOD4G 5 /* Apple iPod 4G */
86#define BL_IPODNANO 6 /* Apple iPod Nano */ 86#define BL_IPODNANO 6 /* Apple iPod Nano */
87#define BL_IRIVER_H300 7 /* IRiver PWM */
87 88
88/* CONFIG_I2C */ 89/* CONFIG_I2C */
89#define I2C_PLAYREC 0 /* Archos Player/Recorder style */ 90#define I2C_PLAYREC 0 /* Archos Player/Recorder style */