summaryrefslogtreecommitdiff
path: root/firmware/target/coldfire/iaudio/x5/lcd-x5.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/coldfire/iaudio/x5/lcd-x5.c')
-rw-r--r--firmware/target/coldfire/iaudio/x5/lcd-x5.c85
1 files changed, 42 insertions, 43 deletions
diff --git a/firmware/target/coldfire/iaudio/x5/lcd-x5.c b/firmware/target/coldfire/iaudio/x5/lcd-x5.c
index 190b87547d..98eb5deb94 100644
--- a/firmware/target/coldfire/iaudio/x5/lcd-x5.c
+++ b/firmware/target/coldfire/iaudio/x5/lcd-x5.c
@@ -52,9 +52,6 @@ static unsigned short r_gate_scan_start_pos = 0x0002;
static unsigned short r_drv_output_control = 0x0313;
static unsigned short r_horiz_ram_addr_pos = 0x7f00;
-/* Forward declarations */
-static void lcd_display_off(void);
-
/* A15(0x8000) && CS1->CS, A1(0x0002)->RS */
#define LCD_CMD *(volatile unsigned short *)0xf0008000
#define LCD_DATA *(volatile unsigned short *)0xf0008002
@@ -267,46 +264,6 @@ static void lcd_power_on(void)
power_on = true;
}
-#if defined(HAVE_LCD_SLEEP)
-static void lcd_power_off(void)
-{
- /* Display must be off first */
- if (display_on)
- lcd_display_off();
-
- power_on = false;
-
- /** Power OFF sequence **/
- /* Per datasheet Rev.1.10, Jun.21.2003, p. 99 */
-
- /* Step-up1 halt setting bit */
- /* BT2-0=110, DC2-0=001, AP2-0=011, SLP=0, STB=0 */
- lcd_write_reg(R_POWER_CONTROL1, 0x062c);
- /* Step-up3,4 halt setting bit */
- /* VRL3-0=0100, PON=0, VRH3-0=0001 */
- lcd_write_reg(R_POWER_CONTROL4, 0x0401);
- /* VCOMG=0, VDV4-0=xxxxx, VCM4-0=11000 */
- lcd_write_reg(R_POWER_CONTROL5, 0x0018 | lcd_contrast);
-
- /* Wait 100ms or more */
- sleep(HZ/10);
-
- /* Step-up2,amp halt setting bit */
- /* BT2-0=000, DC2-0=000, AP2-0=000, SLP=0, STB=0 */
- lcd_write_reg(R_POWER_CONTROL1, 0x0000);
-}
-
-void lcd_sleep(void)
-{
- if (power_on)
- lcd_power_off();
-
- /* Set standby mode */
- /* BT2-0=000, DC2-0=000, AP2-0=000, SLP=0, STB=1 */
- lcd_write_reg(R_POWER_CONTROL1, 0x0001);
-}
-#endif
-
static void lcd_display_on(void)
{
/* Be sure power is on first */
@@ -334,6 +291,7 @@ static void lcd_display_on(void)
display_on = true;
}
+#if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP)
static void lcd_display_off(void)
{
display_on = false;
@@ -356,6 +314,47 @@ static void lcd_display_off(void)
/* PT1-0=00, VLE2-1=00, SPT=0, GON=0, DTE=0, REV=0, D1-0=00 */
lcd_write_reg(R_DISP_CONTROL, 0x0000);
}
+#endif
+
+#if defined(HAVE_LCD_SLEEP)
+static void lcd_power_off(void)
+{
+ /* Display must be off first */
+ if (display_on)
+ lcd_display_off();
+
+ power_on = false;
+
+ /** Power OFF sequence **/
+ /* Per datasheet Rev.1.10, Jun.21.2003, p. 99 */
+
+ /* Step-up1 halt setting bit */
+ /* BT2-0=110, DC2-0=001, AP2-0=011, SLP=0, STB=0 */
+ lcd_write_reg(R_POWER_CONTROL1, 0x062c);
+ /* Step-up3,4 halt setting bit */
+ /* VRL3-0=0100, PON=0, VRH3-0=0001 */
+ lcd_write_reg(R_POWER_CONTROL4, 0x0401);
+ /* VCOMG=0, VDV4-0=xxxxx, VCM4-0=11000 */
+ lcd_write_reg(R_POWER_CONTROL5, 0x0018 | lcd_contrast);
+
+ /* Wait 100ms or more */
+ sleep(HZ/10);
+
+ /* Step-up2,amp halt setting bit */
+ /* BT2-0=000, DC2-0=000, AP2-0=000, SLP=0, STB=0 */
+ lcd_write_reg(R_POWER_CONTROL1, 0x0000);
+}
+
+void lcd_sleep(void)
+{
+ if (power_on)
+ lcd_power_off();
+
+ /* Set standby mode */
+ /* BT2-0=000, DC2-0=000, AP2-0=000, SLP=0, STB=1 */
+ lcd_write_reg(R_POWER_CONTROL1, 0x0001);
+}
+#endif
/* LCD init */
void lcd_init_device(void)