summaryrefslogtreecommitdiff
path: root/firmware/target/arm/imx31/gigabeat-s/lcd-imx31.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/imx31/gigabeat-s/lcd-imx31.c')
-rw-r--r--firmware/target/arm/imx31/gigabeat-s/lcd-imx31.c35
1 files changed, 26 insertions, 9 deletions
diff --git a/firmware/target/arm/imx31/gigabeat-s/lcd-imx31.c b/firmware/target/arm/imx31/gigabeat-s/lcd-imx31.c
index c353380221..47834b3b19 100644
--- a/firmware/target/arm/imx31/gigabeat-s/lcd-imx31.c
+++ b/firmware/target/arm/imx31/gigabeat-s/lcd-imx31.c
@@ -30,8 +30,8 @@
30#define MAIN_LCD_IDMAC_CHANNEL 14 30#define MAIN_LCD_IDMAC_CHANNEL 14
31#define LCDADDR(x, y) (&lcd_framebuffer[(y)][(x)]) 31#define LCDADDR(x, y) (&lcd_framebuffer[(y)][(x)])
32 32
33static volatile bool lcd_on = true; 33static bool lcd_on = true;
34volatile bool lcd_poweroff = false; 34static bool lcd_powered = true;
35static unsigned lcd_yuv_options = 0; 35static unsigned lcd_yuv_options = 0;
36/* 36/*
37** This is imported from lcd-16bit.c 37** This is imported from lcd-16bit.c
@@ -98,24 +98,41 @@ void lcd_update_rect(int x, int y, int width, int height)
98 } 98 }
99} 99}
100 100
101#ifdef HAVE_LCD_SLEEP
102void lcd_sleep(void) 101void lcd_sleep(void)
103{ 102{
104 _backlight_lcd_sleep(); 103 if (lcd_powered)
104 {
105 lcd_enable(false);
106 lcd_powered = false;
107 IPU_IDMAC_CHA_EN &= ~(1ul << MAIN_LCD_IDMAC_CHANNEL);
108 _backlight_lcd_sleep();
109 }
105} 110}
106#endif /* HAVE_LCD_SLEEP */
107 111
108#if 0
109void lcd_enable(bool state) 112void lcd_enable(bool state)
110{ 113{
111 (void)state; 114 if (state == lcd_on)
115 return;
116
117 if (state)
118 {
119 IPU_IDMAC_CHA_EN |= 1ul << MAIN_LCD_IDMAC_CHANNEL;
120 sleep(HZ/50);
121 lcd_powered = true;
122 lcd_on = true;
123 lcd_update();
124 lcd_call_enable_hook();
125 }
126 else
127 {
128 lcd_on = false;
129 }
112} 130}
113 131
114bool lcd_enabled(void) 132bool lcd_enabled(void)
115{ 133{
116 return true; 134 return lcd_on;
117} 135}
118#endif
119 136
120/* Update the display. 137/* Update the display.
121 This must be called after all other LCD functions that change the display. */ 138 This must be called after all other LCD functions that change the display. */