From patchwork Mon Jul 23 04:27:34 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Donghwa Lee X-Patchwork-Id: 1226351 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 301C6E008A for ; Mon, 23 Jul 2012 04:34:25 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1StAFV-0008E8-Ps; Mon, 23 Jul 2012 04:28:01 +0000 Received: from mailout3.samsung.com ([203.254.224.33]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1StAFF-0008BU-Ut for linux-arm-kernel@lists.infradead.org; Mon, 23 Jul 2012 04:27:52 +0000 Received: from epcpsbgm2.samsung.com (mailout3.samsung.com [203.254.224.33]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0M7L00DT2J1S1B30@mailout3.samsung.com> for linux-arm-kernel@lists.infradead.org; Mon, 23 Jul 2012 13:27:41 +0900 (KST) X-AuditID: cbfee61b-b7f566d000005c8a-a1-500cd2bd3018 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 22.E7.23690.DB2DC005; Mon, 23 Jul 2012 13:27:41 +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 <0M7L00D2SJ252180@mmp2.samsung.com> for linux-arm-kernel@lists.infradead.org; Mon, 23 Jul 2012 13:27:41 +0900 (KST) Message-id: <500CD2B6.2080109@samsung.com> Date: Mon, 23 Jul 2012 13:27:34 +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] video: exynos: s6e8ax0: support early fb event of fb_blank() X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpnluLIzCtJLcpLzFFi42I5/e+xoO7eSzwBBnOmaVhsenyN1YHRY/OS +gDGKC6blNSczLLUIn27BK6MeX1PGQsOClR0TvzP2sB4gLeLkZNDQsBE4tK2z+wQtpjEhXvr 2boYuTiEBKYzSuxffoIRwpnEJDHt0HM2kCpeAS2JucsPsYLYLAKqEr/m/QKLswloSJy+dx9s kqhAgMTG1jPsEPWCEj8m32MBGSQiMI9J4vOcn2AJYQFfiUO7d4MNYgZqnvr6NCOELS+xec1b 5gmMvLOQ9M9CUjYLSdkCRuZVjKKpBckFxUnpuUZ6xYm5xaV56XrJ+bmbGMHB80x6B+OqBotD jAIcjEo8vA/LeQKEWBPLiitzDzFKcDArifBevs4dIMSbklhZlVqUH19UmpNafIhRmoNFSZzX xPurv5BAemJJanZqakFqEUyWiYNTqoGx8v2nlmuFBitir8SsX/P/WgL3BGbNEO1EK1mrhNz4 RBYbbe35TZv2sjbJb553SWX9Hnctl0RzmTKdj1YSISxbnT7kHFs9v0P0xMyi4r+3A4MyLq8p mPH17dQ1P74ZtkztKmWQ3CDoXL0468S2uVnRQh9n3OqK8TrTF7H2ptNh5isparOf3o5VYinO SDTUYi4qTgQAO9s5oRoCAAA= 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.33 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 --- 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..e51d024 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 s6e8aa0_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 = s6e8aa0_early_set_power, .set_power = s6e8ax0_set_power, .get_power = s6e8ax0_get_power, };