mpc8xx: remove RPXlite_dw, quantum board support
[oweals/u-boot.git] / drivers / video / mpc8xx_lcd.c
1 /*
2  * (C) Copyright 2001-2002
3  * Wolfgang Denk, DENX Software Engineering -- wd@denx.de
4  *
5  * SPDX-License-Identifier:     GPL-2.0+
6  */
7
8 /************************************************************************/
9 /* ** HEADER FILES                                                      */
10 /************************************************************************/
11
12 /* #define DEBUG */
13
14 #include <config.h>
15 #include <common.h>
16 #include <command.h>
17 #include <watchdog.h>
18 #include <version.h>
19 #include <stdarg.h>
20 #include <lcdvideo.h>
21 #include <linux/types.h>
22 #include <stdio_dev.h>
23 #if defined(CONFIG_POST)
24 #include <post.h>
25 #endif
26 #include <lcd.h>
27
28 #ifdef CONFIG_LCD
29
30 /************************************************************************/
31 /* ** CONFIG STUFF -- should be moved to board config file              */
32 /************************************************************************/
33 #ifndef CONFIG_LCD_INFO
34 #define CONFIG_LCD_INFO         /* Display Logo, (C) and system info    */
35 #endif
36
37 #if defined(CONFIG_V37) || defined(CONFIG_EDT32F10)
38 #undef CONFIG_LCD_LOGO
39 #undef CONFIG_LCD_INFO
40 #endif
41
42 /*----------------------------------------------------------------------*/
43 #ifdef CONFIG_KYOCERA_KCS057QV1AJ
44 /*
45  *  Kyocera KCS057QV1AJ-G23. Passive, color, single scan.
46  */
47 #define LCD_BPP LCD_COLOR4
48
49 vidinfo_t panel_info = {
50     640, 480, 132, 99, CONFIG_SYS_HIGH, CONFIG_SYS_HIGH, CONFIG_SYS_HIGH, CONFIG_SYS_HIGH, CONFIG_SYS_HIGH,
51     LCD_BPP, 1, 0, 1, 0,  5, 0, 0, 0
52                 /* wbl, vpw, lcdac, wbf */
53 };
54 #endif /* CONFIG_KYOCERA_KCS057QV1AJ */
55 /*----------------------------------------------------------------------*/
56
57 /*----------------------------------------------------------------------*/
58 #ifdef CONFIG_HITACHI_SP19X001_Z1A
59 /*
60  *  Hitachi SP19X001-. Active, color, single scan.
61  */
62 vidinfo_t panel_info = {
63     640, 480, 154, 116, CONFIG_SYS_HIGH, CONFIG_SYS_HIGH, CONFIG_SYS_HIGH, CONFIG_SYS_HIGH, CONFIG_SYS_HIGH,
64     LCD_COLOR8, 1, 0, 1, 0, 0, 0, 0, 0
65                 /* wbl, vpw, lcdac, wbf */
66 };
67 #endif /* CONFIG_HITACHI_SP19X001_Z1A */
68 /*----------------------------------------------------------------------*/
69
70 /*----------------------------------------------------------------------*/
71 #ifdef CONFIG_NEC_NL6448AC33
72 /*
73  *  NEC NL6448AC33-18. Active, color, single scan.
74  */
75 vidinfo_t panel_info = {
76     640, 480, 132, 99, CONFIG_SYS_HIGH, CONFIG_SYS_HIGH, CONFIG_SYS_LOW, CONFIG_SYS_LOW, CONFIG_SYS_HIGH,
77     3, 0, 0, 1, 1, 144, 2, 0, 33
78                 /* wbl, vpw, lcdac, wbf */
79 };
80 #endif /* CONFIG_NEC_NL6448AC33 */
81 /*----------------------------------------------------------------------*/
82
83 #ifdef CONFIG_NEC_NL6448BC20
84 /*
85  *  NEC NL6448BC20-08.  6.5", 640x480. Active, color, single scan.
86  */
87 vidinfo_t panel_info = {
88     640, 480, 132, 99, CONFIG_SYS_HIGH, CONFIG_SYS_HIGH, CONFIG_SYS_LOW, CONFIG_SYS_LOW, CONFIG_SYS_HIGH,
89     3, 0, 0, 1, 1, 144, 2, 0, 33
90                 /* wbl, vpw, lcdac, wbf */
91 };
92 #endif /* CONFIG_NEC_NL6448BC20 */
93 /*----------------------------------------------------------------------*/
94
95 #ifdef CONFIG_NEC_NL6448BC33_54
96 /*
97  *  NEC NL6448BC33-54. 10.4", 640x480. Active, color, single scan.
98  */
99 vidinfo_t panel_info = {
100     640, 480, 212, 158, CONFIG_SYS_HIGH, CONFIG_SYS_HIGH, CONFIG_SYS_LOW, CONFIG_SYS_LOW, CONFIG_SYS_HIGH,
101     3, 0, 0, 1, 1, 144, 2, 0, 33
102                 /* wbl, vpw, lcdac, wbf */
103 };
104 #endif /* CONFIG_NEC_NL6448BC33_54 */
105 /*----------------------------------------------------------------------*/
106
107 #ifdef CONFIG_SHARP_LQ104V7DS01
108 /*
109  *  SHARP LQ104V7DS01. 6.5", 640x480. Active, color, single scan.
110  */
111 vidinfo_t panel_info = {
112     640, 480, 132, 99, CONFIG_SYS_HIGH, CONFIG_SYS_HIGH, CONFIG_SYS_LOW, CONFIG_SYS_LOW, CONFIG_SYS_LOW,
113     3, 0, 0, 1, 1, 25, 1, 0, 33
114                 /* wbl, vpw, lcdac, wbf */
115 };
116 #endif /* CONFIG_SHARP_LQ104V7DS01 */
117 /*----------------------------------------------------------------------*/
118
119 #ifdef CONFIG_SHARP_16x9
120 /*
121  * Sharp 320x240. Active, color, single scan.  It isn't 16x9, and I am
122  * not sure what it is.......
123  */
124 vidinfo_t panel_info = {
125     320, 240, 0, 0, CONFIG_SYS_HIGH, CONFIG_SYS_HIGH, CONFIG_SYS_HIGH, CONFIG_SYS_HIGH, CONFIG_SYS_HIGH,
126     3, 0, 0, 1, 1, 15, 4, 0, 3
127 };
128 #endif /* CONFIG_SHARP_16x9 */
129 /*----------------------------------------------------------------------*/
130
131 #ifdef CONFIG_SHARP_LQ057Q3DC02
132 /*
133  * Sharp LQ057Q3DC02 display. Active, color, single scan.
134  */
135 #undef LCD_DF
136 #define LCD_DF 12
137
138 vidinfo_t panel_info = {
139     320, 240, 0, 0, CONFIG_SYS_HIGH, CONFIG_SYS_HIGH, CONFIG_SYS_LOW, CONFIG_SYS_LOW, CONFIG_SYS_HIGH,
140     3, 0, 0, 1, 1, 15, 4, 0, 3
141                 /* wbl, vpw, lcdac, wbf */
142 };
143 #define CONFIG_LCD_INFO_BELOW_LOGO
144 #endif /* CONFIG_SHARP_LQ057Q3DC02 */
145 /*----------------------------------------------------------------------*/
146
147 #ifdef CONFIG_SHARP_LQ64D341
148 /*
149  * Sharp LQ64D341 display, 640x480. Active, color, single scan.
150  */
151 vidinfo_t panel_info = {
152     640, 480, 0, 0, CONFIG_SYS_HIGH, CONFIG_SYS_HIGH, CONFIG_SYS_LOW, CONFIG_SYS_LOW, CONFIG_SYS_HIGH,
153     3, 0, 0, 1, 1, 128, 16, 0, 32
154                 /* wbl, vpw, lcdac, wbf */
155 };
156 #endif /* CONFIG_SHARP_LQ64D341 */
157
158 #ifdef CONFIG_SHARP_LQ065T9DR51U
159 /*
160  * Sharp LQ065T9DR51U display, 400x240. Active, color, single scan.
161  */
162 vidinfo_t panel_info = {
163     400, 240, 143, 79, CONFIG_SYS_HIGH, CONFIG_SYS_HIGH, CONFIG_SYS_HIGH, CONFIG_SYS_HIGH, CONFIG_SYS_HIGH,
164     3, 0, 0, 1, 1, 248, 4, 0, 35
165                 /* wbl, vpw, lcdac, wbf */
166 };
167 #define CONFIG_LCD_INFO_BELOW_LOGO
168 #endif /* CONFIG_SHARP_LQ065T9DR51U */
169
170 #ifdef CONFIG_SHARP_LQ084V1DG21
171 /*
172  * Sharp LQ084V1DG21 display, 640x480. Active, color, single scan.
173  */
174 vidinfo_t panel_info = {
175     640, 480, 171, 129, CONFIG_SYS_HIGH, CONFIG_SYS_HIGH, CONFIG_SYS_LOW, CONFIG_SYS_LOW, CONFIG_SYS_LOW,
176     3, 0, 0, 1, 1, 160, 3, 0, 48
177                 /* wbl, vpw, lcdac, wbf */
178 };
179 #endif /* CONFIG_SHARP_LQ084V1DG21 */
180
181 /*----------------------------------------------------------------------*/
182
183 #ifdef CONFIG_HLD1045
184 /*
185  * HLD1045 display, 640x480. Active, color, single scan.
186  */
187 vidinfo_t panel_info = {
188     640, 480, 0, 0, CONFIG_SYS_HIGH, CONFIG_SYS_HIGH, CONFIG_SYS_LOW, CONFIG_SYS_LOW, CONFIG_SYS_HIGH,
189     3, 0, 0, 1, 1, 160, 3, 0, 48
190                 /* wbl, vpw, lcdac, wbf */
191 };
192 #endif /* CONFIG_HLD1045 */
193 /*----------------------------------------------------------------------*/
194
195 #ifdef CONFIG_PRIMEVIEW_V16C6448AC
196 /*
197  * Prime View V16C6448AC
198  */
199 vidinfo_t panel_info = {
200     640, 480, 130, 98, CONFIG_SYS_HIGH, CONFIG_SYS_HIGH, CONFIG_SYS_LOW, CONFIG_SYS_LOW, CONFIG_SYS_HIGH,
201     3, 0, 0, 1, 1, 144, 2, 0, 35
202                 /* wbl, vpw, lcdac, wbf */
203 };
204 #endif /* CONFIG_PRIMEVIEW_V16C6448AC */
205
206 /*----------------------------------------------------------------------*/
207
208 #ifdef CONFIG_OPTREX_BW
209 /*
210  * Optrex   CBL50840-2 NF-FW 99 22 M5
211  * or
212  * Hitachi  LMG6912RPFC-00T
213  * or
214  * Hitachi  SP14Q002
215  *
216  * 320x240. Black & white.
217  */
218 #define OPTREX_BPP      0       /* 0 - monochrome,     1 bpp */
219                                 /* 1 -  4 grey levels, 2 bpp */
220                                 /* 2 - 16 grey levels, 4 bpp */
221 vidinfo_t panel_info = {
222     320, 240, 0, 0, CONFIG_SYS_HIGH, CONFIG_SYS_HIGH, CONFIG_SYS_HIGH, CONFIG_SYS_HIGH, CONFIG_SYS_LOW,
223     OPTREX_BPP, 0, 0, 0, 0, 0, 0, 0, 0, 4
224 };
225 #endif /* CONFIG_OPTREX_BW */
226
227 /*-----------------------------------------------------------------*/
228 #ifdef CONFIG_EDT32F10
229 /*
230  * Emerging Display Technologies 320x240. Passive, monochrome, single scan.
231  */
232 #define LCD_BPP         LCD_MONOCHROME
233 #define LCD_DF          10
234
235 vidinfo_t panel_info = {
236     320, 240, 0, 0, CONFIG_SYS_HIGH, CONFIG_SYS_HIGH, CONFIG_SYS_HIGH, CONFIG_SYS_HIGH, CONFIG_SYS_LOW,
237     LCD_BPP,  0, 0, 0, 0, 33, 0, 0, 0
238 };
239 #endif
240
241 /************************************************************************/
242 /* ----------------- chipset specific functions ----------------------- */
243 /************************************************************************/
244
245 /*
246  * Calculate fb size for VIDEOLFB_ATAG.
247  */
248 ulong calc_fbsize (void)
249 {
250         ulong size;
251         int line_length = (panel_info.vl_col * NBITS (panel_info.vl_bpix)) / 8;
252
253         size = line_length * panel_info.vl_row;
254
255         return size;
256 }
257
258 void lcd_ctrl_init (void *lcdbase)
259 {
260         volatile immap_t *immr = (immap_t *) CONFIG_SYS_IMMR;
261         volatile lcd823_t *lcdp = &immr->im_lcd;
262
263         uint lccrtmp;
264         uint lchcr_hpc_tmp;
265
266         /* Initialize the LCD control register according to the LCD
267          * parameters defined.  We do everything here but enable
268          * the controller.
269          */
270
271         lccrtmp  = LCDBIT (LCCR_BNUM_BIT,
272                    (((panel_info.vl_row * panel_info.vl_col) * (1 << LCD_BPP)) / 128));
273
274         lccrtmp |= LCDBIT (LCCR_CLKP_BIT, panel_info.vl_clkp)   |
275                    LCDBIT (LCCR_OEP_BIT,  panel_info.vl_oep)    |
276                    LCDBIT (LCCR_HSP_BIT,  panel_info.vl_hsp)    |
277                    LCDBIT (LCCR_VSP_BIT,  panel_info.vl_vsp)    |
278                    LCDBIT (LCCR_DP_BIT,   panel_info.vl_dp)     |
279                    LCDBIT (LCCR_BPIX_BIT, panel_info.vl_bpix)   |
280                    LCDBIT (LCCR_LBW_BIT,  panel_info.vl_lbw)    |
281                    LCDBIT (LCCR_SPLT_BIT, panel_info.vl_splt)   |
282                    LCDBIT (LCCR_CLOR_BIT, panel_info.vl_clor)   |
283                    LCDBIT (LCCR_TFT_BIT,  panel_info.vl_tft);
284
285 #if 0
286         lccrtmp |= ((SIU_LEVEL5 / 2) << 12);
287         lccrtmp |= LCCR_EIEN;
288 #endif
289
290         lcdp->lcd_lccr = lccrtmp;
291         lcdp->lcd_lcsr = 0xFF;          /* Clear pending interrupts */
292
293         /* Initialize LCD controller bus priorities.
294          */
295 #ifdef CONFIG_RBC823
296         immr->im_siu_conf.sc_sdcr = (immr->im_siu_conf.sc_sdcr & ~0x0f) | 1;    /* RAID = 01, LAID = 00 */
297 #else
298         immr->im_siu_conf.sc_sdcr &= ~0x0f;     /* RAID = LAID = 0 */
299
300         /* set SHFT/CLOCK division factor 4
301          * This needs to be set based upon display type and processor
302          * speed.  The TFT displays run about 20 to 30 MHz.
303          * I was running 64 MHz processor speed.
304          * The value for this divider must be chosen so the result is
305          * an integer of the processor speed (i.e., divide by 3 with
306          * 64 MHz would be bad).
307          */
308         immr->im_clkrst.car_sccr &= ~0x1F;
309         immr->im_clkrst.car_sccr |= LCD_DF;     /* was 8 */
310
311 #endif /* CONFIG_RBC823 */
312
313 #if defined(CONFIG_RBC823)
314         /* Enable LCD on port D.
315          */
316         immr->im_ioport.iop_pddat &= 0x0300;
317         immr->im_ioport.iop_pdpar |= 0x1CFF;
318         immr->im_ioport.iop_pddir |= 0x1CFF;
319
320         /* Configure LCD_ON, VEE_ON, CCFL_ON on port B.
321          */
322         immr->im_cpm.cp_pbdat &= ~0x00005001;
323         immr->im_cpm.cp_pbpar &= ~0x00005001;
324         immr->im_cpm.cp_pbdir |=  0x00005001;
325 #elif !defined(CONFIG_EDT32F10)
326         /* Enable LCD on port D.
327          */
328         immr->im_ioport.iop_pdpar |= 0x1FFF;
329         immr->im_ioport.iop_pddir |= 0x1FFF;
330
331         /* Enable LCD_A/B/C on port B.
332          */
333         immr->im_cpm.cp_pbpar |= 0x00005001;
334         immr->im_cpm.cp_pbdir |= 0x00005001;
335 #else
336         /* Enable LCD on port D.
337          */
338         immr->im_ioport.iop_pdpar |= 0x1DFF;
339         immr->im_ioport.iop_pdpar &= ~0x0200;
340         immr->im_ioport.iop_pddir |= 0x1FFF;
341         immr->im_ioport.iop_pddat |= 0x0200;
342 #endif
343
344         /* Load the physical address of the linear frame buffer
345          * into the LCD controller.
346          * BIG NOTE:  This has to be modified to load A and B depending
347          * upon the split mode of the LCD.
348          */
349         lcdp->lcd_lcfaa = (ulong)lcdbase;
350         lcdp->lcd_lcfba = (ulong)lcdbase;
351
352         /* MORE HACKS...This must be updated according to 823 manual
353          * for different panels.
354          * Udi Finkelstein - done - see below:
355          * Note: You better not try unsupported combinations such as
356          * 4-bit wide passive dual scan LCD at 4/8 Bit color.
357          */
358         lchcr_hpc_tmp =
359                 (panel_info.vl_col *
360                  (panel_info.vl_tft ? 8 :
361                         (((2 - panel_info.vl_lbw) << /* 4 bit=2, 8-bit = 1 */
362                          /* use << to mult by: single scan = 1, dual scan = 2 */
363                           panel_info.vl_splt) *
364                          (panel_info.vl_bpix | 1)))) >> 3; /* 2/4 BPP = 1, 8/16 BPP = 3 */
365
366         lcdp->lcd_lchcr = LCHCR_BO |
367                           LCDBIT (LCHCR_AT_BIT, 4) |
368                           LCDBIT (LCHCR_HPC_BIT, lchcr_hpc_tmp) |
369                           panel_info.vl_wbl;
370
371         lcdp->lcd_lcvcr = LCDBIT (LCVCR_VPW_BIT, panel_info.vl_vpw) |
372                           LCDBIT (LCVCR_LCD_AC_BIT, panel_info.vl_lcdac) |
373                           LCDBIT (LCVCR_VPC_BIT, panel_info.vl_row) |
374                           panel_info.vl_wbf;
375
376 }
377
378 /*----------------------------------------------------------------------*/
379
380 #if LCD_BPP == LCD_COLOR8
381 void
382 lcd_setcolreg (ushort regno, ushort red, ushort green, ushort blue)
383 {
384         volatile immap_t *immr = (immap_t *) CONFIG_SYS_IMMR;
385         volatile cpm8xx_t *cp = &(immr->im_cpm);
386         unsigned short colreg, *cmap_ptr;
387
388         cmap_ptr = (unsigned short *)&cp->lcd_cmap[regno * 2];
389
390         colreg = ((red   & 0x0F) << 8) |
391                  ((green & 0x0F) << 4) |
392                   (blue  & 0x0F) ;
393 #ifdef  CONFIG_SYS_INVERT_COLORS
394         colreg ^= 0x0FFF;
395 #endif
396         *cmap_ptr = colreg;
397
398         debug ("setcolreg: reg %2d @ %p: R=%02X G=%02X B=%02X => %02X%02X\n",
399                 regno, &(cp->lcd_cmap[regno * 2]),
400                 red, green, blue,
401                 cp->lcd_cmap[ regno * 2 ], cp->lcd_cmap[(regno * 2) + 1]);
402 }
403 #endif  /* LCD_COLOR8 */
404
405 /*----------------------------------------------------------------------*/
406
407 #if LCD_BPP == LCD_MONOCHROME
408 static
409 void lcd_initcolregs (void)
410 {
411         volatile immap_t *immr = (immap_t *) CONFIG_SYS_IMMR;
412         volatile cpm8xx_t *cp = &(immr->im_cpm);
413         ushort regno;
414
415         for (regno = 0; regno < 16; regno++) {
416                 cp->lcd_cmap[regno * 2] = 0;
417                 cp->lcd_cmap[(regno * 2) + 1] = regno & 0x0f;
418         }
419 }
420 #endif
421
422 /*----------------------------------------------------------------------*/
423
424 void lcd_enable (void)
425 {
426         volatile immap_t *immr = (immap_t *) CONFIG_SYS_IMMR;
427         volatile lcd823_t *lcdp = &immr->im_lcd;
428
429         /* Enable the LCD panel */
430 #ifndef CONFIG_RBC823
431         immr->im_siu_conf.sc_sdcr |= (1 << (31 - 25));          /* LAM = 1 */
432 #endif
433         lcdp->lcd_lccr |= LCCR_PON;
434
435 #ifdef CONFIG_V37
436         /* Turn on display backlight */
437         immr->im_cpm.cp_pbpar |= 0x00008000;
438         immr->im_cpm.cp_pbdir |= 0x00008000;
439 #elif defined(CONFIG_RBC823)
440         /* Turn on display backlight */
441         immr->im_cpm.cp_pbdat |= 0x00004000;
442 #endif
443
444 #if defined(CONFIG_LWMON)
445     {   uchar c = pic_read (0x60);
446 #if defined(CONFIG_LCD) && defined(CONFIG_LWMON) && (CONFIG_POST & CONFIG_SYS_POST_SYSMON)
447         /* Enable LCD later in sysmon test, only if temperature is OK */
448 #else
449         c |= 0x07;      /* Power on CCFL, Enable CCFL, Chip Enable LCD */
450 #endif
451         pic_write (0x60, c);
452     }
453 #endif /* CONFIG_LWMON */
454
455 #if defined(CONFIG_R360MPI)
456     {
457         extern void r360_i2c_lcd_write (uchar data0, uchar data1);
458         unsigned long bgi, ctr;
459         char *p;
460
461         if ((p = getenv("lcdbgi")) != NULL) {
462                 bgi = simple_strtoul (p, 0, 10) & 0xFFF;
463         } else {
464                 bgi = 0xFFF;
465         }
466
467         if ((p = getenv("lcdctr")) != NULL) {
468                 ctr = simple_strtoul (p, 0, 10) & 0xFFF;
469         } else {
470                 ctr=0x7FF;
471         }
472
473         r360_i2c_lcd_write(0x10, 0x01);
474         r360_i2c_lcd_write(0x20, 0x01);
475         r360_i2c_lcd_write(0x30 | ((bgi>>8) & 0xF), bgi & 0xFF);
476         r360_i2c_lcd_write(0x40 | ((ctr>>8) & 0xF), ctr & 0xFF);
477     }
478 #endif /* CONFIG_R360MPI */
479 #ifdef CONFIG_RBC823
480         udelay(200000); /* wait 200ms */
481         /* Turn VEE_ON first */
482         immr->im_cpm.cp_pbdat |= 0x00000001;
483         udelay(200000); /* wait 200ms */
484         /* Now turn on LCD_ON */
485         immr->im_cpm.cp_pbdat |= 0x00001000;
486 #endif
487 #ifdef CONFIG_RRVISION
488         debug ("PC4->Output(1): enable LVDS\n");
489         debug ("PC5->Output(0): disable PAL clock\n");
490         immr->im_ioport.iop_pddir |=  0x1000;
491         immr->im_ioport.iop_pcpar &= ~(0x0C00);
492         immr->im_ioport.iop_pcdir |=   0x0C00 ;
493         immr->im_ioport.iop_pcdat |=   0x0800 ;
494         immr->im_ioport.iop_pcdat &= ~(0x0400);
495         debug ("PDPAR=0x%04X PDDIR=0x%04X PDDAT=0x%04X\n",
496                immr->im_ioport.iop_pdpar,
497                immr->im_ioport.iop_pddir,
498                immr->im_ioport.iop_pddat);
499         debug ("PCPAR=0x%04X PCDIR=0x%04X PCDAT=0x%04X\n",
500                immr->im_ioport.iop_pcpar,
501                immr->im_ioport.iop_pcdir,
502                immr->im_ioport.iop_pcdat);
503 #endif
504 }
505
506 /*----------------------------------------------------------------------*/
507
508 #if defined (CONFIG_RBC823)
509 void lcd_disable (void)
510 {
511         volatile immap_t *immr = (immap_t *) CONFIG_SYS_IMMR;
512         volatile lcd823_t *lcdp = &immr->im_lcd;
513
514 #if defined(CONFIG_LWMON)
515     {   uchar c = pic_read (0x60);
516         c &= ~0x07;     /* Power off CCFL, Disable CCFL, Chip Disable LCD */
517         pic_write (0x60, c);
518     }
519 #elif defined(CONFIG_R360MPI)
520     {
521         extern void r360_i2c_lcd_write (uchar data0, uchar data1);
522
523         r360_i2c_lcd_write(0x10, 0x00);
524         r360_i2c_lcd_write(0x20, 0x00);
525         r360_i2c_lcd_write(0x30, 0x00);
526         r360_i2c_lcd_write(0x40, 0x00);
527     }
528 #endif /* CONFIG_LWMON */
529         /* Disable the LCD panel */
530         lcdp->lcd_lccr &= ~LCCR_PON;
531 #ifdef CONFIG_RBC823
532         /* Turn off display backlight, VEE and LCD_ON */
533         immr->im_cpm.cp_pbdat &= ~0x00005001;
534 #else
535         immr->im_siu_conf.sc_sdcr &= ~(1 << (31 - 25)); /* LAM = 0 */
536 #endif /* CONFIG_RBC823 */
537 }
538 #endif  /* NOT_USED_SO_FAR || CONFIG_RBC823 */
539
540
541 /************************************************************************/
542
543 #endif /* CONFIG_LCD */