Skip to content

Commit

Permalink
sm501: add inversion controls for VBIASEN and FPEN
Browse files Browse the repository at this point in the history
Add flags to allow the driver to invert the sense of both VBIASEN and FPEN
signals comming from the SM501.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Ben Dooks authored and Linus Torvalds committed Jul 24, 2008
1 parent 968910b commit 206c5d6
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
26 changes: 22 additions & 4 deletions drivers/video/sm501fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -663,30 +663,48 @@ static void sm501fb_panel_power(struct sm501fb_info *fbi, int to)
sm501fb_sync_regs(fbi);
mdelay(10);

/* 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);
sm501fb_sync_regs(fbi);
mdelay(10);
}

if (!(pd->flags & SM501FB_FLAG_PANEL_NO_FPEN)) {
control |= SM501_DC_PANEL_CONTROL_FPEN;
if (pd->flags & SM501FB_FLAG_PANEL_INV_FPEN)
control &= ~SM501_DC_PANEL_CONTROL_FPEN;
else
control |= SM501_DC_PANEL_CONTROL_FPEN;

writel(control, ctrl_reg);
sm501fb_sync_regs(fbi);
mdelay(10);
}
} else if (!to && (control & SM501_DC_PANEL_CONTROL_VDD) != 0) {
/* disable panel power */
if (!(pd->flags & SM501FB_FLAG_PANEL_NO_FPEN)) {
control &= ~SM501_DC_PANEL_CONTROL_FPEN;
if (pd->flags & SM501FB_FLAG_PANEL_INV_FPEN)
control |= SM501_DC_PANEL_CONTROL_FPEN;
else
control &= ~SM501_DC_PANEL_CONTROL_FPEN;

writel(control, ctrl_reg);
sm501fb_sync_regs(fbi);
mdelay(10);
}

if (!(pd->flags & SM501FB_FLAG_PANEL_NO_VBIASEN)) {
control &= ~SM501_DC_PANEL_CONTROL_BIAS;
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);
sm501fb_sync_regs(fbi);
mdelay(10);
Expand Down
2 changes: 2 additions & 0 deletions include/linux/sm501.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ extern unsigned long sm501_gpio_get(struct device *dev,
#define SM501FB_FLAG_USE_HWACCEL (1<<3)
#define SM501FB_FLAG_PANEL_NO_FPEN (1<<4)
#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 fb_videomode *def_mode;
Expand Down

0 comments on commit 206c5d6

Please sign in to comment.