From patchwork Tue Jul 24 02:19:25 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Donghwa Lee X-Patchwork-Id: 1230021 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id EB009DFFB5 for ; Tue, 24 Jul 2012 02:24:14 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1StUj1-0004cj-Hx; Tue, 24 Jul 2012 02:19:51 +0000 Received: from mailout1.samsung.com ([203.254.224.24]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1StUif-0004c8-Cg for linux-arm-kernel@lists.infradead.org; Tue, 24 Jul 2012 02:19:31 +0000 Received: from epcpsbgm2.samsung.com (mailout1.samsung.com [203.254.224.24]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0M7N0072X7R6X6G0@mailout1.samsung.com> for linux-arm-kernel@lists.infradead.org; Tue, 24 Jul 2012 11:19:26 +0900 (KST) X-AuditID: cbfee61b-b7f566d000005c8a-11-500e062d385a Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id A8.E6.23690.D260E005; Tue, 24 Jul 2012 11:19:25 +0900 (KST) Received: from [10.90.51.49] by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0M7N004C77SD8I40@mmp2.samsung.com> for linux-arm-kernel@lists.infradead.org; Tue, 24 Jul 2012 11:19:25 +0900 (KST) Message-id: <500E062D.2020307@samsung.com> Date: Tue, 24 Jul 2012 11:19:25 +0900 From: Donghwa Lee User-Agent: Mozilla/5.0 (X11; Linux i686; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-version: 1.0 To: linux-fbdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Florian Tobias Schandinat , Andrew Morton , Kyungmin Park , Inki Dae , Donghwa Lee Subject: [PATCH v2] video: exynos: s6e8ax0: support early fb event of fb_blank() X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmplluLIzCtJLcpLzFFi42I5/e+xoK4uG1+AwdEua4tNj6+xOjB6bF5S H8AYxWWTkpqTWZZapG+XwJXRdiq/YLVgxcH/Bg2MM/i6GDk5JARMJCZ1PWOBsMUkLtxbz9bF yMUhJDCdUeLhm1Z2CGcSk8T0ifsZQap4BbQk5r48yw5iswioSrx4s4wVxGYT0JA4fe8+WFxU IEBiY+sZdoh6QYkfk++xgAwSEZjHJPF5zk+whDBQ0azr78CGMgM1T319GsqWl9i85i3zBEbe WUj6ZyEpm4WkbAEj8ypG0dSC5ILipPRcI73ixNzi0rx0veT83E2M4MB5Jr2DcVWDxSFGAQ5G JR5eiS7eACHWxLLiytxDjBIczEoivAWfgEK8KYmVValF+fFFpTmpxYcYpTlYlMR5Tby/+gsJ pCeWpGanphakFsFkmTg4pRoY4xelKnxsLr39P0ts1dLthRoTJl1+5PB23rFoWZvXl7+XxMU0 t+UsfXl9Y+LcmeKC8t/P2rW2nPh6Z0HrCmV7s7CT7Lem32W+U5IRqnhDednsZ5ympacuSbpm PwtsWHziU5+MfrzMtR17a2emZ36MvMvH/Xr7i9Xsl2Z/ee7H1ycufu7/WT12JiWW4oxEQy3m ouJEAJlYecYYAgAA X-TM-AS-MML: No X-Spam-Note: CRM114 invocation failed X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [203.254.224.24 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 4.0 HDRS_LCASE Odd capitalization of message header 1.0 MANY_HDRS_LCASE Odd capitalization of multiple message headers X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org This patch supports early fb event of fb_blank(). - In case of lcd power off : call early_set_power() interface and lcd power is off. And then framebuffer is blanked. - In case of lcd power on : First, framebuffer is unblanked, and then call set_power() interface to turn lcd on. Signed-off-by: Donghwa Lee Signed-off-by: Inki Dae Signed-off-by: Kyungmin Park --- Changes of v1: - changes function name from s6e8aa0_early_set_power() to s6e8ax0_early_set_power() drivers/video/exynos/s6e8ax0.c | 32 ++++++++++++++++++++++++++++++++ 1 files changed, 32 insertions(+), 0 deletions(-) diff --git a/drivers/video/exynos/s6e8ax0.c b/drivers/video/exynos/s6e8ax0.c index 05d080b..bfb1919 100644 --- a/drivers/video/exynos/s6e8ax0.c +++ b/drivers/video/exynos/s6e8ax0.c @@ -663,6 +663,37 @@ static int s6e8ax0_gamma_ctrl(struct s6e8ax0 *lcd, int gamma) return 0; } +static int s6e8ax0_early_set_power(struct lcd_device *ld, int power) +{ + struct s6e8ax0 *lcd = lcd_get_data(ld); + struct mipi_dsim_master_ops *ops = lcd_to_master_ops(lcd); + int ret = 0; + + if (power != FB_BLANK_UNBLANK && power != FB_BLANK_POWERDOWN && + power != FB_BLANK_NORMAL) { + dev_err(lcd->dev, "power value should be 0, 1 or 4.\n"); + return -EINVAL; + } + + if (lcd->power == power) { + dev_err(lcd->dev, "power mode is same as previous one.\n"); + return -EINVAL; + } + + if (ops->set_early_blank_mode) { + /* LCD power off */ + if ((POWER_IS_OFF(power) && POWER_IS_ON(lcd->power)) + || (POWER_IS_ON(lcd->power) && POWER_IS_NRM(power))) { + ret = ops->set_early_blank_mode(lcd_to_master(lcd), + power); + if (!ret && lcd->power != power) + lcd->power = power; + } + } + + return ret; +} + static int s6e8ax0_set_power(struct lcd_device *ld, int power) { struct s6e8ax0 *lcd = lcd_get_data(ld); @@ -731,6 +762,7 @@ static int s6e8ax0_set_brightness(struct backlight_device *bd) } static struct lcd_ops s6e8ax0_lcd_ops = { + .early_set_power = s6e8ax0_early_set_power, .set_power = s6e8ax0_set_power, .get_power = s6e8ax0_get_power, };