提交 dfcffa46 编写于 作者: M Magnus Damm 提交者: Linus Torvalds

sm501fb: control panel pin usage with platform data flags

This patch makes it possible to control panel pins usage with flags passed
from the platform data.  Without this patch the sm501fb driver always controls
the VBIASEN and FPEN pins.  The polarity and use of these pins are very
platform specific, so this patch introduces the flags
SM501FB_FLAG_PANEL_USE_VBIASEN and SM501FB_FLAG_PANEL_USE_FPEN which enable
the use of these pins.

This patch is needed to support the a Sharp LQ104V1DG21 lcd panel on SuperH
platforms such as R2D-1 and R2D-PLUS boards.  Letting the sm501fb driver
control the FPEN and VBIASEN pins like today just results in lcd panel
flicker.
Signed-off-by: NMagnus Damm <damm@igel.co.jp>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 625fcaf9
...@@ -641,6 +641,7 @@ static void sm501fb_panel_power(struct sm501fb_info *fbi, int to) ...@@ -641,6 +641,7 @@ static void sm501fb_panel_power(struct sm501fb_info *fbi, int to)
{ {
unsigned long control; unsigned long control;
void __iomem *ctrl_reg = fbi->regs + SM501_DC_PANEL_CONTROL; void __iomem *ctrl_reg = fbi->regs + SM501_DC_PANEL_CONTROL;
struct sm501_platdata_fbsub *pd = fbi->pdata->fb_pnl;
control = readl(ctrl_reg); control = readl(ctrl_reg);
...@@ -657,26 +658,34 @@ static void sm501fb_panel_power(struct sm501fb_info *fbi, int to) ...@@ -657,26 +658,34 @@ static void sm501fb_panel_power(struct sm501fb_info *fbi, int to)
sm501fb_sync_regs(fbi); sm501fb_sync_regs(fbi);
mdelay(10); mdelay(10);
control |= SM501_DC_PANEL_CONTROL_BIAS; /* VBIASEN */ if (pd->flags & SM501FB_FLAG_PANEL_USE_VBIASEN) {
writel(control, ctrl_reg); control |= SM501_DC_PANEL_CONTROL_BIAS; /* VBIASEN */
sm501fb_sync_regs(fbi); writel(control, ctrl_reg);
mdelay(10); sm501fb_sync_regs(fbi);
mdelay(10);
control |= SM501_DC_PANEL_CONTROL_FPEN; }
writel(control, ctrl_reg);
if (pd->flags & SM501FB_FLAG_PANEL_USE_FPEN) {
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) { } else if (!to && (control & SM501_DC_PANEL_CONTROL_VDD) != 0) {
/* disable panel power */ /* disable panel power */
if (pd->flags & SM501FB_FLAG_PANEL_USE_FPEN) {
control &= ~SM501_DC_PANEL_CONTROL_FPEN;
writel(control, ctrl_reg);
sm501fb_sync_regs(fbi);
mdelay(10);
}
control &= ~SM501_DC_PANEL_CONTROL_FPEN; if (pd->flags & SM501FB_FLAG_PANEL_USE_VBIASEN) {
writel(control, ctrl_reg); control &= ~SM501_DC_PANEL_CONTROL_BIAS;
sm501fb_sync_regs(fbi); writel(control, ctrl_reg);
mdelay(10); sm501fb_sync_regs(fbi);
mdelay(10);
control &= ~SM501_DC_PANEL_CONTROL_BIAS; }
writel(control, ctrl_reg);
sm501fb_sync_regs(fbi);
mdelay(10);
control &= ~SM501_DC_PANEL_CONTROL_DATA; control &= ~SM501_DC_PANEL_CONTROL_DATA;
writel(control, ctrl_reg); writel(control, ctrl_reg);
......
...@@ -70,6 +70,8 @@ extern unsigned long sm501_gpio_get(struct device *dev, ...@@ -70,6 +70,8 @@ extern unsigned long sm501_gpio_get(struct device *dev,
#define SM501FB_FLAG_DISABLE_AT_EXIT (1<<1) #define SM501FB_FLAG_DISABLE_AT_EXIT (1<<1)
#define SM501FB_FLAG_USE_HWCURSOR (1<<2) #define SM501FB_FLAG_USE_HWCURSOR (1<<2)
#define SM501FB_FLAG_USE_HWACCEL (1<<3) #define SM501FB_FLAG_USE_HWACCEL (1<<3)
#define SM501FB_FLAG_PANEL_USE_FPEN (1<<4)
#define SM501FB_FLAG_PANEL_USE_VBIASEN (1<<5)
struct sm501_platdata_fbsub { struct sm501_platdata_fbsub {
struct fb_videomode *def_mode; struct fb_videomode *def_mode;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册