From patchwork Thu Jul 31 17:42:11 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Kumar X-Patchwork-Id: 4659831 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 791F29F38C for ; Fri, 1 Aug 2014 01:05:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A2D5B201BF for ; Fri, 1 Aug 2014 01:05:21 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id E2B4F2015E for ; Fri, 1 Aug 2014 01:05:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BC7ED6E6EE; Thu, 31 Jul 2014 18:05:13 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout3.samsung.com (mailout3.samsung.com [203.254.224.33]) by gabe.freedesktop.org (Postfix) with ESMTP id 97FAE6E6A5 for ; Thu, 31 Jul 2014 10:45:55 -0700 (PDT) Received: from epcpsbgr2.samsung.com (u142.gpu120.samsung.co.kr [203.254.230.142]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N9L00IL580I6LC0@mailout3.samsung.com> for dri-devel@lists.freedesktop.org; Fri, 01 Aug 2014 02:45:54 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.123]) by epcpsbgr2.samsung.com (EPCPMTA) with SMTP id 48.95.19786.2D08AD35; Fri, 01 Aug 2014 02:45:54 +0900 (KST) X-AuditID: cbfee68e-b7fab6d000004d4a-fb-53da80d26a52 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 3A.AA.04943.2D08AD35; Fri, 01 Aug 2014 02:45:54 +0900 (KST) Received: from chromebld-server.sisodomain.com ([107.108.73.106]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N9L00GWZ7ZJ9070@mmp1.samsung.com>; Fri, 01 Aug 2014 02:45:54 +0900 (KST) From: Ajay Kumar To: dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, devicetree@vger.kernel.org, thierry.reding@gmail.com Subject: [PATCH 12/15] drm/panel: simple: Support usage of delays in panel functions Date: Thu, 31 Jul 2014 23:12:11 +0530 Message-id: <1406828534-10072-13-git-send-email-ajaykumar.rs@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1406828534-10072-1-git-send-email-ajaykumar.rs@samsung.com> References: <1406828534-10072-1-git-send-email-ajaykumar.rs@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupgkeLIzCtJLcpLzFFi42JZI2JSrXup4VawwZsLZhYH3h9ksdjwZiGz xfwj51gtrnx9z2Yx6f4EFovLCy+xWnzf9YXdYsb5fUwWqw5vYLeYezDX4ueueSwO3B47Z91l 91iwqdTjfvdxJo++LasYPT5vkgtgjeKySUnNySxLLdK3S+DK2PnwJmPBO6GKE68nszUwzuLv YuTkkBAwkfixtJkZwhaTuHBvPVsXIxeHkMBSRonr36azwRR17HrODJFYxChxYfYtRghnApPE u7e9YFVsAtoS26bfZAGxRQTqJPYvvw9WxCywllHi6bzJYAlhgTCJiSuvg9ksAqoST890s4LY vAKeEv3H+4DiHEDrFCTmTLIBCXMChaf2XmYHCQsJeEg8O54GMlJCYBu7xJlfWxkhxghIfJt8 CKpVVmLTAahvJCUOrrjBMoFReAEjwypG0dSC5ILipPQiI73ixNzi0rx0veT83E2MwFg4/e9Z 3w7GmwesDzEmA42byCwlm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qciM1i b8mJfr07rK9U3bLhg6GJew/z7js9ZwuC98w//mzmRv31J5O9mqTeKIqzrzxnWXZbpe6auZIS S3FGoqEWc1FxIgAVAS/bygIAAA== DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected X-Mailman-Approved-At: Thu, 31 Jul 2014 18:05:11 -0700 Cc: seanpaul@google.com, joshi@samsung.com, ajaynumb@gmail.com, prashanth.g@samsung.com, Ajay Kumar X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP For most of the panels, we need to provide delays during various stages of panel powerup/powerdown. So, Add a structure to hold those delay values and use them in corresponding functions. Signed-off-by: Ajay Kumar --- drivers/gpu/drm/panel/panel-simple.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c index 9801728..d6e92ea 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -41,6 +41,24 @@ struct panel_desc { unsigned int width; unsigned int height; } size; + + /** + * @prepare: the time (in milliseconds) that it takes for the panel + * to become ready and start receiving video data + * @enable: the time (in milliseconds) that it takes for the panel + * to display the first valid frame after starting to + * receive video data + * @disable: the time (in milliseconds) that it takes for the panel + * to turn the display off (no content is visible) + * @unprepare: the time (in milliseconds) that it takes for the panel + * to power down itself completely + */ + struct { + unsigned int prepare; + unsigned int enable; + unsigned int disable; + unsigned int unprepare; + } delay; }; struct panel_simple { @@ -106,6 +124,9 @@ static int panel_simple_disable(struct drm_panel *panel) backlight_update_status(p->backlight); } + if (p->desc->delay.disable) + msleep(p->desc->delay.disable); + p->enabled = false; return 0; @@ -123,6 +144,9 @@ static int panel_simple_unprepare(struct drm_panel *panel) regulator_disable(p->supply); + if (p->desc->delay.unprepare) + msleep(p->desc->delay.unprepare); + p->prepared = false; return 0; @@ -145,6 +169,9 @@ static int panel_simple_prepare(struct drm_panel *panel) if (p->enable_gpio) gpiod_set_value_cansleep(p->enable_gpio, 1); + if (p->desc->delay.prepare) + msleep(p->desc->delay.prepare); + p->prepared = true; return 0; @@ -157,6 +184,9 @@ static int panel_simple_enable(struct drm_panel *panel) if (p->enabled) return 0; + if (p->desc->delay.enable) + msleep(p->desc->delay.enable); + if (p->backlight) { p->backlight->props.power = FB_BLANK_UNBLANK; backlight_update_status(p->backlight);