aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/fsl-diu-fb.c
diff options
context:
space:
mode:
authorTimur Tabi <timur@freescale.com>2011-09-28 17:19:52 -0400
committerFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>2011-10-04 21:10:12 -0400
commit7e47c211953bd8e396b168eba2c288ea6aec20ef (patch)
treec2b253d0b53a3b20a43a2548a1c8e9b36849e915 /drivers/video/fsl-diu-fb.c
parent2572df91d5528dfc639e52b7caaed98e3dec1e18 (diff)
drivers/video: fsl-diu-fb: remove unused panel operating mode support
The MFB_TYPE_xxx macros indicate different "operating modes" of each AOI, but this feature is not actually used in the driver. The mfb_index.type field is always set to MFB_TYPE_OUTPUT, so just delete it and any code that references it. Signed-off-by: Timur Tabi <timur@freescale.com> Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Diffstat (limited to 'drivers/video/fsl-diu-fb.c')
-rw-r--r--drivers/video/fsl-diu-fb.c117
1 files changed, 46 insertions, 71 deletions
diff --git a/drivers/video/fsl-diu-fb.c b/drivers/video/fsl-diu-fb.c
index c5f97318f193..0fd4c784f8df 100644
--- a/drivers/video/fsl-diu-fb.c
+++ b/drivers/video/fsl-diu-fb.c
@@ -49,12 +49,6 @@
49#define INT_PARERR 0x08 /* Display parameters error interrupt */ 49#define INT_PARERR 0x08 /* Display parameters error interrupt */
50#define INT_LS_BF_VS 0x10 /* Lines before vsync. interrupt */ 50#define INT_LS_BF_VS 0x10 /* Lines before vsync. interrupt */
51 51
52/* Panels'operation modes */
53#define MFB_TYPE_OUTPUT 0 /* Panel output to display */
54#define MFB_TYPE_OFF 1 /* Panel off */
55#define MFB_TYPE_WB 2 /* Panel written back to memory */
56#define MFB_TYPE_TEST 3 /* Panel generate color bar */
57
58struct diu_hw { 52struct diu_hw {
59 struct diu __iomem *diu_reg; 53 struct diu __iomem *diu_reg;
60 spinlock_t reg_lock; 54 spinlock_t reg_lock;
@@ -370,7 +364,6 @@ enum mfb_index {
370 364
371struct mfb_info { 365struct mfb_info {
372 enum mfb_index index; 366 enum mfb_index index;
373 int type;
374 char *id; 367 char *id;
375 int registered; 368 int registered;
376 unsigned long pseudo_palette[16]; 369 unsigned long pseudo_palette[16];
@@ -388,7 +381,6 @@ struct mfb_info {
388static struct mfb_info mfb_template[] = { 381static struct mfb_info mfb_template[] = {
389 { 382 {
390 .index = PLANE0, 383 .index = PLANE0,
391 .type = MFB_TYPE_OUTPUT,
392 .id = "Panel0", 384 .id = "Panel0",
393 .registered = 0, 385 .registered = 0,
394 .count = 0, 386 .count = 0,
@@ -397,7 +389,6 @@ static struct mfb_info mfb_template[] = {
397 }, 389 },
398 { 390 {
399 .index = PLANE1_AOI0, 391 .index = PLANE1_AOI0,
400 .type = MFB_TYPE_OUTPUT,
401 .id = "Panel1 AOI0", 392 .id = "Panel1 AOI0",
402 .registered = 0, 393 .registered = 0,
403 .g_alpha = 0xff, 394 .g_alpha = 0xff,
@@ -407,7 +398,6 @@ static struct mfb_info mfb_template[] = {
407 }, 398 },
408 { 399 {
409 .index = PLANE1_AOI1, 400 .index = PLANE1_AOI1,
410 .type = MFB_TYPE_OUTPUT,
411 .id = "Panel1 AOI1", 401 .id = "Panel1 AOI1",
412 .registered = 0, 402 .registered = 0,
413 .g_alpha = 0xff, 403 .g_alpha = 0xff,
@@ -417,7 +407,6 @@ static struct mfb_info mfb_template[] = {
417 }, 407 },
418 { 408 {
419 .index = PLANE2_AOI0, 409 .index = PLANE2_AOI0,
420 .type = MFB_TYPE_OUTPUT,
421 .id = "Panel2 AOI0", 410 .id = "Panel2 AOI0",
422 .registered = 0, 411 .registered = 0,
423 .g_alpha = 0xff, 412 .g_alpha = 0xff,
@@ -427,7 +416,6 @@ static struct mfb_info mfb_template[] = {
427 }, 416 },
428 { 417 {
429 .index = PLANE2_AOI1, 418 .index = PLANE2_AOI1,
430 .type = MFB_TYPE_OUTPUT,
431 .id = "Panel2 AOI1", 419 .id = "Panel2 AOI1",
432 .registered = 0, 420 .registered = 0,
433 .g_alpha = 0xff, 421 .g_alpha = 0xff,
@@ -517,62 +505,57 @@ void wr_reg_wa(u32 *reg, u32 val)
517 } while (in_be32(reg) != val); 505 } while (in_be32(reg) != val);
518} 506}
519 507
520static int fsl_diu_enable_panel(struct fb_info *info) 508static void fsl_diu_enable_panel(struct fb_info *info)
521{ 509{
522 struct mfb_info *pmfbi, *cmfbi, *mfbi = info->par; 510 struct mfb_info *pmfbi, *cmfbi, *mfbi = info->par;
523 struct diu *hw = dr.diu_reg; 511 struct diu *hw = dr.diu_reg;
524 struct diu_ad *ad = mfbi->ad; 512 struct diu_ad *ad = mfbi->ad;
525 struct fsl_diu_data *machine_data = mfbi->parent; 513 struct fsl_diu_data *machine_data = mfbi->parent;
526 int res = 0;
527 514
528 if (mfbi->type != MFB_TYPE_OFF) { 515 switch (mfbi->index) {
529 switch (mfbi->index) { 516 case PLANE0:
530 case PLANE0: 517 if (hw->desc[0] != ad->paddr)
531 if (hw->desc[0] != ad->paddr) 518 wr_reg_wa(&hw->desc[0], ad->paddr);
532 wr_reg_wa(&hw->desc[0], ad->paddr); 519 break;
533 break; 520 case PLANE1_AOI0:
534 case PLANE1_AOI0: 521 cmfbi = machine_data->fsl_diu_info[2]->par;
535 cmfbi = machine_data->fsl_diu_info[2]->par; 522 if (hw->desc[1] != ad->paddr) { /* AOI0 closed */
536 if (hw->desc[1] != ad->paddr) { /* AOI0 closed */ 523 if (cmfbi->count > 0) /* AOI1 open */
537 if (cmfbi->count > 0) /* AOI1 open */ 524 ad->next_ad =
538 ad->next_ad = 525 cpu_to_le32(cmfbi->ad->paddr);
539 cpu_to_le32(cmfbi->ad->paddr); 526 else
540 else 527 ad->next_ad = 0;
541 ad->next_ad = 0; 528 wr_reg_wa(&hw->desc[1], ad->paddr);
542 wr_reg_wa(&hw->desc[1], ad->paddr);
543 }
544 break;
545 case PLANE2_AOI0:
546 cmfbi = machine_data->fsl_diu_info[4]->par;
547 if (hw->desc[2] != ad->paddr) { /* AOI0 closed */
548 if (cmfbi->count > 0) /* AOI1 open */
549 ad->next_ad =
550 cpu_to_le32(cmfbi->ad->paddr);
551 else
552 ad->next_ad = 0;
553 wr_reg_wa(&hw->desc[2], ad->paddr);
554 }
555 break;
556 case PLANE1_AOI1:
557 pmfbi = machine_data->fsl_diu_info[1]->par;
558 ad->next_ad = 0;
559 if (hw->desc[1] == machine_data->dummy_ad->paddr)
560 wr_reg_wa(&hw->desc[1], ad->paddr);
561 else /* AOI0 open */
562 pmfbi->ad->next_ad = cpu_to_le32(ad->paddr);
563 break;
564 case PLANE2_AOI1:
565 pmfbi = machine_data->fsl_diu_info[3]->par;
566 ad->next_ad = 0;
567 if (hw->desc[2] == machine_data->dummy_ad->paddr)
568 wr_reg_wa(&hw->desc[2], ad->paddr);
569 else /* AOI0 was open */
570 pmfbi->ad->next_ad = cpu_to_le32(ad->paddr);
571 break;
572 } 529 }
573 } else 530 break;
574 res = -EINVAL; 531 case PLANE2_AOI0:
575 return res; 532 cmfbi = machine_data->fsl_diu_info[4]->par;
533 if (hw->desc[2] != ad->paddr) { /* AOI0 closed */
534 if (cmfbi->count > 0) /* AOI1 open */
535 ad->next_ad =
536 cpu_to_le32(cmfbi->ad->paddr);
537 else
538 ad->next_ad = 0;
539 wr_reg_wa(&hw->desc[2], ad->paddr);
540 }
541 break;
542 case PLANE1_AOI1:
543 pmfbi = machine_data->fsl_diu_info[1]->par;
544 ad->next_ad = 0;
545 if (hw->desc[1] == machine_data->dummy_ad->paddr)
546 wr_reg_wa(&hw->desc[1], ad->paddr);
547 else /* AOI0 open */
548 pmfbi->ad->next_ad = cpu_to_le32(ad->paddr);
549 break;
550 case PLANE2_AOI1:
551 pmfbi = machine_data->fsl_diu_info[3]->par;
552 ad->next_ad = 0;
553 if (hw->desc[2] == machine_data->dummy_ad->paddr)
554 wr_reg_wa(&hw->desc[2], ad->paddr);
555 else /* AOI0 was open */
556 pmfbi->ad->next_ad = cpu_to_le32(ad->paddr);
557 break;
558 }
576} 559}
577 560
578static void fsl_diu_disable_panel(struct fb_info *info) 561static void fsl_diu_disable_panel(struct fb_info *info)
@@ -849,11 +832,6 @@ static void update_lcdc(struct fb_info *info)
849 832
850 hw = dr.diu_reg; 833 hw = dr.diu_reg;
851 834
852 if (mfbi->type == MFB_TYPE_OFF) {
853 fsl_diu_disable_panel(info);
854 return;
855 }
856
857 diu_ops.set_monitor_port(machine_data->monitor_port); 835 diu_ops.set_monitor_port(machine_data->monitor_port);
858 gamma_table_base = pool.gamma.vaddr; 836 gamma_table_base = pool.gamma.vaddr;
859 cursor_base = pool.cursor.vaddr; 837 cursor_base = pool.cursor.vaddr;
@@ -1205,11 +1183,8 @@ static int fsl_diu_open(struct fb_info *info, int user)
1205 res = fsl_diu_set_par(info); 1183 res = fsl_diu_set_par(info);
1206 if (res < 0) 1184 if (res < 0)
1207 mfbi->count--; 1185 mfbi->count--;
1208 else { 1186 else
1209 res = fsl_diu_enable_panel(info); 1187 fsl_diu_enable_panel(info);
1210 if (res < 0)
1211 mfbi->count--;
1212 }
1213 } 1188 }
1214 1189
1215 spin_unlock(&diu_lock); 1190 spin_unlock(&diu_lock);