From: Ben Dooks <ben-fbdev@fluff.org>
To: linux-fbdev-devel@lists.sourceforge.net
Cc: akpm@linux-foundation.org, Ben Dooks <ben-linux@fluff.org>,
arnaud.patard@rtp-net.org
Subject: [patch 2/5] S3C2410: Ensure that FB_BLANK_POWERDOWN shuts down the controller
Date: Tue, 20 May 2008 13:49:56 +0100 [thread overview]
Message-ID: <20080520125030.158169752@fluff.org.uk> (raw)
In-Reply-To: 20080520124954.001898813@fluff.org.uk
[-- 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/
next prev parent reply other threads:[~2008-05-20 12:50 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2008-05-20 12:49 ` [patch 3/5] S3C2410: Add error print if we cannot add attribute Ben Dooks
2008-05-20 12:49 ` [patch 4/5] S3C2410: Clean out changelog header and tidy 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080520125030.158169752@fluff.org.uk \
--to=ben-fbdev@fluff.org \
--cc=akpm@linux-foundation.org \
--cc=arnaud.patard@rtp-net.org \
--cc=ben-linux@fluff.org \
--cc=linux-fbdev-devel@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).