aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Hennerich <michael.hennerich@analog.com>2010-05-24 17:33:52 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-05-25 11:07:08 -0400
commitfbd65e0ecdeffe5e50ad850fb7240888b1af6b22 (patch)
treef7122e2264f303bed183f7cbe13f74f805bb5e4b
parent5815e5d36eff44b3dd38943f3a98a4d9ce985118 (diff)
fbdev: bfin-lq035q1-fb: respect new PPI mode platform field
This lets us support the new BF527-EZKIT V2.1 via platform resources tweaks only. Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org> Cc: Bryan Wu <cooloney@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--drivers/video/bfin-lq035q1-fb.c252
1 files changed, 146 insertions, 106 deletions
diff --git a/drivers/video/bfin-lq035q1-fb.c b/drivers/video/bfin-lq035q1-fb.c
index 2baac7cc1425..c8e1f04941bd 100644
--- a/drivers/video/bfin-lq035q1-fb.c
+++ b/drivers/video/bfin-lq035q1-fb.c
@@ -61,47 +61,13 @@
61#define LCD_X_RES 320 /* Horizontal Resolution */ 61#define LCD_X_RES 320 /* Horizontal Resolution */
62#define LCD_Y_RES 240 /* Vertical Resolution */ 62#define LCD_Y_RES 240 /* Vertical Resolution */
63#define DMA_BUS_SIZE 16 63#define DMA_BUS_SIZE 16
64#define U_LINE 4 /* Blanking Lines */
64 65
65#define USE_RGB565_16_BIT_PPI
66
67#ifdef USE_RGB565_16_BIT_PPI
68#define LCD_BPP 16 /* Bit Per Pixel */
69#define CLOCKS_PER_PIX 1
70#define CPLD_PIPELINE_DELAY_COR 0 /* NO CPLB */
71#endif
72 66
73/* Interface 16/18-bit TFT over an 8-bit wide PPI using a small Programmable Logic Device (CPLD) 67/* Interface 16/18-bit TFT over an 8-bit wide PPI using a small Programmable Logic Device (CPLD)
74 * http://blackfin.uclinux.org/gf/project/stamp/frs/?action=FrsReleaseBrowse&frs_package_id=165 68 * http://blackfin.uclinux.org/gf/project/stamp/frs/?action=FrsReleaseBrowse&frs_package_id=165
75 */ 69 */
76 70
77#ifdef USE_RGB565_8_BIT_PPI
78#define LCD_BPP 16 /* Bit Per Pixel */
79#define CLOCKS_PER_PIX 2
80#define CPLD_PIPELINE_DELAY_COR 3 /* RGB565 */
81#endif
82
83#ifdef USE_RGB888_8_BIT_PPI
84#define LCD_BPP 24 /* Bit Per Pixel */
85#define CLOCKS_PER_PIX 3
86#define CPLD_PIPELINE_DELAY_COR 5 /* RGB888 */
87#endif
88
89 /*
90 * HS and VS timing parameters (all in number of PPI clk ticks)
91 */
92
93#define U_LINE 4 /* Blanking Lines */
94
95#define H_ACTPIX (LCD_X_RES * CLOCKS_PER_PIX) /* active horizontal pixel */
96#define H_PERIOD (336 * CLOCKS_PER_PIX) /* HS period */
97#define H_PULSE (2 * CLOCKS_PER_PIX) /* HS pulse width */
98#define H_START (7 * CLOCKS_PER_PIX + CPLD_PIPELINE_DELAY_COR) /* first valid pixel */
99
100#define V_LINES (LCD_Y_RES + U_LINE) /* total vertical lines */
101#define V_PULSE (2 * CLOCKS_PER_PIX) /* VS pulse width (1-5 H_PERIODs) */
102#define V_PERIOD (H_PERIOD * V_LINES) /* VS period */
103
104#define ACTIVE_VIDEO_MEM_OFFSET ((U_LINE / 2) * LCD_X_RES * (LCD_BPP / 8))
105 71
106#define BFIN_LCD_NBR_PALETTE_ENTRIES 256 72#define BFIN_LCD_NBR_PALETTE_ENTRIES 256
107 73
@@ -110,12 +76,6 @@
110#define PPI_PORT_CFG_01 0x10 76#define PPI_PORT_CFG_01 0x10
111#define PPI_POLS_1 0x8000 77#define PPI_POLS_1 0x8000
112 78
113#if (CLOCKS_PER_PIX > 1)
114#define PPI_PMODE (DLEN_8 | PACK_EN)
115#else
116#define PPI_PMODE (DLEN_16)
117#endif
118
119#define LQ035_INDEX 0x74 79#define LQ035_INDEX 0x74
120#define LQ035_DATA 0x76 80#define LQ035_DATA 0x76
121 81
@@ -139,6 +99,15 @@ struct bfin_lq035q1fb_info {
139 int irq; 99 int irq;
140 spinlock_t lock; /* lock */ 100 spinlock_t lock; /* lock */
141 u32 pseudo_pal[16]; 101 u32 pseudo_pal[16];
102
103 u32 lcd_bpp;
104 u32 h_actpix;
105 u32 h_period;
106 u32 h_pulse;
107 u32 h_start;
108 u32 v_lines;
109 u32 v_pulse;
110 u32 v_period;
142}; 111};
143 112
144static int nocursor; 113static int nocursor;
@@ -234,16 +203,69 @@ static int lq035q1_backlight(struct bfin_lq035q1fb_info *info, unsigned arg)
234 return 0; 203 return 0;
235} 204}
236 205
206static int bfin_lq035q1_calc_timing(struct bfin_lq035q1fb_info *fbi)
207{
208 unsigned long clocks_per_pix, cpld_pipeline_delay_cor;
209
210 /*
211 * Interface 16/18-bit TFT over an 8-bit wide PPI using a small
212 * Programmable Logic Device (CPLD)
213 * http://blackfin.uclinux.org/gf/project/stamp/frs/?action=FrsReleaseBrowse&frs_package_id=165
214 */
215
216 switch (fbi->disp_info->ppi_mode) {
217 case USE_RGB565_16_BIT_PPI:
218 fbi->lcd_bpp = 16;
219 clocks_per_pix = 1;
220 cpld_pipeline_delay_cor = 0;
221 break;
222 case USE_RGB565_8_BIT_PPI:
223 fbi->lcd_bpp = 16;
224 clocks_per_pix = 2;
225 cpld_pipeline_delay_cor = 3;
226 break;
227 case USE_RGB888_8_BIT_PPI:
228 fbi->lcd_bpp = 24;
229 clocks_per_pix = 3;
230 cpld_pipeline_delay_cor = 5;
231 break;
232 default:
233 return -EINVAL;
234 }
235
236 /*
237 * HS and VS timing parameters (all in number of PPI clk ticks)
238 */
239
240 fbi->h_actpix = (LCD_X_RES * clocks_per_pix); /* active horizontal pixel */
241 fbi->h_period = (336 * clocks_per_pix); /* HS period */
242 fbi->h_pulse = (2 * clocks_per_pix); /* HS pulse width */
243 fbi->h_start = (7 * clocks_per_pix + cpld_pipeline_delay_cor); /* first valid pixel */
244
245 fbi->v_lines = (LCD_Y_RES + U_LINE); /* total vertical lines */
246 fbi->v_pulse = (2 * clocks_per_pix); /* VS pulse width (1-5 H_PERIODs) */
247 fbi->v_period = (fbi->h_period * fbi->v_lines); /* VS period */
248
249 return 0;
250}
251
237static void bfin_lq035q1_config_ppi(struct bfin_lq035q1fb_info *fbi) 252static void bfin_lq035q1_config_ppi(struct bfin_lq035q1fb_info *fbi)
238{ 253{
239 bfin_write_PPI_DELAY(H_START); 254 unsigned ppi_pmode;
240 bfin_write_PPI_COUNT(H_ACTPIX - 1); 255
241 bfin_write_PPI_FRAME(V_LINES); 256 if (fbi->disp_info->ppi_mode == USE_RGB565_16_BIT_PPI)
257 ppi_pmode = DLEN_16;
258 else
259 ppi_pmode = (DLEN_8 | PACK_EN);
260
261 bfin_write_PPI_DELAY(fbi->h_start);
262 bfin_write_PPI_COUNT(fbi->h_actpix - 1);
263 bfin_write_PPI_FRAME(fbi->v_lines);
242 264
243 bfin_write_PPI_CONTROL(PPI_TX_MODE | /* output mode , PORT_DIR */ 265 bfin_write_PPI_CONTROL(PPI_TX_MODE | /* output mode , PORT_DIR */
244 PPI_XFER_TYPE_11 | /* sync mode XFR_TYPE */ 266 PPI_XFER_TYPE_11 | /* sync mode XFR_TYPE */
245 PPI_PORT_CFG_01 | /* two frame sync PORT_CFG */ 267 PPI_PORT_CFG_01 | /* two frame sync PORT_CFG */
246 PPI_PMODE | /* 8/16 bit data length / PACK_EN? */ 268 ppi_pmode | /* 8/16 bit data length / PACK_EN? */
247 PPI_POLS_1); /* faling edge syncs POLS */ 269 PPI_POLS_1); /* faling edge syncs POLS */
248} 270}
249 271
@@ -272,19 +294,19 @@ static void bfin_lq035q1_stop_timers(void)
272 294
273} 295}
274 296
275static void bfin_lq035q1_init_timers(void) 297static void bfin_lq035q1_init_timers(struct bfin_lq035q1fb_info *fbi)
276{ 298{
277 299
278 bfin_lq035q1_stop_timers(); 300 bfin_lq035q1_stop_timers();
279 301
280 set_gptimer_period(TIMER_HSYNC_id, H_PERIOD); 302 set_gptimer_period(TIMER_HSYNC_id, fbi->h_period);
281 set_gptimer_pwidth(TIMER_HSYNC_id, H_PULSE); 303 set_gptimer_pwidth(TIMER_HSYNC_id, fbi->h_pulse);
282 set_gptimer_config(TIMER_HSYNC_id, TIMER_MODE_PWM | TIMER_PERIOD_CNT | 304 set_gptimer_config(TIMER_HSYNC_id, TIMER_MODE_PWM | TIMER_PERIOD_CNT |
283 TIMER_TIN_SEL | TIMER_CLK_SEL| 305 TIMER_TIN_SEL | TIMER_CLK_SEL|
284 TIMER_EMU_RUN); 306 TIMER_EMU_RUN);
285 307
286 set_gptimer_period(TIMER_VSYNC_id, V_PERIOD); 308 set_gptimer_period(TIMER_VSYNC_id, fbi->v_period);
287 set_gptimer_pwidth(TIMER_VSYNC_id, V_PULSE); 309 set_gptimer_pwidth(TIMER_VSYNC_id, fbi->v_pulse);
288 set_gptimer_config(TIMER_VSYNC_id, TIMER_MODE_PWM | TIMER_PERIOD_CNT | 310 set_gptimer_config(TIMER_VSYNC_id, TIMER_MODE_PWM | TIMER_PERIOD_CNT |
289 TIMER_TIN_SEL | TIMER_CLK_SEL | 311 TIMER_TIN_SEL | TIMER_CLK_SEL |
290 TIMER_EMU_RUN); 312 TIMER_EMU_RUN);
@@ -294,21 +316,21 @@ static void bfin_lq035q1_init_timers(void)
294static void bfin_lq035q1_config_dma(struct bfin_lq035q1fb_info *fbi) 316static void bfin_lq035q1_config_dma(struct bfin_lq035q1fb_info *fbi)
295{ 317{
296 318
319
297 set_dma_config(CH_PPI, 320 set_dma_config(CH_PPI,
298 set_bfin_dma_config(DIR_READ, DMA_FLOW_AUTO, 321 set_bfin_dma_config(DIR_READ, DMA_FLOW_AUTO,
299 INTR_DISABLE, DIMENSION_2D, 322 INTR_DISABLE, DIMENSION_2D,
300 DATA_SIZE_16, 323 DATA_SIZE_16,
301 DMA_NOSYNC_KEEP_DMA_BUF)); 324 DMA_NOSYNC_KEEP_DMA_BUF));
302 set_dma_x_count(CH_PPI, (LCD_X_RES * LCD_BPP) / DMA_BUS_SIZE); 325 set_dma_x_count(CH_PPI, (LCD_X_RES * fbi->lcd_bpp) / DMA_BUS_SIZE);
303 set_dma_x_modify(CH_PPI, DMA_BUS_SIZE / 8); 326 set_dma_x_modify(CH_PPI, DMA_BUS_SIZE / 8);
304 set_dma_y_count(CH_PPI, V_LINES); 327 set_dma_y_count(CH_PPI, fbi->v_lines);
305 328
306 set_dma_y_modify(CH_PPI, DMA_BUS_SIZE / 8); 329 set_dma_y_modify(CH_PPI, DMA_BUS_SIZE / 8);
307 set_dma_start_addr(CH_PPI, (unsigned long)fbi->fb_buffer); 330 set_dma_start_addr(CH_PPI, (unsigned long)fbi->fb_buffer);
308 331
309} 332}
310 333
311#if (CLOCKS_PER_PIX == 1)
312static const u16 ppi0_req_16[] = {P_PPI0_CLK, P_PPI0_FS1, P_PPI0_FS2, 334static const u16 ppi0_req_16[] = {P_PPI0_CLK, P_PPI0_FS1, P_PPI0_FS2,
313 P_PPI0_D0, P_PPI0_D1, P_PPI0_D2, 335 P_PPI0_D0, P_PPI0_D1, P_PPI0_D2,
314 P_PPI0_D3, P_PPI0_D4, P_PPI0_D5, 336 P_PPI0_D3, P_PPI0_D4, P_PPI0_D5,
@@ -316,22 +338,27 @@ static const u16 ppi0_req_16[] = {P_PPI0_CLK, P_PPI0_FS1, P_PPI0_FS2,
316 P_PPI0_D9, P_PPI0_D10, P_PPI0_D11, 338 P_PPI0_D9, P_PPI0_D10, P_PPI0_D11,
317 P_PPI0_D12, P_PPI0_D13, P_PPI0_D14, 339 P_PPI0_D12, P_PPI0_D13, P_PPI0_D14,
318 P_PPI0_D15, 0}; 340 P_PPI0_D15, 0};
319#else 341
320static const u16 ppi0_req_16[] = {P_PPI0_CLK, P_PPI0_FS1, P_PPI0_FS2, 342static const u16 ppi0_req_8[] = {P_PPI0_CLK, P_PPI0_FS1, P_PPI0_FS2,
321 P_PPI0_D0, P_PPI0_D1, P_PPI0_D2, 343 P_PPI0_D0, P_PPI0_D1, P_PPI0_D2,
322 P_PPI0_D3, P_PPI0_D4, P_PPI0_D5, 344 P_PPI0_D3, P_PPI0_D4, P_PPI0_D5,
323 P_PPI0_D6, P_PPI0_D7, 0}; 345 P_PPI0_D6, P_PPI0_D7, 0};
324#endif
325 346
326static inline void bfin_lq035q1_free_ports(void) 347static inline void bfin_lq035q1_free_ports(unsigned ppi16)
327{ 348{
328 peripheral_free_list(ppi0_req_16); 349 if (ppi16)
350 peripheral_free_list(ppi0_req_16);
351 else
352 peripheral_free_list(ppi0_req_8);
353
329 if (ANOMALY_05000400) 354 if (ANOMALY_05000400)
330 gpio_free(P_IDENT(P_PPI0_FS3)); 355 gpio_free(P_IDENT(P_PPI0_FS3));
331} 356}
332 357
333static int __devinit bfin_lq035q1_request_ports(struct platform_device *pdev) 358static int __devinit bfin_lq035q1_request_ports(struct platform_device *pdev,
359 unsigned ppi16)
334{ 360{
361 int ret;
335 /* ANOMALY_05000400 - PPI Does Not Start Properly In Specific Mode: 362 /* ANOMALY_05000400 - PPI Does Not Start Properly In Specific Mode:
336 * Drive PPI_FS3 Low 363 * Drive PPI_FS3 Low
337 */ 364 */
@@ -342,7 +369,12 @@ static int __devinit bfin_lq035q1_request_ports(struct platform_device *pdev)
342 gpio_direction_output(P_IDENT(P_PPI0_FS3), 0); 369 gpio_direction_output(P_IDENT(P_PPI0_FS3), 0);
343 } 370 }
344 371
345 if (peripheral_request_list(ppi0_req_16, DRIVER_NAME)) { 372 if (ppi16)
373 ret = peripheral_request_list(ppi0_req_16, DRIVER_NAME);
374 else
375 ret = peripheral_request_list(ppi0_req_8, DRIVER_NAME);
376
377 if (ret) {
346 dev_err(&pdev->dev, "requesting peripherals failed\n"); 378 dev_err(&pdev->dev, "requesting peripherals failed\n");
347 return -EFAULT; 379 return -EFAULT;
348 } 380 }
@@ -364,7 +396,7 @@ static int bfin_lq035q1_fb_open(struct fb_info *info, int user)
364 396
365 bfin_lq035q1_config_dma(fbi); 397 bfin_lq035q1_config_dma(fbi);
366 bfin_lq035q1_config_ppi(fbi); 398 bfin_lq035q1_config_ppi(fbi);
367 bfin_lq035q1_init_timers(); 399 bfin_lq035q1_init_timers(fbi);
368 400
369 /* start dma */ 401 /* start dma */
370 enable_dma(CH_PPI); 402 enable_dma(CH_PPI);
@@ -402,12 +434,9 @@ static int bfin_lq035q1_fb_release(struct fb_info *info, int user)
402static int bfin_lq035q1_fb_check_var(struct fb_var_screeninfo *var, 434static int bfin_lq035q1_fb_check_var(struct fb_var_screeninfo *var,
403 struct fb_info *info) 435 struct fb_info *info)
404{ 436{
405 switch (var->bits_per_pixel) { 437 struct bfin_lq035q1fb_info *fbi = info->par;
406#if (LCD_BPP == 24) 438
407 case 24:/* TRUECOLOUR, 16m */ 439 if (var->bits_per_pixel == fbi->lcd_bpp) {
408#else
409 case 16:/* DIRECTCOLOUR, 64k */
410#endif
411 var->red.offset = info->var.red.offset; 440 var->red.offset = info->var.red.offset;
412 var->green.offset = info->var.green.offset; 441 var->green.offset = info->var.green.offset;
413 var->blue.offset = info->var.blue.offset; 442 var->blue.offset = info->var.blue.offset;
@@ -420,8 +449,7 @@ static int bfin_lq035q1_fb_check_var(struct fb_var_screeninfo *var,
420 var->red.msb_right = 0; 449 var->red.msb_right = 0;
421 var->green.msb_right = 0; 450 var->green.msb_right = 0;
422 var->blue.msb_right = 0; 451 var->blue.msb_right = 0;
423 break; 452 } else {
424 default:
425 pr_debug("%s: depth not supported: %u BPP\n", __func__, 453 pr_debug("%s: depth not supported: %u BPP\n", __func__,
426 var->bits_per_pixel); 454 var->bits_per_pixel);
427 return -EINVAL; 455 return -EINVAL;
@@ -528,6 +556,7 @@ static int __devinit bfin_lq035q1_probe(struct platform_device *pdev)
528{ 556{
529 struct bfin_lq035q1fb_info *info; 557 struct bfin_lq035q1fb_info *info;
530 struct fb_info *fbinfo; 558 struct fb_info *fbinfo;
559 u32 active_video_mem_offset;
531 int ret; 560 int ret;
532 561
533 ret = request_dma(CH_PPI, DRIVER_NAME"_CH_PPI"); 562 ret = request_dma(CH_PPI, DRIVER_NAME"_CH_PPI");
@@ -550,6 +579,12 @@ static int __devinit bfin_lq035q1_probe(struct platform_device *pdev)
550 579
551 platform_set_drvdata(pdev, fbinfo); 580 platform_set_drvdata(pdev, fbinfo);
552 581
582 ret = bfin_lq035q1_calc_timing(info);
583 if (ret < 0) {
584 dev_err(&pdev->dev, "Failed PPI Mode\n");
585 goto out3;
586 }
587
553 strcpy(fbinfo->fix.id, DRIVER_NAME); 588 strcpy(fbinfo->fix.id, DRIVER_NAME);
554 589
555 fbinfo->fix.type = FB_TYPE_PACKED_PIXELS; 590 fbinfo->fix.type = FB_TYPE_PACKED_PIXELS;
@@ -571,46 +606,48 @@ static int __devinit bfin_lq035q1_probe(struct platform_device *pdev)
571 fbinfo->var.xres_virtual = LCD_X_RES; 606 fbinfo->var.xres_virtual = LCD_X_RES;
572 fbinfo->var.yres = LCD_Y_RES; 607 fbinfo->var.yres = LCD_Y_RES;
573 fbinfo->var.yres_virtual = LCD_Y_RES; 608 fbinfo->var.yres_virtual = LCD_Y_RES;
574 fbinfo->var.bits_per_pixel = LCD_BPP; 609 fbinfo->var.bits_per_pixel = info->lcd_bpp;
575 610
576 if (info->disp_info->mode & LQ035_BGR) { 611 if (info->disp_info->mode & LQ035_BGR) {
577#if (LCD_BPP == 24) 612 if (info->lcd_bpp == 24) {
578 fbinfo->var.red.offset = 0; 613 fbinfo->var.red.offset = 0;
579 fbinfo->var.green.offset = 8; 614 fbinfo->var.green.offset = 8;
580 fbinfo->var.blue.offset = 16; 615 fbinfo->var.blue.offset = 16;
581#else 616 } else {
582 fbinfo->var.red.offset = 0; 617 fbinfo->var.red.offset = 0;
583 fbinfo->var.green.offset = 5; 618 fbinfo->var.green.offset = 5;
584 fbinfo->var.blue.offset = 11; 619 fbinfo->var.blue.offset = 11;
585#endif 620 }
586 } else { 621 } else {
587#if (LCD_BPP == 24) 622 if (info->lcd_bpp == 24) {
588 fbinfo->var.red.offset = 16; 623 fbinfo->var.red.offset = 16;
589 fbinfo->var.green.offset = 8; 624 fbinfo->var.green.offset = 8;
590 fbinfo->var.blue.offset = 0; 625 fbinfo->var.blue.offset = 0;
591#else 626 } else {
592 fbinfo->var.red.offset = 11; 627 fbinfo->var.red.offset = 11;
593 fbinfo->var.green.offset = 5; 628 fbinfo->var.green.offset = 5;
594 fbinfo->var.blue.offset = 0; 629 fbinfo->var.blue.offset = 0;
595#endif 630 }
596 } 631 }
597 632
598 fbinfo->var.transp.offset = 0; 633 fbinfo->var.transp.offset = 0;
599 634
600#if (LCD_BPP == 24) 635 if (info->lcd_bpp == 24) {
601 fbinfo->var.red.length = 8; 636 fbinfo->var.red.length = 8;
602 fbinfo->var.green.length = 8; 637 fbinfo->var.green.length = 8;
603 fbinfo->var.blue.length = 8; 638 fbinfo->var.blue.length = 8;
604#else 639 } else {
605 fbinfo->var.red.length = 5; 640 fbinfo->var.red.length = 5;
606 fbinfo->var.green.length = 6; 641 fbinfo->var.green.length = 6;
607 fbinfo->var.blue.length = 5; 642 fbinfo->var.blue.length = 5;
608#endif 643 }
609 644
610 fbinfo->var.transp.length = 0; 645 fbinfo->var.transp.length = 0;
611 646
612 fbinfo->fix.smem_len = LCD_X_RES * LCD_Y_RES * LCD_BPP / 8 647 active_video_mem_offset = ((U_LINE / 2) * LCD_X_RES * (info->lcd_bpp / 8));
613 + ACTIVE_VIDEO_MEM_OFFSET; 648
649 fbinfo->fix.smem_len = LCD_X_RES * LCD_Y_RES * info->lcd_bpp / 8
650 + active_video_mem_offset;
614 651
615 fbinfo->fix.line_length = fbinfo->var.xres_virtual * 652 fbinfo->fix.line_length = fbinfo->var.xres_virtual *
616 fbinfo->var.bits_per_pixel / 8; 653 fbinfo->var.bits_per_pixel / 8;
@@ -629,8 +666,8 @@ static int __devinit bfin_lq035q1_probe(struct platform_device *pdev)
629 goto out3; 666 goto out3;
630 } 667 }
631 668
632 fbinfo->screen_base = (void *)info->fb_buffer + ACTIVE_VIDEO_MEM_OFFSET; 669 fbinfo->screen_base = (void *)info->fb_buffer + active_video_mem_offset;
633 fbinfo->fix.smem_start = (int)info->fb_buffer + ACTIVE_VIDEO_MEM_OFFSET; 670 fbinfo->fix.smem_start = (int)info->fb_buffer + active_video_mem_offset;
634 671
635 fbinfo->fbops = &bfin_lq035q1_fb_ops; 672 fbinfo->fbops = &bfin_lq035q1_fb_ops;
636 673
@@ -643,7 +680,8 @@ static int __devinit bfin_lq035q1_probe(struct platform_device *pdev)
643 goto out4; 680 goto out4;
644 } 681 }
645 682
646 ret = bfin_lq035q1_request_ports(pdev); 683 ret = bfin_lq035q1_request_ports(pdev,
684 info->disp_info->ppi_mode == USE_RGB565_16_BIT_PPI);
647 if (ret) { 685 if (ret) {
648 dev_err(&pdev->dev, "couldn't request gpio port\n"); 686 dev_err(&pdev->dev, "couldn't request gpio port\n");
649 goto out6; 687 goto out6;
@@ -693,7 +731,7 @@ static int __devinit bfin_lq035q1_probe(struct platform_device *pdev)
693 } 731 }
694 732
695 dev_info(&pdev->dev, "%dx%d %d-bit RGB FrameBuffer initialized\n", 733 dev_info(&pdev->dev, "%dx%d %d-bit RGB FrameBuffer initialized\n",
696 LCD_X_RES, LCD_Y_RES, LCD_BPP); 734 LCD_X_RES, LCD_Y_RES, info->lcd_bpp);
697 735
698 return 0; 736 return 0;
699 737
@@ -705,7 +743,8 @@ static int __devinit bfin_lq035q1_probe(struct platform_device *pdev)
705 out8: 743 out8:
706 free_irq(info->irq, info); 744 free_irq(info->irq, info);
707 out7: 745 out7:
708 bfin_lq035q1_free_ports(); 746 bfin_lq035q1_free_ports(info->disp_info->ppi_mode ==
747 USE_RGB565_16_BIT_PPI);
709 out6: 748 out6:
710 fb_dealloc_cmap(&fbinfo->cmap); 749 fb_dealloc_cmap(&fbinfo->cmap);
711 out4: 750 out4:
@@ -742,7 +781,8 @@ static int __devexit bfin_lq035q1_remove(struct platform_device *pdev)
742 781
743 fb_dealloc_cmap(&fbinfo->cmap); 782 fb_dealloc_cmap(&fbinfo->cmap);
744 783
745 bfin_lq035q1_free_ports(); 784 bfin_lq035q1_free_ports(info->disp_info->ppi_mode ==
785 USE_RGB565_16_BIT_PPI);
746 786
747 platform_set_drvdata(pdev, NULL); 787 platform_set_drvdata(pdev, NULL);
748 framebuffer_release(fbinfo); 788 framebuffer_release(fbinfo);
@@ -781,7 +821,7 @@ static int bfin_lq035q1_resume(struct device *dev)
781 821
782 bfin_lq035q1_config_dma(info); 822 bfin_lq035q1_config_dma(info);
783 bfin_lq035q1_config_ppi(info); 823 bfin_lq035q1_config_ppi(info);
784 bfin_lq035q1_init_timers(); 824 bfin_lq035q1_init_timers(info);
785 825
786 /* start dma */ 826 /* start dma */
787 enable_dma(CH_PPI); 827 enable_dma(CH_PPI);