diff options
-rwxr-xr-x | firmware/target/coldfire/iaudio/x5/lcd-remote-target.h | 1 | ||||
-rwxr-xr-x | firmware/target/coldfire/iaudio/x5/lcd-remote-x5.c | 45 | ||||
-rw-r--r-- | firmware/target/coldfire/iaudio/x5/power-x5.c | 2 |
3 files changed, 29 insertions, 19 deletions
diff --git a/firmware/target/coldfire/iaudio/x5/lcd-remote-target.h b/firmware/target/coldfire/iaudio/x5/lcd-remote-target.h index 8c20526ff3..783363bef3 100755 --- a/firmware/target/coldfire/iaudio/x5/lcd-remote-target.h +++ b/firmware/target/coldfire/iaudio/x5/lcd-remote-target.h | |||
@@ -28,6 +28,7 @@ void lcd_remote_powersave(bool on); | |||
28 | void lcd_remote_set_contrast(int val); | 28 | void lcd_remote_set_contrast(int val); |
29 | void lcd_remote_on(void); | 29 | void lcd_remote_on(void); |
30 | void lcd_remote_off(void); | 30 | void lcd_remote_off(void); |
31 | void lcd_remote_poweroff(void); /* for when remote is plugged during shutdown*/ | ||
31 | 32 | ||
32 | extern bool remote_initialized; | 33 | extern bool remote_initialized; |
33 | 34 | ||
diff --git a/firmware/target/coldfire/iaudio/x5/lcd-remote-x5.c b/firmware/target/coldfire/iaudio/x5/lcd-remote-x5.c index d707e95ca6..46e1eba1fd 100755 --- a/firmware/target/coldfire/iaudio/x5/lcd-remote-x5.c +++ b/firmware/target/coldfire/iaudio/x5/lcd-remote-x5.c | |||
@@ -23,23 +23,23 @@ | |||
23 | 23 | ||
24 | /* The LCD in the iAudio M3/M5/X5 remote control is a Tomato LSI 0350 */ | 24 | /* The LCD in the iAudio M3/M5/X5 remote control is a Tomato LSI 0350 */ |
25 | 25 | ||
26 | #define LCD_SET_DUTY_RATIO 0x48 | 26 | #define LCD_SET_DUTY_RATIO 0x48 |
27 | #define LCD_SELECT_ADC 0xa0 | 27 | #define LCD_SELECT_ADC 0xa0 |
28 | #define LCD_SELECT_SHL 0xc0 | 28 | #define LCD_SELECT_SHL 0xc0 |
29 | #define LCD_SET_COM0 0x44 | 29 | #define LCD_SET_COM0 0x44 |
30 | #define LCD_OSC_ON 0xab | 30 | #define LCD_OSC_ON 0xab |
31 | #define LCD_SELECT_DCDC 0x64 | 31 | #define LCD_SELECT_DCDC 0x64 |
32 | #define LCD_SELECT_RES 0x20 | 32 | #define LCD_SELECT_RES 0x20 |
33 | #define LCD_SET_VOLUME 0x81 | 33 | #define LCD_SET_VOLUME 0x81 |
34 | #define LCD_SET_BIAS 0x50 | 34 | #define LCD_SET_BIAS 0x50 |
35 | #define LCD_CONTROL_POWER 0x28 | 35 | #define LCD_CONTROL_POWER 0x28 |
36 | #define LCD_DISPLAY_ON 0xae | 36 | #define LCD_DISPLAY_ON 0xae |
37 | #define LCD_SET_INITLINE 0x40 | 37 | #define LCD_SET_INITLINE 0x40 |
38 | #define LCD_SET_COLUMN 0x10 | 38 | #define LCD_SET_COLUMN 0x10 |
39 | #define LCD_SET_PAGE 0xb0 | 39 | #define LCD_SET_PAGE 0xb0 |
40 | #define LCD_SET_GRAY 0x88 | 40 | #define LCD_SET_GRAY 0x88 |
41 | #define LCD_SET_PWM_FRC 0x90 | 41 | #define LCD_SET_PWM_FRC 0x90 |
42 | #define LCD_SET_POWER_SAVE 0xa8 | 42 | #define LCD_SET_POWER_SAVE 0xa8 |
43 | #define LCD_REVERSE 0xa6 | 43 | #define LCD_REVERSE 0xa6 |
44 | 44 | ||
45 | #define CS_LO and_l(~0x00000020, &GPIO1_OUT) | 45 | #define CS_LO and_l(~0x00000020, &GPIO1_OUT) |
@@ -328,7 +328,7 @@ void lcd_remote_init_device(void) | |||
328 | or_l(0x00000020, &GPIO1_OUT); | 328 | or_l(0x00000020, &GPIO1_OUT); |
329 | or_l(0x00000020, &GPIO1_ENABLE); | 329 | or_l(0x00000020, &GPIO1_ENABLE); |
330 | or_l(0x00000020, &GPIO1_FUNCTION); | 330 | or_l(0x00000020, &GPIO1_FUNCTION); |
331 | 331 | ||
332 | and_l(~0x01000000, &GPIO_OUT); | 332 | and_l(~0x01000000, &GPIO_OUT); |
333 | and_l(~0x01000000, &GPIO_ENABLE); | 333 | and_l(~0x01000000, &GPIO_ENABLE); |
334 | or_l(0x01000000, &GPIO_FUNCTION); | 334 | or_l(0x01000000, &GPIO_FUNCTION); |
@@ -339,7 +339,7 @@ void lcd_remote_on(void) | |||
339 | CS_HI; | 339 | CS_HI; |
340 | CLK_HI; | 340 | CLK_HI; |
341 | sleep(10); | 341 | sleep(10); |
342 | 342 | ||
343 | lcd_remote_write_command(LCD_SET_DUTY_RATIO); | 343 | lcd_remote_write_command(LCD_SET_DUTY_RATIO); |
344 | lcd_remote_write_command(0x70); /* 1/128 */ | 344 | lcd_remote_write_command(0x70); /* 1/128 */ |
345 | 345 | ||
@@ -382,6 +382,13 @@ void lcd_remote_off(void) | |||
382 | RS_HI; | 382 | RS_HI; |
383 | } | 383 | } |
384 | 384 | ||
385 | void lcd_remote_poweroff(void) | ||
386 | { | ||
387 | /* Set power save -> Power OFF (VDD - VSS) .. that's it */ | ||
388 | if (remote_initialized && remote_detect()) | ||
389 | lcd_remote_write_command(LCD_SET_POWER_SAVE | 1); | ||
390 | } | ||
391 | |||
385 | /* Update the display. | 392 | /* Update the display. |
386 | This must be called after all other LCD functions that change the display. */ | 393 | This must be called after all other LCD functions that change the display. */ |
387 | void lcd_remote_update(void) ICODE_ATTR; | 394 | void lcd_remote_update(void) ICODE_ATTR; |
diff --git a/firmware/target/coldfire/iaudio/x5/power-x5.c b/firmware/target/coldfire/iaudio/x5/power-x5.c index ee06353149..4d44500fd5 100644 --- a/firmware/target/coldfire/iaudio/x5/power-x5.c +++ b/firmware/target/coldfire/iaudio/x5/power-x5.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include "system.h" | 23 | #include "system.h" |
24 | #include "power.h" | 24 | #include "power.h" |
25 | #include "pcf50606.h" | 25 | #include "pcf50606.h" |
26 | #include "lcd-remote-target.h" | ||
26 | 27 | ||
27 | #ifndef SIMULATOR | 28 | #ifndef SIMULATOR |
28 | 29 | ||
@@ -58,6 +59,7 @@ bool ide_powered(void) | |||
58 | 59 | ||
59 | void power_off(void) | 60 | void power_off(void) |
60 | { | 61 | { |
62 | lcd_remote_poweroff(); | ||
61 | set_irq_level(HIGHEST_IRQ_LEVEL); | 63 | set_irq_level(HIGHEST_IRQ_LEVEL); |
62 | and_l(~0x00000008, &GPIO_OUT); /* Set KEEPACT low */ | 64 | and_l(~0x00000008, &GPIO_OUT); /* Set KEEPACT low */ |
63 | asm("halt"); | 65 | asm("halt"); |