From patchwork Thu Jul 31 17:42:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Kumar X-Patchwork-Id: 4658481 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 673C8C033C for ; Thu, 31 Jul 2014 17:46:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 745EC2015E for ; Thu, 31 Jul 2014 17:46:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8568C201CE for ; Thu, 31 Jul 2014 17:46:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753457AbaGaRqE (ORCPT ); Thu, 31 Jul 2014 13:46:04 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:9277 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753443AbaGaRqB (ORCPT ); Thu, 31 Jul 2014 13:46:01 -0400 Received: from epcpsbgr1.samsung.com (u141.gpu120.samsung.co.kr [203.254.230.141]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N9L00ILB80N6LC0@mailout3.samsung.com>; Fri, 01 Aug 2014 02:45:59 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.122]) by epcpsbgr1.samsung.com (EPCPMTA) with SMTP id 08.C7.25328.7D08AD35; Fri, 01 Aug 2014 02:45:59 +0900 (KST) X-AuditID: cbfee68d-b7f2f6d0000062f0-4e-53da80d78326 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id FA.AA.04943.7D08AD35; Fri, 01 Aug 2014 02:45:59 +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:59 +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 Cc: inki.dae@samsung.com, seanpaul@google.com, ajaynumb@gmail.com, jg1.han@samsung.com, joshi@samsung.com, prashanth.g@samsung.com, Ajay Kumar , Sean Paul Subject: [PATCH 14/15] drm/exynos: Move DP setup into commit() Date: Thu, 31 Jul 2014 23:12:13 +0530 Message-id: <1406828534-10072-15-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+NgFprAIsWRmVeSWpSXmKPExsWyRsSkSvd6w61gg3dftSwOvD/IYrHhzUJm i/lHzrFaXPn6ns1i0v0JLBaXF15itfi+6wu7xYzz+5gsVh3ewG5xd8NZRou5B3Mtfu6ax+LA 4zG74SKLx85Zd9k9Fmwq9bjffZzJo2/LKkaPz5vkAtiiuGxSUnMyy1KL9O0SuDJmbDrFWvBH pKJly0u2BsYTgl2MnBwSAiYSLSv6mSFsMYkL99azdTFycQgJLGWU2ND/nwmmaO2dPawQiUWM Eq96d0NVTWCSmLCphRGkik1AW2Lb9JssILaIQJ3E/uX3GUGKmAUuMEq0/p0HtIODQ1jATmLt SzOQGhYBVYlpj5exg9i8Ap4SZz7+ByuREFCQmDPJBiTMCRSe2nuZHSQsJOAh8ex4GsQ9x9gl LvSJQ0wRkPg2+RALRKesxKYDUL9IShxccYNlAqPwAkaGVYyiq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Uux+k7 R7/IVWxr6Gs6tjcsK2rl4x0CJ099eLtz3qXv4v8/Nhxcyny5p27lpn6rndKzefOMwt5bPbnt LLzQL2xa6fm66DU+uzpzNZdGnPWuiL+7/MmcWce7FOXM352XfuT+NX/Rdk+HiBUJq29fCjW6 sf9i2cPAfytTCzhU1JRYijMSDbWYi4oTAYmcuVfTAgAA DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 Add commit callback for exynos_dp, and move the DP link training, video configuration code from the hotplug handler into commit(). Signed-off-by: Sean Paul Signed-off-by: Ajay Kumar --- drivers/gpu/drm/exynos/exynos_dp_core.c | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_dp_core.c b/drivers/gpu/drm/exynos/exynos_dp_core.c index 31c3de9..347dec9 100644 --- a/drivers/gpu/drm/exynos/exynos_dp_core.c +++ b/drivers/gpu/drm/exynos/exynos_dp_core.c @@ -875,10 +875,18 @@ static irqreturn_t exynos_dp_irq_handler(int irq, void *arg) static void exynos_dp_hotplug(struct work_struct *work) { struct exynos_dp_device *dp; - int ret; dp = container_of(work, struct exynos_dp_device, hotplug_work); + if (dp->drm_dev) + drm_helper_hpd_irq_event(dp->drm_dev); +} + +static void exynos_dp_commit(struct exynos_drm_display *display) +{ + struct exynos_dp_device *dp = display->ctx; + int ret; + ret = exynos_dp_detect_hpd(dp); if (ret) { /* Cable has been disconnected, we're done */ @@ -1050,8 +1058,10 @@ static void exynos_dp_phy_exit(struct exynos_dp_device *dp) } } -static void exynos_dp_poweron(struct exynos_dp_device *dp) +static void exynos_dp_poweron(struct exynos_drm_display *display) { + struct exynos_dp_device *dp = display->ctx; + if (dp->dpms_mode == DRM_MODE_DPMS_ON) return; @@ -1059,10 +1069,13 @@ static void exynos_dp_poweron(struct exynos_dp_device *dp) exynos_dp_phy_init(dp); exynos_dp_init_dp(dp); enable_irq(dp->irq); + exynos_dp_commit(display); } -static void exynos_dp_poweroff(struct exynos_dp_device *dp) +static void exynos_dp_poweroff(struct exynos_drm_display *display) { + struct exynos_dp_device *dp = display->ctx; + if (dp->dpms_mode != DRM_MODE_DPMS_ON) return; @@ -1078,12 +1091,12 @@ static void exynos_dp_dpms(struct exynos_drm_display *display, int mode) switch (mode) { case DRM_MODE_DPMS_ON: - exynos_dp_poweron(dp); + exynos_dp_poweron(display); break; case DRM_MODE_DPMS_STANDBY: case DRM_MODE_DPMS_SUSPEND: case DRM_MODE_DPMS_OFF: - exynos_dp_poweroff(dp); + exynos_dp_poweroff(display); break; default: break; @@ -1094,6 +1107,7 @@ static void exynos_dp_dpms(struct exynos_drm_display *display, int mode) static struct exynos_drm_display_ops exynos_dp_display_ops = { .create_connector = exynos_dp_create_connector, .dpms = exynos_dp_dpms, + .commit = exynos_dp_commit, }; static struct exynos_drm_display exynos_dp_display = {