Commit 206c5d69 authored by Ben Dooks's avatar Ben Dooks Committed by Linus Torvalds

sm501: add inversion controls for VBIASEN and FPEN

Add flags to allow the driver to invert the sense of both VBIASEN and FPEN
signals comming from the SM501.
Signed-off-by: default avatarBen Dooks <ben-linux@fluff.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 968910bd
...@@ -663,15 +663,25 @@ static void sm501fb_panel_power(struct sm501fb_info *fbi, int to) ...@@ -663,15 +663,25 @@ static void sm501fb_panel_power(struct sm501fb_info *fbi, int to)
sm501fb_sync_regs(fbi); sm501fb_sync_regs(fbi);
mdelay(10); mdelay(10);
/* VBIASEN */
if (!(pd->flags & SM501FB_FLAG_PANEL_NO_VBIASEN)) { if (!(pd->flags & SM501FB_FLAG_PANEL_NO_VBIASEN)) {
control |= SM501_DC_PANEL_CONTROL_BIAS; /* VBIASEN */ if (pd->flags & SM501FB_FLAG_PANEL_INV_VBIASEN)
control &= ~SM501_DC_PANEL_CONTROL_BIAS;
else
control |= SM501_DC_PANEL_CONTROL_BIAS;
writel(control, ctrl_reg); writel(control, ctrl_reg);
sm501fb_sync_regs(fbi); sm501fb_sync_regs(fbi);
mdelay(10); mdelay(10);
} }
if (!(pd->flags & SM501FB_FLAG_PANEL_NO_FPEN)) { if (!(pd->flags & SM501FB_FLAG_PANEL_NO_FPEN)) {
if (pd->flags & SM501FB_FLAG_PANEL_INV_FPEN)
control &= ~SM501_DC_PANEL_CONTROL_FPEN;
else
control |= SM501_DC_PANEL_CONTROL_FPEN; control |= SM501_DC_PANEL_CONTROL_FPEN;
writel(control, ctrl_reg); writel(control, ctrl_reg);
sm501fb_sync_regs(fbi); sm501fb_sync_regs(fbi);
mdelay(10); mdelay(10);
...@@ -679,14 +689,22 @@ static void sm501fb_panel_power(struct sm501fb_info *fbi, int to) ...@@ -679,14 +689,22 @@ static void sm501fb_panel_power(struct sm501fb_info *fbi, int to)
} else if (!to && (control & SM501_DC_PANEL_CONTROL_VDD) != 0) { } else if (!to && (control & SM501_DC_PANEL_CONTROL_VDD) != 0) {
/* disable panel power */ /* disable panel power */
if (!(pd->flags & SM501FB_FLAG_PANEL_NO_FPEN)) { if (!(pd->flags & SM501FB_FLAG_PANEL_NO_FPEN)) {
if (pd->flags & SM501FB_FLAG_PANEL_INV_FPEN)
control |= SM501_DC_PANEL_CONTROL_FPEN;
else
control &= ~SM501_DC_PANEL_CONTROL_FPEN; control &= ~SM501_DC_PANEL_CONTROL_FPEN;
writel(control, ctrl_reg); writel(control, ctrl_reg);
sm501fb_sync_regs(fbi); sm501fb_sync_regs(fbi);
mdelay(10); mdelay(10);
} }
if (!(pd->flags & SM501FB_FLAG_PANEL_NO_VBIASEN)) { if (!(pd->flags & SM501FB_FLAG_PANEL_NO_VBIASEN)) {
if (pd->flags & SM501FB_FLAG_PANEL_INV_VBIASEN)
control |= SM501_DC_PANEL_CONTROL_BIAS;
else
control &= ~SM501_DC_PANEL_CONTROL_BIAS; control &= ~SM501_DC_PANEL_CONTROL_BIAS;
writel(control, ctrl_reg); writel(control, ctrl_reg);
sm501fb_sync_regs(fbi); sm501fb_sync_regs(fbi);
mdelay(10); mdelay(10);
......
...@@ -73,6 +73,8 @@ extern unsigned long sm501_gpio_get(struct device *dev, ...@@ -73,6 +73,8 @@ extern unsigned long sm501_gpio_get(struct device *dev,
#define SM501FB_FLAG_USE_HWACCEL (1<<3) #define SM501FB_FLAG_USE_HWACCEL (1<<3)
#define SM501FB_FLAG_PANEL_NO_FPEN (1<<4) #define SM501FB_FLAG_PANEL_NO_FPEN (1<<4)
#define SM501FB_FLAG_PANEL_NO_VBIASEN (1<<5) #define SM501FB_FLAG_PANEL_NO_VBIASEN (1<<5)
#define SM501FB_FLAG_PANEL_INV_FPEN (1<<6)
#define SM501FB_FLAG_PANEL_INV_VBIASEN (1<<7)
struct sm501_platdata_fbsub { struct sm501_platdata_fbsub {
struct fb_videomode *def_mode; struct fb_videomode *def_mode;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment