From patchwork Sat Mar 24 16:28:46 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: 7449 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 CB1D423E2F for ; Sat, 24 Mar 2012 16:24:33 +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 8E6D2A186F3 for ; Sat, 24 Mar 2012 16:24:33 +0000 (UTC) Received: by mail-iy0-f180.google.com with SMTP id e36so8242315iag.11 for ; Sat, 24 Mar 2012 09:24:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:x-auditid :from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-brightmail-tracker:x-tm-as-mml:x-gm-message-state; bh=nqcigKMthKWptgOnwhECsSGDsT16lI7/WkqvOSk66ew=; b=aZwaoZfzVedRCYjlfKyKHFiLzUKvr4l8Cee51rOoYsPY/K5bPJFWN6uEGFmdriZewV WFCr/dYZyJHLu59/keGTiKlRzQ63XosEjF+3NnvdgnxoVLqb86xQO1SKdg+y7aJs4FCd 87Bf1xBkXGHlGAYOKbeJTlKQjyKnzdVIhSG/gzQzm0y6DtOjHuA0Y0JWd9h+3J1ygA2N /fKeAd8THIRTrmhiIOpUzsJkDJVx6m9+Nxc05cgt+z5kU1hbJoksDnzkBo6T6IFjc1ct PNpQvXtodDAcmo3sSOId/8c36r1vMHRVtefLhHBNWNJFufrMV4v9aN1kRyiva6ZolxEo y6fA== Received: by 10.50.183.163 with SMTP id en3mr1807295igc.12.1332606273369; Sat, 24 Mar 2012 09:24:33 -0700 (PDT) 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.203.79 with SMTP id fh15csp50062ibb; Sat, 24 Mar 2012 09:24:32 -0700 (PDT) Received: by 10.68.191.69 with SMTP id gw5mr23539497pbc.141.1332606272007; Sat, 24 Mar 2012 09:24:32 -0700 (PDT) Received: from mailout1.samsung.com (mailout1.samsung.com. [203.254.224.24]) by mx.google.com with ESMTP id l7si12988403pbd.50.2012.03.24.09.24.31; Sat, 24 Mar 2012 09:24:32 -0700 (PDT) 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 <0M1E00990DKQLN30@mailout1.samsung.com> for patches@linaro.org; Sun, 25 Mar 2012 01:24:30 +0900 (KST) X-AuditID: cbfee61a-b7c49ae0000061d4-cd-4f6df53e70ca Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (MMPCPMTA) with SMTP id B9.92.25044.E35FD6F4; Sun, 25 Mar 2012 01:24:30 +0900 (KST) Received: from localhost.localdomain ([107.108.73.37]) by mmp2.samsung.com (Oracle Communications Messaging Exchange Server 7u4-19.01 64bit (built Sep 7 2010)) with ESMTPA id <0M1E00DVFDKBD940@mmp2.samsung.com> for patches@linaro.org; Sun, 25 Mar 2012 01:24:30 +0900 (KST) From: Thomas Abraham To: linux-fbdev@vger.kernel.org Cc: FlorianSchandinat@gmx.de, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, kgene.kim@samsung.com, jg1.han@samsung.com, ben-linux@fluff.org, augulis.darius@gmail.com, patches@linaro.org Subject: [PATCH v3 2/4] video: s3c-fb: remove 'default_win' element from platform data Date: Sat, 24 Mar 2012 21:58:46 +0530 Message-id: <1332606528-32338-3-git-send-email-thomas.abraham@linaro.org> X-Mailer: git-send-email 1.6.6.rc2 In-reply-to: <1332606528-32338-1-git-send-email-thomas.abraham@linaro.org> References: <1332606528-32338-1-git-send-email-thomas.abraham@linaro.org> X-Brightmail-Tracker: AAAAAA== X-TM-AS-MML: No X-Gm-Message-State: ALoCoQkx/uC9v4HGZS8orG7jxrmkjzs58w2s1XsILCu1H3JF/pRYxitg4ul8Zkw4hB87n1ZGcwsb 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 Signed-off-by: Jingoo Han Signed-off-by: Thomas Abraham --- arch/arm/plat-samsung/include/plat/fb.h | 2 -- drivers/video/s3c-fb.c | 25 +++++-------------------- 2 files changed, 5 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 c94f40d..18c84b8 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 */ @@ -799,6 +799,7 @@ static int s3c_fb_blank(int blank_mode, struct fb_info *info) struct s3c_fb *sfb = win->parent; unsigned int index = win->index; u32 wincon; + u32 output_on = sfb->output_on; dev_dbg(sfb->dev, "blank mode %d\n", blank_mode); @@ -837,34 +838,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; } /**