From patchwork Tue Mar 13 09:34:32 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jingoo Han X-Patchwork-Id: 7259 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 C975D23E13 for ; Tue, 13 Mar 2012 09:34:37 +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 69BDBA18525 for ; Tue, 13 Mar 2012 09:34:37 +0000 (UTC) Received: by iage36 with SMTP id e36so729422iag.11 for ; Tue, 13 Mar 2012 02:34:36 -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:references:in-reply-to:subject:date:message-id :mime-version:content-type:content-transfer-encoding:x-mailer :thread-index:content-language:x-brightmail-tracker :x-gm-message-state; bh=wm+d1uWEbw5dGzeeIlHe/JxuoXC1H+uoCgF2iM54N8E=; b=lfC2G/lI2QK/6+S9UR2MUwRnu3UbC3EN2Ga/f8Muf/aDfg2q3dwhWyU/G8ULp5AxYm RBjO/KZj/Vc0UiiY6ZVSpg5w6DwfOvjZz5hV9VENtnRwktZ7Wg1wTSIOULwJS/g5Heyz l2mKA2yd3V8mxp9lcb9gtzBR91kqsx2G6HYKFSrP5c/GQ5bQfxTxnAevQRdt5s4VKLPA SjDARER4scMEIGWSmd72b/X6NIH/ho9Q+sj2r3gyd9Tp9M7t0q+BC/2s5nsYvvBy7Brs bjVXjc4JFS7BiMS+dOFGJPAvdfI+zHeFrJ8LfKe4QMvmgVr4OatR2x+1ZYbCmpoXWuXK axwg== Received: by 10.50.159.135 with SMTP id xc7mr3417856igb.50.1331631276810; Tue, 13 Mar 2012 02:34:36 -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 k18csp60961ibg; Tue, 13 Mar 2012 02:34:36 -0700 (PDT) Received: by 10.68.135.38 with SMTP id pp6mr5380671pbb.82.1331631275475; Tue, 13 Mar 2012 02:34:35 -0700 (PDT) Received: from mailout1.samsung.com (mailout1.samsung.com. [203.254.224.24]) by mx.google.com with ESMTP id e9si704073pbi.261.2012.03.13.02.34.34; Tue, 13 Mar 2012 02:34:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of jg1.han@samsung.com designates 203.254.224.24 as permitted sender) client-ip=203.254.224.24; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of jg1.han@samsung.com designates 203.254.224.24 as permitted sender) smtp.mail=jg1.han@samsung.com Received: from epcpsbgm2.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 <0M0T00E0MH9KZSY0@mailout1.samsung.com>; Tue, 13 Mar 2012 18:34:33 +0900 (KST) X-AuditID: cbfee61b-b7c62ae000000989-b6-4f5f14a8e3a0 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (MMPCPMTA) with SMTP id C8.55.02441.8A41F5F4; Tue, 13 Mar 2012 18:34:32 +0900 (KST) Received: from DOJG1HAN02 ([12.23.119.56]) by mmp2.samsung.com (Oracle Communications Messaging Exchange Server 7u4-19.01 64bit (built Sep 7 2010)) with ESMTPA id <0M0T00ACRH9M1020@mmp2.samsung.com>; Tue, 13 Mar 2012 18:34:34 +0900 (KST) From: Jingoo Han 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, ben-linux@fluff.org, patches@linaro.org, 'Thomas Abraham' , 'Jingoo Han' References: <1331585999-8604-1-git-send-email-thomas.abraham@linaro.org> <1331585999-8604-3-git-send-email-thomas.abraham@linaro.org> In-reply-to: <1331585999-8604-3-git-send-email-thomas.abraham@linaro.org> Subject: [PATCH v3 2/3] video: s3c-fb: remove 'default_win' element from platform data Date: Tue, 13 Mar 2012 18:34:32 +0900 Message-id: <002e01cd00fc$7efad9e0$7cf08da0$%han@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-index: Ac0AkonBo0G0vmeLTYieqssQu/5ZSQAaY8kw Content-language: ko X-Brightmail-Tracker: AAAAAA== X-Gm-Message-State: ALoCoQnd28YFA0szYMpwYXW+0SW28ivBVahfOI/85DoRKO8hjy7BBib78Xw8yQ6/f+YsS/UorfXD From: Thomas Abraham 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 --- v3: fix some minor coding styles arch/arm/plat-samsung/include/plat/fb.h | 3 --- drivers/video/s3c-fb.c | 24 +++++------------------- 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..b885322 100644 --- a/arch/arm/plat-samsung/include/plat/fb.h +++ b/arch/arm/plat-samsung/include/plat/fb.h @@ -43,7 +43,6 @@ struct s3c_fb_pd_win { * @setup_gpio: Setup the external GPIO pins to the right state to transfer * the data from the display system to the connected display * device. - * @default_win: default window layer number to be used for UI layer. * @vidcon0: The base vidcon0 values to control the panel data format. * @vidcon1: The base vidcon1 values to control the panel data output. * @vtiming: Video timing when connected to a RGB type panel. @@ -62,8 +61,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..dd816fb 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); @@ -844,27 +845,12 @@ 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); + shadow_protect_win(win, 0); pm_runtime_put_sync(sfb->dev); - return 0; + return output_on == sfb->output_on; } /**