From patchwork Sat Mar 3 15:50:07 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: thomas.abraham@linaro.org X-Patchwork-Id: 7077 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id C674E23F8E for ; Sat, 3 Mar 2012 15:45:44 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 8AB9CA18628 for ; Sat, 3 Mar 2012 15:45:44 +0000 (UTC) Received: by mail-iy0-f180.google.com with SMTP id e36so4888854iag.11 for ; Sat, 03 Mar 2012 07:45:44 -0800 (PST) Received: from mr.google.com ([10.43.52.74]) by 10.43.52.74 with SMTP id vl10mr9367731icb.55.1330789544396 (num_hops = 1); Sat, 03 Mar 2012 07:45:44 -0800 (PST) MIME-Version: 1.0 Received: by 10.43.52.74 with SMTP id vl10mr7701085icb.55.1330789544270; Sat, 03 Mar 2012 07:45:44 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.53.18 with SMTP id k18csp8485ibg; Sat, 3 Mar 2012 07:45:43 -0800 (PST) Received: by 10.68.204.6 with SMTP id ku6mr24679370pbc.157.1330789543013; Sat, 03 Mar 2012 07:45:43 -0800 (PST) Received: from mailout1.samsung.com (mailout1.samsung.com. [203.254.224.24]) by mx.google.com with ESMTP id e6si12952370pbj.300.2012.03.03.07.45.42; Sat, 03 Mar 2012 07:45:43 -0800 (PST) Received-SPF: neutral (google.com: 203.254.224.24 is neither permitted nor denied by best guess record for domain of thomas.abraham@linaro.org) client-ip=203.254.224.24; Authentication-Results: mx.google.com; spf=neutral (google.com: 203.254.224.24 is neither permitted nor denied by best guess record for domain of thomas.abraham@linaro.org) smtp.mail=thomas.abraham@linaro.org Received: from epcpsbgm1.samsung.com (mailout1.samsung.com [203.254.224.24]) by mailout1.samsung.com (Oracle Communications Messaging Exchange Server 7u4-19.01 64bit (built Sep 7 2010)) with ESMTP id <0M0B00A0WFS34680@mailout1.samsung.com> for patches@linaro.org; Sun, 04 Mar 2012 00:45:42 +0900 (KST) X-AuditID: cbfee61a-b7b78ae000001ceb-e6-4f523ca66f39 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (MMPCPMTA) with SMTP id E0.5C.07403.6AC325F4; Sun, 04 Mar 2012 00:45:42 +0900 (KST) Received: from localhost.localdomain ([107.108.73.37]) by mmp1.samsung.com (Oracle Communications Messaging Exchange Server 7u4-19.01 64bit (built Sep 7 2010)) with ESMTPA id <0M0B004LTFRWXU10@mmp1.samsung.com> for patches@linaro.org; Sun, 04 Mar 2012 00:45:42 +0900 (KST) From: Thomas Abraham To: linux-fbdev@vger.kernel.org Cc: FlorianSchandinat@gmx.de, linux-samsung-soc@vger.kernel.org, kgene.kim@samsung.com, jg1.han@samsung.com, ben-linux@fluff.org, patches@linaro.org Subject: [PATCH 2/3] video: s3c-fb: remove 'default_win' element from platform data Date: Sat, 03 Mar 2012 21:20:07 +0530 Message-id: <1330789808-8253-3-git-send-email-thomas.abraham@linaro.org> X-Mailer: git-send-email 1.6.6.rc2 In-reply-to: <1330789808-8253-1-git-send-email-thomas.abraham@linaro.org> References: <1330789808-8253-1-git-send-email-thomas.abraham@linaro.org> X-Brightmail-Tracker: AAAAAA== X-Gm-Message-State: ALoCoQlCOBh7uNUo+eATqNMiFbaxksvkMxIr0By75rg2hul4HASFu29wazzXrQPIY24PkJFG/mEQ 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 Cc: Jingoo Han Signed-off-by: Thomas Abraham --- arch/arm/plat-samsung/include/plat/fb.h | 2 -- drivers/video/s3c-fb.c | 24 ++++-------------------- 2 files changed, 4 insertions(+), 22 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 8e05d4d..8baba31 100644 --- a/drivers/video/s3c-fb.c +++ b/drivers/video/s3c-fb.c @@ -531,7 +531,7 @@ 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) + if (!sfb->output_on) s3c_fb_enable(sfb, 1); /* write the buffer address */ @@ -792,7 +792,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); @@ -838,27 +838,11 @@ static int s3c_fb_blank(int blank_mode, struct fb_info *info) * 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); pm_runtime_put_sync(sfb->dev); - return 0; + return output_on == sfb->output_on; } /**