* [PATCH] sm501fb: control panel pin usage with platform data flags
@ 2007-12-28 5:51 ` Magnus Damm
2008-01-10 2:53 ` Paul Mundt
0 siblings, 1 reply; 3+ messages in thread
From: Magnus Damm @ 2007-12-28 5:51 UTC (permalink / raw)
To: linux-fbdev-devel; +Cc: akpm, lethal, Magnus Damm, syrjala, ben-linux
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: Magnus Damm <damm@igel.co.jp>
---
Applies to 2.6.24-rc6.
drivers/video/sm501fb.c | 41 +++++++++++++++++++++++++----------------
include/linux/sm501.h | 2 ++
2 files changed, 27 insertions(+), 16 deletions(-)
--- 0003/drivers/video/sm501fb.c
+++ work/drivers/video/sm501fb.c 2007-12-27 14:18:28.000000000 +0900
@@ -639,6 +639,7 @@ static void sm501fb_panel_power(struct s
{
unsigned long control;
void __iomem *ctrl_reg = fbi->regs + SM501_DC_PANEL_CONTROL;
+ struct sm501_platdata_fbsub *pd = fbi->pdata->fb_pnl;
control = readl(ctrl_reg);
@@ -655,26 +656,34 @@ static void sm501fb_panel_power(struct s
sm501fb_sync_regs(fbi);
mdelay(10);
- control |= SM501_DC_PANEL_CONTROL_BIAS; /* VBIASEN */
- writel(control, ctrl_reg);
- sm501fb_sync_regs(fbi);
- mdelay(10);
-
- control |= SM501_DC_PANEL_CONTROL_FPEN;
- writel(control, ctrl_reg);
+ if (pd->flags & SM501FB_FLAG_PANEL_USE_VBIASEN) {
+ control |= SM501_DC_PANEL_CONTROL_BIAS; /* VBIASEN */
+ writel(control, ctrl_reg);
+ sm501fb_sync_regs(fbi);
+ mdelay(10);
+ }
+ 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) {
/* 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;
- writel(control, ctrl_reg);
- sm501fb_sync_regs(fbi);
- mdelay(10);
-
- control &= ~SM501_DC_PANEL_CONTROL_BIAS;
- writel(control, ctrl_reg);
- sm501fb_sync_regs(fbi);
- mdelay(10);
+ if (pd->flags & SM501FB_FLAG_PANEL_USE_VBIASEN) {
+ control &= ~SM501_DC_PANEL_CONTROL_BIAS;
+ writel(control, ctrl_reg);
+ sm501fb_sync_regs(fbi);
+ mdelay(10);
+ }
control &= ~SM501_DC_PANEL_CONTROL_DATA;
writel(control, ctrl_reg);
--- 0001/include/linux/sm501.h
+++ work/include/linux/sm501.h 2007-12-27 14:13:40.000000000 +0900
@@ -70,6 +70,8 @@ extern unsigned long sm501_gpio_get(stru
#define SM501FB_FLAG_DISABLE_AT_EXIT (1<<1)
#define SM501FB_FLAG_USE_HWCURSOR (1<<2)
#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 fb_videomode *def_mode;
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] sm501fb: clear framebuffer memory and palette
@ 2007-12-28 5:55 Magnus Damm
2007-12-28 5:51 ` [PATCH] sm501fb: control panel pin usage with platform data flags Magnus Damm
0 siblings, 1 reply; 3+ messages in thread
From: Magnus Damm @ 2007-12-28 5:55 UTC (permalink / raw)
To: linux-fbdev-devel; +Cc: akpm, lethal, Magnus Damm, syrjala, ben-linux
sm501fb: clear framebuffer memory and palette
Avoid displaying garbage on unused framebuffers. For most users a single
framebuffer is used together with fbcon. sm501fb supports two framebuffers
where one often is assigned to fbcon and the other one is left unused during
the boot.
The problem here is that framebuffers not in use by fbcon happen to display
garbage. This can easily be solved by making sure that framebuffer memory and
palette ram are cleared.
The problem can be observed by using looking at the panel output (fb1)
after booting the kernel with fbcon on crt (fb0). This is the default
configuration. It's also possible to watch the garbage on the crt framebuffer
by passing "fbcon=map:1" on the kernel cmdline. This will assign fbcon to
the panel (fb1) and leave the crt (fb0) unused.
Signed-off-by: Magnus Damm <damm@igel.co.jp>
---
Applies to 2.6.24-rc6.
drivers/video/sm501fb.c | 8 ++++++++
1 file changed, 8 insertions(+)
--- 0002/drivers/video/sm501fb.c
+++ work/drivers/video/sm501fb.c 2007-12-27 13:24:20.000000000 +0900
@@ -1264,6 +1264,7 @@ static int sm501fb_start(struct sm501fb_
{
struct resource *res;
struct device *dev;
+ int k;
int ret;
info->dev = dev = &pdev->dev;
@@ -1325,6 +1326,13 @@ static int sm501fb_start(struct sm501fb_
info->fbmem_len = (res->end - res->start)+1;
+ /* clear framebuffer memory - avoids garbage data on unused fb */
+ memset(info->fbmem, 0, info->fbmem_len);
+
+ /* clear palette ram - undefined at power on */
+ for (k = 0; k < (256 * 3); k++)
+ writel(0, info->regs + SM501_DC_PANEL_PALETTE + (k * 4));
+
/* enable display controller */
sm501_unit_power(dev->parent, SM501_GATE_DISPLAY, 1);
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] sm501fb: control panel pin usage with platform data flags
2007-12-28 5:51 ` [PATCH] sm501fb: control panel pin usage with platform data flags Magnus Damm
@ 2008-01-10 2:53 ` Paul Mundt
0 siblings, 0 replies; 3+ messages in thread
From: Paul Mundt @ 2008-01-10 2:53 UTC (permalink / raw)
To: linux-fbdev-devel; +Cc: akpm, Magnus Damm, syrjala, ben-linux
On Fri, Dec 28, 2007 at 02:51:13PM +0900, Magnus Damm wrote:
> 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: Magnus Damm <damm@igel.co.jp>
On Fri, Dec 28, 2007 at 02:55:52PM +0900, Magnus Damm wrote:
> sm501fb: clear framebuffer memory and palette
>
> Avoid displaying garbage on unused framebuffers. For most users a single
> framebuffer is used together with fbcon. sm501fb supports two framebuffers
> where one often is assigned to fbcon and the other one is left unused during
> the boot.
>
> The problem here is that framebuffers not in use by fbcon happen to display
> garbage. This can easily be solved by making sure that framebuffer memory and
> palette ram are cleared.
>
> The problem can be observed by using looking at the panel output (fb1)
> after booting the kernel with fbcon on crt (fb0). This is the default
> configuration. It's also possible to watch the garbage on the crt framebuffer
> by passing "fbcon=map:1" on the kernel cmdline. This will assign fbcon to
> the panel (fb1) and leave the crt (fb0) unused.
>
> Signed-off-by: Magnus Damm <damm@igel.co.jp>
There hasn't been any updates or objections to these, and we do still
need them. Andrew, can you roll these in to -mm?
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-01-10 2:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-28 5:55 [PATCH] sm501fb: clear framebuffer memory and palette Magnus Damm
2007-12-28 5:51 ` [PATCH] sm501fb: control panel pin usage with platform data flags Magnus Damm
2008-01-10 2:53 ` Paul Mundt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).