From patchwork Mon Mar 12 20:59:58 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: 7238 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 49DBD23E00 for ; Mon, 12 Mar 2012 20:56:08 +0000 (UTC) Received: from mail-we0-f180.google.com (mail-we0-f180.google.com [74.125.82.180]) by fiordland.canonical.com (Postfix) with ESMTP id 3AAA3A1846D for ; Mon, 12 Mar 2012 20:56:08 +0000 (UTC) Received: by werf3 with SMTP id f3so4789969wer.11 for ; Mon, 12 Mar 2012 13:56:08 -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-gm-message-state; bh=wMKH0i1Db9NRGUaRgUBMVeVApD3jHTgCXvOuDc0mgq0=; b=YVVVZpPDqubPZOSxECFO5uJ2EMYc1FYPkEWFEWiXBRG8uVy7SGCGgZGIhfgHEBvJR9 zQg3850ye41wLGcqSuB5SUoZH+Ujh1Eb0mOsrl23btVGQEyjF7jv1BMAKPt2x9jp41Jk X6CiFmnr1uIk1ub18zkqsDjdGdpRjEB0DxKmhWOZbCYlRJ+wVVMBiEz1LOMFklyJpEC6 Ds1yuDdZtKxDwwkJ42My6pw9LJBtCZp5ANIhTybuBeCcnMjWM5Cuf8KQGCAB/D8WCaS0 V3ypY+vqW2y7PQYLLrLDzby8XwSXgIKFk7JDXc8TPyfSO7QBQsE8KXvWViOoh9zrqa62 +dfw== Received: by 10.50.183.137 with SMTP id em9mr628381igc.58.1331585767453; Mon, 12 Mar 2012 13:56:07 -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.53.18 with SMTP id k18csp51181ibg; Mon, 12 Mar 2012 13:56:06 -0700 (PDT) Received: by 10.68.190.42 with SMTP id gn10mr2839990pbc.107.1331585765370; Mon, 12 Mar 2012 13:56:05 -0700 (PDT) Received: from mailout1.samsung.com (mailout1.samsung.com. [203.254.224.24]) by mx.google.com with ESMTP id 9si16967904pbr.108.2012.03.12.13.56.05; Mon, 12 Mar 2012 13:56:05 -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 <0M0S00FQTI584N00@mailout1.samsung.com> for patches@linaro.org; Tue, 13 Mar 2012 05:56:04 +0900 (KST) X-AuditID: cbfee61a-b7b78ae000001ceb-4a-4f5e62e4f01a Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (MMPCPMTA) with SMTP id AA.38.07403.4E26E5F4; Tue, 13 Mar 2012 05:56:04 +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 <0M0S00DHLI564930@mmp2.samsung.com> for patches@linaro.org; Tue, 13 Mar 2012 05:56:04 +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, patches@linaro.org Subject: [PATCH v2 2/3] video: s3c-fb: remove 'default_win' element from platform data Date: Tue, 13 Mar 2012 02:29:58 +0530 Message-id: <1331585999-8604-3-git-send-email-thomas.abraham@linaro.org> X-Mailer: git-send-email 1.6.6.rc2 In-reply-to: <1331585999-8604-1-git-send-email-thomas.abraham@linaro.org> References: <1331585999-8604-1-git-send-email-thomas.abraham@linaro.org> X-Brightmail-Tracker: AAAAAA== X-Gm-Message-State: ALoCoQm3T7MXqF/Wa17NujAeMu3s4JPnVoPlTS2OAMxs0kCTXgHgtHWUcP/Ry2pnxbeDXLeYQtj5 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 | 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; } /**