linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Abraham <thomas.abraham@linaro.org>
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 2/3] video: s3c-fb: remove 'default_win' element from platform data
Date: Mon, 12 Mar 2012 20:56:57 +0000	[thread overview]
Message-ID: <1331585999-8604-3-git-send-email-thomas.abraham@linaro.org> (raw)
In-Reply-To: <1331585999-8604-1-git-send-email-thomas.abraham@linaro.org>

The decision to enable or disable the data output to the lcd panel from
the controller need not be based on the value of 'default_win' element
in the platform data. Instead, the data output to the panel is enabled
if any of the windows are active, else data output is disabled.

Cc: Ben Dooks <ben-linux@fluff.org>
Cc: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
---
 arch/arm/plat-samsung/include/plat/fb.h |    2 --
 drivers/video/s3c-fb.c                  |   28 ++++++----------------------
 2 files changed, 6 insertions(+), 24 deletions(-)

diff --git a/arch/arm/plat-samsung/include/plat/fb.h b/arch/arm/plat-samsung/include/plat/fb.h
index 39d6bd7..536002f 100644
--- a/arch/arm/plat-samsung/include/plat/fb.h
+++ b/arch/arm/plat-samsung/include/plat/fb.h
@@ -62,8 +62,6 @@ struct s3c_fb_platdata {
 	struct s3c_fb_pd_win	*win[S3C_FB_MAX_WIN];
 	struct fb_videomode     *vtiming;
 
-	u32			 default_win;
-
 	u32			 vidcon0;
 	u32			 vidcon1;
 };
diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c
index 60d1c12..cfe5113 100644
--- a/drivers/video/s3c-fb.c
+++ b/drivers/video/s3c-fb.c
@@ -531,8 +531,8 @@ static int s3c_fb_set_par(struct fb_info *info)
 	/* disable the window whilst we update it */
 	writel(0, regs + WINCON(win_no));
 
-	if (win_no = sfb->pdata->default_win)
- 		s3c_fb_enable(sfb, 1);
+	if (!sfb->output_on)
+		s3c_fb_enable(sfb, 1);
 
 	/* write the buffer address */
 
@@ -798,7 +798,7 @@ static int s3c_fb_blank(int blank_mode, struct fb_info *info)
 	struct s3c_fb_win *win = info->par;
 	struct s3c_fb *sfb = win->parent;
 	unsigned int index = win->index;
-	u32 wincon;
+	u32 wincon, output_on = sfb->output_on;
 
 	dev_dbg(sfb->dev, "blank mode %d\n", blank_mode);
 
@@ -837,34 +837,18 @@ static int s3c_fb_blank(int blank_mode, struct fb_info *info)
 
 	shadow_protect_win(win, 1);
 	writel(wincon, sfb->regs + sfb->variant.wincon + (index * 4));
-	shadow_protect_win(win, 0);
 
 	/* Check the enabled state to see if we need to be running the
 	 * main LCD interface, as if there are no active windows then
 	 * it is highly likely that we also do not need to output
 	 * anything.
 	 */
-
-	/* We could do something like the following code, but the current
-	 * system of using framebuffer events means that we cannot make
-	 * the distinction between just window 0 being inactive and all
-	 * the windows being down.
-	 *
-	 * s3c_fb_enable(sfb, sfb->enabled ? 1 : 0);
-	*/
-
-	/* we're stuck with this until we can do something about overriding
-	 * the power control using the blanking event for a single fb.
-	 */
-	if (index = sfb->pdata->default_win) {
-		shadow_protect_win(win, 1);
-		s3c_fb_enable(sfb, blank_mode != FB_BLANK_POWERDOWN ? 1 : 0);
-		shadow_protect_win(win, 0);
-	}
+	s3c_fb_enable(sfb, sfb->enabled ? 1 : 0);
+	shadow_protect_win(win, 0);
 
 	pm_runtime_put_sync(sfb->dev);
 
-	return 0;
+	return output_on = sfb->output_on;
 }
 
 /**
-- 
1.6.6.rc2


  reply	other threads:[~2012-03-12 20:56 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-12 20:56 [PATCH v2 0/3] video: s3c-fb: Rearrange the elements in platform data Thomas Abraham
2012-03-12 20:56 ` Thomas Abraham [this message]
2012-03-13  9:34   ` [PATCH v3 2/3] video: s3c-fb: remove 'default_win' element from " Jingoo Han
2012-03-12 20:56 ` [PATCH v2 1/3] video: s3c-fb: move video interface timing out of window setup data Thomas Abraham
2012-03-12 20:57 ` [PATCH v2 3/3] ARM: Samsung: Rework platform data of s3c-fb driver Thomas Abraham
2012-03-13  9:47   ` Jingoo Han
2012-03-13 10:22     ` Thomas Abraham
2012-03-14  1:51       ` Jingoo Han
2012-03-14 18:39         ` Darius Augulis
2012-03-15  0:20           ` Jingoo Han
2012-03-15  7:42             ` Darius Augulis
2012-03-15  8:10               ` Jingoo Han
2012-03-15  8:26                 ` Darius Augulis
2012-03-15  8:39                   ` Jingoo Han
2012-03-16  1:39                   ` Jingoo Han
2012-03-16  7:47                     ` Darius Augulis
2012-03-16  8:07                       ` Jingoo Han
2012-03-16  9:15                         ` Darius Augulis
2012-03-16  9:48                           ` Jingoo Han
2012-03-16 10:18                             ` Darius Augulis
2012-03-18 23:46                               ` Jingoo Han
2012-03-19  7:41                                 ` Thomas Abraham
2012-03-19  7:40                                   ` Darius Augulis
2012-03-19  7:50                                     ` Thomas Abraham
2012-03-19  7:52                                       ` Darius Augulis
2012-03-14 19:08       ` Darius Augulis

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=1331585999-8604-3-git-send-email-thomas.abraham@linaro.org \
    --to=thomas.abraham@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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).