* [patch 1/5] SM501: Reverse FPEN/VBIASEN flags behaviour.
2008-05-20 12:49 [patch 0/5] FB fixes for 2.6.26-rc series Ben Dooks
@ 2008-05-20 12:49 ` Ben Dooks
2008-05-20 12:49 ` [patch 2/5] S3C2410: Ensure that FB_BLANK_POWERDOWN shuts down the controller Ben Dooks
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Ben Dooks @ 2008-05-20 12:49 UTC (permalink / raw)
To: linux-fbdev-devel; +Cc: akpm, Ben Dooks, arnaud.patard
[-- Attachment #1: simtec/simtec-drivers-fb-sm501-revertbehaviour.patch --]
[-- Type: text/plain, Size: 2702 bytes --]
To keep backwards compatibility, reverse the meanings of these flags
so that when they are not set, the driver uses the original behvaiour.
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Index: linux-2.6.25-rc9-quilt2/drivers/video/sm501fb.c
===================================================================
--- linux-2.6.25-rc9-quilt2.orig/drivers/video/sm501fb.c 2008-04-14 16:41:21.000000000 +0100
+++ linux-2.6.25-rc9-quilt2/drivers/video/sm501fb.c 2008-04-15 00:23:19.000000000 +0100
@@ -663,14 +663,14 @@ static void sm501fb_panel_power(struct s
sm501fb_sync_regs(fbi);
mdelay(10);
- if (pd->flags & SM501FB_FLAG_PANEL_USE_VBIASEN) {
+ if (!(pd->flags & SM501FB_FLAG_PANEL_NO_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) {
+ if (!(pd->flags & SM501FB_FLAG_PANEL_NO_FPEN)) {
control |= SM501_DC_PANEL_CONTROL_FPEN;
writel(control, ctrl_reg);
sm501fb_sync_regs(fbi);
@@ -678,14 +678,14 @@ static void sm501fb_panel_power(struct s
}
} else if (!to && (control & SM501_DC_PANEL_CONTROL_VDD) != 0) {
/* disable panel power */
- if (pd->flags & SM501FB_FLAG_PANEL_USE_FPEN) {
+ if (!(pd->flags & SM501FB_FLAG_PANEL_NO_FPEN)) {
control &= ~SM501_DC_PANEL_CONTROL_FPEN;
writel(control, ctrl_reg);
sm501fb_sync_regs(fbi);
mdelay(10);
}
- if (pd->flags & SM501FB_FLAG_PANEL_USE_VBIASEN) {
+ if (!(pd->flags & SM501FB_FLAG_PANEL_NO_VBIASEN)) {
control &= ~SM501_DC_PANEL_CONTROL_BIAS;
writel(control, ctrl_reg);
sm501fb_sync_regs(fbi);
Index: linux-2.6.25-rc9-quilt2/include/linux/sm501.h
===================================================================
--- linux-2.6.25-rc9-quilt2.orig/include/linux/sm501.h 2008-04-15 00:11:29.000000000 +0100
+++ linux-2.6.25-rc9-quilt2/include/linux/sm501.h 2008-04-15 00:23:19.000000000 +0100
@@ -71,8 +71,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)
+#define SM501FB_FLAG_PANEL_NO_FPEN (1<<4)
+#define SM501FB_FLAG_PANEL_NO_VBIASEN (1<<5)
struct sm501_platdata_fbsub {
struct fb_videomode *def_mode;
--
Ben (ben@fluff.org, http://www.fluff.org/)
'a smiley only costs 4 bytes'
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
^ permalink raw reply [flat|nested] 7+ messages in thread* [patch 2/5] S3C2410: Ensure that FB_BLANK_POWERDOWN shuts down the controller
2008-05-20 12:49 [patch 0/5] FB fixes for 2.6.26-rc series Ben Dooks
2008-05-20 12:49 ` [patch 1/5] SM501: Reverse FPEN/VBIASEN flags behaviour Ben Dooks
@ 2008-05-20 12:49 ` Ben Dooks
2008-05-20 12:49 ` [patch 3/5] S3C2410: Add error print if we cannot add attribute Ben Dooks
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Ben Dooks @ 2008-05-20 12:49 UTC (permalink / raw)
To: linux-fbdev-devel; +Cc: akpm, Ben Dooks, arnaud.patard
[-- Attachment #1: simtec/simtec-drivers-fb-s3c2410-blankpowerdown.patch --]
[-- Type: text/plain, Size: 3188 bytes --]
When a blank level of FB_BLANK_POWERDOWN is used, we should
shut down the controller so that it no longer tries to produce
any panel signals or data, and shuts down the DMA which is not
needed.
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Index: linux-2.6.26-rc3-quilt1/drivers/video/s3c2410fb.c
===================================================================
--- linux-2.6.26-rc3-quilt1.orig/drivers/video/s3c2410fb.c 2008-05-19 23:04:05.000000000 +0100
+++ linux-2.6.26-rc3-quilt1/drivers/video/s3c2410fb.c 2008-05-19 23:38:20.000000000 +0100
@@ -580,6 +580,27 @@ static int s3c2410fb_setcolreg(unsigned
return 0;
}
+/* s3c2410fb_lcd_enable
+ *
+ * shutdown the lcd controller
+ */
+static void s3c2410fb_lcd_enable(struct s3c2410fb_info *fbi, int enable)
+{
+ unsigned long flags;
+
+ local_irq_save(flags);
+
+ if (enable)
+ fbi->regs.lcdcon1 |= S3C2410_LCDCON1_ENVID;
+ else
+ fbi->regs.lcdcon1 &= ~S3C2410_LCDCON1_ENVID;
+
+ writel(fbi->regs.lcdcon1, fbi->io + S3C2410_LCDCON1);
+
+ local_irq_restore(flags);
+}
+
+
/*
* s3c2410fb_blank
* @blank_mode: the blank mode we want.
@@ -589,9 +610,6 @@ static int s3c2410fb_setcolreg(unsigned
* blanking succeeded, != 0 if un-/blanking failed due to e.g. a
* video mode which doesn't support it. Implements VESA suspend
* and powerdown modes on hardware that supports disabling hsync/vsync:
- * blank_mode == 2: suspend vsync
- * blank_mode == 3: suspend hsync
- * blank_mode == 4: powerdown
*
* Returns negative errno on error, or zero on success.
*
@@ -605,6 +623,12 @@ static int s3c2410fb_blank(int blank_mod
tpal_reg += is_s3c2412(fbi) ? S3C2412_TPAL : S3C2410_TPAL;
+ if (blank_mode == FB_BLANK_POWERDOWN) {
+ s3c2410fb_lcd_enable(fbi, 0);
+ } else {
+ s3c2410fb_lcd_enable(fbi, 1);
+ }
+
if (blank_mode == FB_BLANK_UNBLANK)
writel(0x0, tpal_reg);
else {
@@ -983,21 +1007,6 @@ static int __init s3c2412fb_probe(struct
return s3c24xxfb_probe(pdev, DRV_S3C2412);
}
-/* s3c2410fb_stop_lcd
- *
- * shutdown the lcd controller
- */
-static void s3c2410fb_stop_lcd(struct s3c2410fb_info *fbi)
-{
- unsigned long flags;
-
- local_irq_save(flags);
-
- fbi->regs.lcdcon1 &= ~S3C2410_LCDCON1_ENVID;
- writel(fbi->regs.lcdcon1, fbi->io + S3C2410_LCDCON1);
-
- local_irq_restore(flags);
-}
/*
* Cleanup
@@ -1010,7 +1019,7 @@ static int s3c2410fb_remove(struct platf
unregister_framebuffer(fbinfo);
- s3c2410fb_stop_lcd(info);
+ s3c2410fb_lcd_enable(info, 0);
msleep(1);
s3c2410fb_unmap_video_memory(fbinfo);
@@ -1043,7 +1052,7 @@ static int s3c2410fb_suspend(struct plat
struct fb_info *fbinfo = platform_get_drvdata(dev);
struct s3c2410fb_info *info = fbinfo->par;
- s3c2410fb_stop_lcd(info);
+ s3c2410fb_lcd_enable(info, 0);
/* sleep before disabling the clock, we need to ensure
* the LCD DMA engine is not going to get back on the bus
--
Ben (ben@fluff.org, http://www.fluff.org/)
'a smiley only costs 4 bytes'
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
^ permalink raw reply [flat|nested] 7+ messages in thread* [patch 3/5] S3C2410: Add error print if we cannot add attribute
2008-05-20 12:49 [patch 0/5] FB fixes for 2.6.26-rc series Ben Dooks
2008-05-20 12:49 ` [patch 1/5] SM501: Reverse FPEN/VBIASEN flags behaviour Ben Dooks
2008-05-20 12:49 ` [patch 2/5] S3C2410: Ensure that FB_BLANK_POWERDOWN shuts down the controller Ben Dooks
@ 2008-05-20 12:49 ` Ben Dooks
2008-05-20 12:49 ` [patch 4/5] S3C2410: Clean out changelog header and tidy Ben Dooks
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Ben Dooks @ 2008-05-20 12:49 UTC (permalink / raw)
To: linux-fbdev-devel; +Cc: akpm, Ben Dooks, arnaud.patard
[-- Attachment #1: simtec/simtec-drivers-fb-s3c2410-warningfix.patch --]
[-- Type: text/plain, Size: 1329 bytes --]
Fix the following warning by checking the result of
device_create_file and printing an error but not removing
the device (loss of debug registers is not fatal).
drivers/video/s3c2410fb.c:905: warning: ignoring return value of 'device_create_file', declared with attribute warn_unused_result
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Index: linux-2.6.26-rc3-quilt1/drivers/video/s3c2410fb.c
===================================================================
--- linux-2.6.26-rc3-quilt1.orig/drivers/video/s3c2410fb.c 2008-05-19 23:38:20.000000000 +0100
+++ linux-2.6.26-rc3-quilt1/drivers/video/s3c2410fb.c 2008-05-19 23:40:51.000000000 +0100
@@ -972,7 +972,10 @@ static int __init s3c24xxfb_probe(struct
}
/* create device files */
- device_create_file(&pdev->dev, &dev_attr_debug);
+ ret = device_create_file(&pdev->dev, &dev_attr_debug);
+ if (ret) {
+ printk(KERN_ERR "failed to add debug attribute\n");
+ }
printk(KERN_INFO "fb%d: %s frame buffer device\n",
fbinfo->node, fbinfo->fix.id);
--
Ben (ben@fluff.org, http://www.fluff.org/)
'a smiley only costs 4 bytes'
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
^ permalink raw reply [flat|nested] 7+ messages in thread* [patch 4/5] S3C2410: Clean out changelog header and tidy
2008-05-20 12:49 [patch 0/5] FB fixes for 2.6.26-rc series Ben Dooks
` (2 preceding siblings ...)
2008-05-20 12:49 ` [patch 3/5] S3C2410: Add error print if we cannot add attribute Ben Dooks
@ 2008-05-20 12:49 ` Ben Dooks
2008-05-20 12:49 ` [patch 5/5] S3C2410: Fix driver MODULE_ALIAS() Ben Dooks
2008-05-20 20:59 ` [patch 0/5] FB fixes for 2.6.26-rc series Krzysztof Helt
5 siblings, 0 replies; 7+ messages in thread
From: Ben Dooks @ 2008-05-20 12:49 UTC (permalink / raw)
To: linux-fbdev-devel; +Cc: akpm, Ben Dooks, arnaud.patard
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: simtec/simtec-drivers-fb-s3c2410-hdrcleanup.patch --]
[-- Type: text/plain, Size: 4580 bytes --]
Remove the old changelog entries which are now out of date
and should be extractable from git anyway. Also tidy up the
copyright for the driver.
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Index: linux-2.6.26-rc3-quilt1/drivers/video/s3c2410fb.c
===================================================================
--- linux-2.6.26-rc3-quilt1.orig/drivers/video/s3c2410fb.c 2008-05-20 10:25:15.000000000 +0100
+++ linux-2.6.26-rc3-quilt1/drivers/video/s3c2410fb.c 2008-05-20 10:26:45.000000000 +0100
@@ -1,75 +1,15 @@
-/*
- * linux/drivers/video/s3c2410fb.c
- * Copyright (c) Arnaud Patard, Ben Dooks
+/* linux/drivers/video/s3c2410fb.c
+ * Copyright (c) 2004,2005 Arnaud Patard
+ * Copyright (c) 2004-2008 Ben Dooks
+ *
+ * S3C2410 LCD Framebuffer Driver
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file COPYING in the main directory of this archive for
* more details.
*
- * S3C2410 LCD Controller Frame Buffer Driver
- * based on skeletonfb.c, sa1100fb.c and others
- *
- * ChangeLog
- * 2005-04-07: Arnaud Patard <arnaud.patard@rtp-net.org>
- * - u32 state -> pm_message_t state
- * - S3C2410_{VA,SZ}_LCD -> S3C24XX
- *
- * 2005-03-15: Arnaud Patard <arnaud.patard@rtp-net.org>
- * - Removed the ioctl
- * - use readl/writel instead of __raw_writel/__raw_readl
- *
- * 2004-12-04: Arnaud Patard <arnaud.patard@rtp-net.org>
- * - Added the possibility to set on or off the
- * debugging messages
- * - Replaced 0 and 1 by on or off when reading the
- * /sys files
- *
- * 2005-03-23: Ben Dooks <ben-linux@fluff.org>
- * - added non 16bpp modes
- * - updated platform information for range of x/y/bpp
- * - add code to ensure palette is written correctly
- * - add pixel clock divisor control
- *
- * 2004-11-11: Arnaud Patard <arnaud.patard@rtp-net.org>
- * - Removed the use of currcon as it no more exists
- * - Added LCD power sysfs interface
- *
- * 2004-11-03: Ben Dooks <ben-linux@fluff.org>
- * - minor cleanups
- * - add suspend/resume support
- * - s3c2410fb_setcolreg() not valid in >8bpp modes
- * - removed last CONFIG_FB_S3C2410_FIXED
- * - ensure lcd controller stopped before cleanup
- * - added sysfs interface for backlight power
- * - added mask for gpio configuration
- * - ensured IRQs disabled during GPIO configuration
- * - disable TPAL before enabling video
- *
- * 2004-09-20: Arnaud Patard <arnaud.patard@rtp-net.org>
- * - Suppress command line options
- *
- * 2004-09-15: Arnaud Patard <arnaud.patard@rtp-net.org>
- * - code cleanup
- *
- * 2004-09-07: Arnaud Patard <arnaud.patard@rtp-net.org>
- * - Renamed from h1940fb.c to s3c2410fb.c
- * - Add support for different devices
- * - Backlight support
- *
- * 2004-09-05: Herbert P������tzl <herbert@13thfloor.at>
- * - added clock (de-)allocation code
- * - added fixem fbmem option
- *
- * 2004-07-27: Arnaud Patard <arnaud.patard@rtp-net.org>
- * - code cleanup
- * - added a forgotten return in h1940fb_init
- *
- * 2004-07-19: Herbert P������tzl <herbert@13thfloor.at>
- * - code cleanup and extended debugging
- *
- * 2004-07-15: Arnaud Patard <arnaud.patard@rtp-net.org>
- * - First version
- */
+ * Driver based on skeletonfb.c, sa1100fb.c and others.
+*/
#include <linux/module.h>
#include <linux/kernel.h>
Index: linux-2.6.26-rc3-quilt1/drivers/video/s3c2410fb.h
===================================================================
--- linux-2.6.26-rc3-quilt1.orig/drivers/video/s3c2410fb.h 2008-05-20 10:25:15.000000000 +0100
+++ linux-2.6.26-rc3-quilt1/drivers/video/s3c2410fb.h 2008-05-20 10:28:32.000000000 +0100
@@ -1,26 +1,14 @@
/*
* linux/drivers/video/s3c2410fb.h
- * Copyright (c) Arnaud Patard
+ * Copyright (c) 2004 Arnaud Patard
+ *
+ * S3C2410 LCD Framebuffer Driver
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file COPYING in the main directory of this archive for
* more details.
*
- * S3C2410 LCD Controller Frame Buffer Driver
- * based on skeletonfb.c, sa1100fb.h
- *
- * ChangeLog
- *
- * 2004-12-04: Arnaud Patard <arnaud.patard@rtp-net.org>
- * - Moved dprintk to s3c2410fb.c
- *
- * 2004-09-07: Arnaud Patard <arnaud.patard@rtp-net.org>
- * - Renamed from h1940fb.h to s3c2410fb.h
- * - Changed h1940 to s3c2410
- *
- * 2004-07-15: Arnaud Patard <arnaud.patard@rtp-net.org>
- * - First version
- */
+*/
#ifndef __S3C2410FB_H
#define __S3C2410FB_H
--
Ben (ben@fluff.org, http://www.fluff.org/)
'a smiley only costs 4 bytes'
[-- Attachment #2: Type: text/plain, Size: 230 bytes --]
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
[-- Attachment #3: Type: text/plain, Size: 182 bytes --]
_______________________________________________
Linux-fbdev-devel mailing list
Linux-fbdev-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-fbdev-devel
^ permalink raw reply [flat|nested] 7+ messages in thread* [patch 5/5] S3C2410: Fix driver MODULE_ALIAS()
2008-05-20 12:49 [patch 0/5] FB fixes for 2.6.26-rc series Ben Dooks
` (3 preceding siblings ...)
2008-05-20 12:49 ` [patch 4/5] S3C2410: Clean out changelog header and tidy Ben Dooks
@ 2008-05-20 12:49 ` Ben Dooks
2008-05-20 20:59 ` [patch 0/5] FB fixes for 2.6.26-rc series Krzysztof Helt
5 siblings, 0 replies; 7+ messages in thread
From: Ben Dooks @ 2008-05-20 12:49 UTC (permalink / raw)
To: linux-fbdev-devel; +Cc: akpm, Ben Dooks, arnaud.patard
[-- Attachment #1: simtec/simtec-drivers-fb-s3c2410-modalias.patch --]
[-- Type: text/plain, Size: 1022 bytes --]
Add a correct MODULE_ALIAS() entry for this driver
to enable udev module loading.
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Index: linux-2.6.26-rc3-quilt1/drivers/video/s3c2410fb.c
===================================================================
--- linux-2.6.26-rc3-quilt1.orig/drivers/video/s3c2410fb.c 2008-05-20 10:56:00.000000000 +0100
+++ linux-2.6.26-rc3-quilt1/drivers/video/s3c2410fb.c 2008-05-20 10:56:01.000000000 +0100
@@ -1070,3 +1070,5 @@ MODULE_AUTHOR("Arnaud Patard <arnaud.pat
"Ben Dooks <ben-linux@fluff.org>");
MODULE_DESCRIPTION("Framebuffer driver for the s3c2410");
MODULE_LICENSE("GPL");
+MODULE_ALIAS("platform:s3c2410-lcd");
+MODULE_ALIAS("platform:s3c2412-lcd");
--
Ben (ben@fluff.org, http://www.fluff.org/)
'a smiley only costs 4 bytes'
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [patch 0/5] FB fixes for 2.6.26-rc series
2008-05-20 12:49 [patch 0/5] FB fixes for 2.6.26-rc series Ben Dooks
` (4 preceding siblings ...)
2008-05-20 12:49 ` [patch 5/5] S3C2410: Fix driver MODULE_ALIAS() Ben Dooks
@ 2008-05-20 20:59 ` Krzysztof Helt
5 siblings, 0 replies; 7+ messages in thread
From: Krzysztof Helt @ 2008-05-20 20:59 UTC (permalink / raw)
To: Ben Dooks; +Cc: akpm, linux-fbdev-devel, arnaud.patard
On Tue, 20 May 2008 13:49:54 +0100
Ben Dooks <ben-fbdev@fluff.org> wrote:
> A set of fixes for both SM501 and S3C2410 framebuffer
> drivers.
>
All 5 patches seem simple and clean.
Acked-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Regards,
Krzysztof
----------------------------------------------------------------------
Dlugi weekend w deszczu?.. Lepiej sprawdz pogode!
http://link.interia.pl/f1dcd
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
^ permalink raw reply [flat|nested] 7+ messages in thread