aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/video/sm501fb.c26
-rw-r--r--include/linux/sm501.h2
2 files changed, 24 insertions, 4 deletions
diff --git a/drivers/video/sm501fb.c b/drivers/video/sm501fb.c
index 15d4a768b1f6..122a0f8495c8 100644
--- a/drivers/video/sm501fb.c
+++ b/drivers/video/sm501fb.c
@@ -663,15 +663,25 @@ static void sm501fb_panel_power(struct sm501fb_info *fbi, int to)
663 sm501fb_sync_regs(fbi); 663 sm501fb_sync_regs(fbi);
664 mdelay(10); 664 mdelay(10);
665 665
666 /* VBIASEN */
667
666 if (!(pd->flags & SM501FB_FLAG_PANEL_NO_VBIASEN)) { 668 if (!(pd->flags & SM501FB_FLAG_PANEL_NO_VBIASEN)) {
667 control |= SM501_DC_PANEL_CONTROL_BIAS; /* VBIASEN */ 669 if (pd->flags & SM501FB_FLAG_PANEL_INV_VBIASEN)
670 control &= ~SM501_DC_PANEL_CONTROL_BIAS;
671 else
672 control |= SM501_DC_PANEL_CONTROL_BIAS;
673
668 writel(control, ctrl_reg); 674 writel(control, ctrl_reg);
669 sm501fb_sync_regs(fbi); 675 sm501fb_sync_regs(fbi);
670 mdelay(10); 676 mdelay(10);
671 } 677 }
672 678
673 if (!(pd->flags & SM501FB_FLAG_PANEL_NO_FPEN)) { 679 if (!(pd->flags & SM501FB_FLAG_PANEL_NO_FPEN)) {
674 control |= SM501_DC_PANEL_CONTROL_FPEN; 680 if (pd->flags & SM501FB_FLAG_PANEL_INV_FPEN)
681 control &= ~SM501_DC_PANEL_CONTROL_FPEN;
682 else
683 control |= SM501_DC_PANEL_CONTROL_FPEN;
684
675 writel(control, ctrl_reg); 685 writel(control, ctrl_reg);
676 sm501fb_sync_regs(fbi); 686 sm501fb_sync_regs(fbi);
677 mdelay(10); 687 mdelay(10);
@@ -679,14 +689,22 @@ static void sm501fb_panel_power(struct sm501fb_info *fbi, int to)
679 } else if (!to && (control & SM501_DC_PANEL_CONTROL_VDD) != 0) { 689 } else if (!to && (control & SM501_DC_PANEL_CONTROL_VDD) != 0) {
680 /* disable panel power */ 690 /* disable panel power */
681 if (!(pd->flags & SM501FB_FLAG_PANEL_NO_FPEN)) { 691 if (!(pd->flags & SM501FB_FLAG_PANEL_NO_FPEN)) {
682 control &= ~SM501_DC_PANEL_CONTROL_FPEN; 692 if (pd->flags & SM501FB_FLAG_PANEL_INV_FPEN)
693 control |= SM501_DC_PANEL_CONTROL_FPEN;
694 else
695 control &= ~SM501_DC_PANEL_CONTROL_FPEN;
696
683 writel(control, ctrl_reg); 697 writel(control, ctrl_reg);
684 sm501fb_sync_regs(fbi); 698 sm501fb_sync_regs(fbi);
685 mdelay(10); 699 mdelay(10);
686 } 700 }
687 701
688 if (!(pd->flags & SM501FB_FLAG_PANEL_NO_VBIASEN)) { 702 if (!(pd->flags & SM501FB_FLAG_PANEL_NO_VBIASEN)) {
689 control &= ~SM501_DC_PANEL_CONTROL_BIAS; 703 if (pd->flags & SM501FB_FLAG_PANEL_INV_VBIASEN)
704 control |= SM501_DC_PANEL_CONTROL_BIAS;
705 else
706 control &= ~SM501_DC_PANEL_CONTROL_BIAS;
707
690 writel(control, ctrl_reg); 708 writel(control, ctrl_reg);
691 sm501fb_sync_regs(fbi); 709 sm501fb_sync_regs(fbi);
692 mdelay(10); 710 mdelay(10);
diff --git a/include/linux/sm501.h b/include/linux/sm501.h
index 95c1c39ba445..b530fa6a1d34 100644
--- a/include/linux/sm501.h
+++ b/include/linux/sm501.h
@@ -73,6 +73,8 @@ extern unsigned long sm501_gpio_get(struct device *dev,
73#define SM501FB_FLAG_USE_HWACCEL (1<<3) 73#define SM501FB_FLAG_USE_HWACCEL (1<<3)
74#define SM501FB_FLAG_PANEL_NO_FPEN (1<<4) 74#define SM501FB_FLAG_PANEL_NO_FPEN (1<<4)
75#define SM501FB_FLAG_PANEL_NO_VBIASEN (1<<5) 75#define SM501FB_FLAG_PANEL_NO_VBIASEN (1<<5)
76#define SM501FB_FLAG_PANEL_INV_FPEN (1<<6)
77#define SM501FB_FLAG_PANEL_INV_VBIASEN (1<<7)
76 78
77struct sm501_platdata_fbsub { 79struct sm501_platdata_fbsub {
78 struct fb_videomode *def_mode; 80 struct fb_videomode *def_mode;