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: 1226341 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 81B57E008A for ; Mon, 23 Jul 2012 04:27:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751632Ab2GWE1o (ORCPT ); Mon, 23 Jul 2012 00:27:44 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:14300 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751283Ab2GWE1o (ORCPT ); Mon, 23 Jul 2012 00:27:44 -0400 Received: from epcpsbgm1.samsung.com (mailout2.samsung.com [203.254.224.25]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0M7L00FRUJ1HDT40@mailout2.samsung.com> for linux-fbdev@vger.kernel.org; Mon, 23 Jul 2012 13:27:42 +0900 (KST) X-AuditID: cbfee61a-b7f616d000004b7e-e6-500cd2bd2250 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id C0.E2.19326.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-fbdev@vger.kernel.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() Content-type: text/plain; charset=EUC-KR Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpjluLIzCtJLcpLzFFi42I5/e+xoO7eSzwBBg2rNS1O9H1gdWD0+LxJ LoAxissmJTUnsyy1SN8ugStjXt9TxoKDAhWdE/+zNjAe4O1i5OCQEDCROLeSv4uRE8gUk7hw bz1bFyMXh5DAdEaJvcs3s0A4nUwSrfd2MoJU8QpoScxdfogVxGYRUJX4Ne8XG4jNJqAhcfre fXYQW1QgQGJj6xl2iHpBiR+T74ENEhGYxyTxec5PsISwgK/Eod27wQYxAzVPfX2aEcKWl9i8 5i3zBEbeWUj6ZyEpm4WkbAEj8ypG0dSC5ILipPRcQ73ixNzi0rx0veT83E2M4NB5JrWDcWWD xSFGAQ5GJR5eyyqeACHWxLLiytxDjBIczEoivJevcwcI8aYkVlalFuXHF5XmpBYfYpTmYFES 5zX2/uovJJCeWJKanZpakFoEk2Xi4JRqYIzc46jJPkE17qqj2t33XJ4LjA3mGTv8FP6uOZub W5g/xu2ns7AN24vpl+af0a5lTdsoGSMd9Geh9HtejuR7Nmv2HWnR/XozqXHK9Br9Q3sueO04 OL29rCBzweYHJ6JnhVe8CBI9Llu57E792tdpO7e9lKg7YXnfeW+czaFnZ8WvNK6ftWKu8xYl luKMREMt5qLiRADCn4UvGQIAAA== 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 --- 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, };