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: 1230011 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 3D3C5DFFB5 for ; Tue, 24 Jul 2012 02:19:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752735Ab2GXCT1 (ORCPT ); Mon, 23 Jul 2012 22:19:27 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:24370 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751776Ab2GXCT1 (ORCPT ); Mon, 23 Jul 2012 22:19:27 -0400 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-fbdev@vger.kernel.org; Tue, 24 Jul 2012 11:19:26 +0900 (KST) X-AuditID: cbfee61b-b7f566d000005c8a-12-500e062d2b04 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id C8.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-fbdev@vger.kernel.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() Content-type: text/plain; charset=EUC-KR Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmphluLIzCtJLcpLzFFi42I5/e+xoK4uG1+AQc9PG4sTfR9YHRg9Pm+S C2CM4rJJSc3JLEst0rdL4MpoO5VfsFqw4uB/gwbGGXxdjJwcEgImEttPbmaHsMUkLtxbz9bF yMUhJDCdUWLD4hmsIAkhgU4miSlPXUFsXgEtibkvz4I1sAioSrx4swyshk1AQ+L0vftgcVGB AImNrWfYIeoFJX5MvscCMlREYB6TxOc5P8ESwkBFs66/YwSxmYGap74+DWXLS2xe85Z5AiPv LCT9s5CUzUJStoCReRWjaGpBckFxUnqukV5xYm5xaV66XnJ+7iZGcNg8k97BuKrB4hCjAAej Eg+vRBdvgBBrYllxZe4hRgkOZiUR3oJPQCHelMTKqtSi/Pii0pzU4kOM0hwsSuK8Jt5f/YUE 0hNLUrNTUwtSi2CyTBycUg2MS7REBNI1avcf8H1TGrAvc5fNulO/pj0PefDzDCvv5Rkpf089 SFk5sWnbvA5fg2eeF89cYm5rZv8u8/Lv0fOXVsmHLdwqV2WkmHGM5bjiqi/8z68I9jx+e6GU J8H87sWocsspc67y1qTG7Evr63mdvkKMdcbKNRtN18/89skm8l8O7yTpS9tMtiqxFGckGmox FxUnAgA3RK1cFwIAAA== X-TM-AS-MML: No Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.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, };