From patchwork Tue May 27 12:42:43 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inki Dae X-Patchwork-Id: 4249121 Return-Path: X-Original-To: patchwork-linux-samsung-soc@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 D56DD9F3DC for ; Tue, 27 May 2014 12:42:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 104F220279 for ; Tue, 27 May 2014 12:42:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DB805201FA for ; Tue, 27 May 2014 12:42:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751747AbaE0Mmt (ORCPT ); Tue, 27 May 2014 08:42:49 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:23923 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751748AbaE0Mms (ORCPT ); Tue, 27 May 2014 08:42:48 -0400 Received: from epcpsbgr5.samsung.com (u145.gpu120.samsung.co.kr [203.254.230.145]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N6800GJJGN97ZB0@mailout1.samsung.com> for linux-samsung-soc@vger.kernel.org; Tue, 27 May 2014 21:42:45 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.113]) by epcpsbgr5.samsung.com (EPCPMTA) with SMTP id EA.12.16580.54884835; Tue, 27 May 2014 21:42:45 +0900 (KST) X-AuditID: cbfee691-b7f2f6d0000040c4-ad-538488457950 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id E1.DB.08203.54884835; Tue, 27 May 2014 21:42:45 +0900 (KST) Received: from daeinki-desktop.10.32.193.11 ([10.252.83.67]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N680038CGN7F010@mmp1.samsung.com>; Tue, 27 May 2014 21:42:45 +0900 (KST) From: Inki Dae To: airlied@linux.ie, dri-devel@lists.freedesktop.org Cc: linux-samsung-soc@vger.kernel.org, a.hajda@samsung.com, rmk+kernel@arm.linux.org.uk, Inki Dae Subject: [PATCH 2/2] drm/exynos: mipi-dsi: consider panel driver-deferred probe Date: Tue, 27 May 2014 21:42:43 +0900 Message-id: <1401194563-803-3-git-send-email-inki.dae@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1401194563-803-1-git-send-email-inki.dae@samsung.com> References: <1401194563-803-1-git-send-email-inki.dae@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrHLMWRmVeSWpSXmKPExsWyRsSkUNe1oyXY4PdUeYtb686xWvSeO8lk ceXrezaLSfcnsFjMOL+PyWLzh5dsDmweLc09bB7bvz1g9bjffZzJo2/LKkaPz5vkAlijuGxS UnMyy1KL9O0SuDJmXrvAXjBXvOLR8X2sDYxnhLsYOTkkBEwk5u3dyQRhi0lcuLeerYuRi0NI YCmjRNOBjaxdjBxgResnpEHEFzFK3P1/ixnC6WaSePrqEiNIN5uAqsTEFffZQGwRAVOJjklL WUBsZoEqieub37GADBIW8Je48d8fxGQBKl/2RgWkglfASWLGzkWMEKsUJOZMsgEJcwo4SyxY 8JsdxBYCKllzYhETyFYJgensEm9utIDdzCIgIPFt8iEWiF5ZiU0HmCFekZQ4uOIGywRG4QWM DKsYRVMLkguKk9KLTPWKE3OLS/PS9ZLzczcxAsP69L9nE3cw3j9gfYgxGWjcRGYp0eR8YFzk lcQbGpsZWZiamBobmVuakSasJM6b/igpSEggPbEkNTs1tSC1KL6oNCe1+BAjEwenVAPj6kP3 pGZdmi8aaff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LP-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.5 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 This patch makes sure that mipi dsi driver makes it re-probe in case that panel driver isn't probed yet. For this, it checks if panel driver is probed or not before component_add() is called. Signed-off-by: Inki Dae Acked-by: Kyungmin Park --- drivers/gpu/drm/exynos/exynos_drm_dsi.c | 38 +++++++++++++++---------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index 1421d9b..22503f3 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -1166,11 +1166,8 @@ exynos_dsi_detect(struct drm_connector *connector, bool force) { struct exynos_dsi *dsi = connector_to_dsi(connector); - if (!dsi->panel) { - dsi->panel = of_drm_find_panel(dsi->panel_node); - if (dsi->panel) - drm_panel_attach(dsi->panel, &dsi->connector); - } else if (!dsi->panel_node) { + /* Power off if panel driver is removed. */ + if (!dsi->panel_node) { struct exynos_drm_display *display; display = platform_get_drvdata(to_platform_device(dsi->dev)); @@ -1383,19 +1380,8 @@ static int exynos_dsi_bind(struct device *dev, struct device *master, void *data) { struct drm_device *drm_dev = data; - struct exynos_dsi *dsi; - int ret; - ret = exynos_drm_create_enc_conn(drm_dev, &exynos_dsi_display); - if (ret) { - DRM_ERROR("Encoder create [%d] failed with %d\n", - exynos_dsi_display.type, ret); - return ret; - } - - dsi = exynos_dsi_display.ctx; - - return mipi_dsi_host_register(&dsi->dsi_host); + return exynos_drm_create_enc_conn(drm_dev, &exynos_dsi_display); } static void exynos_dsi_unbind(struct device *dev, struct device *master, @@ -1406,8 +1392,6 @@ static void exynos_dsi_unbind(struct device *dev, struct device *master, exynos_dsi_dpms(&exynos_dsi_display, DRM_MODE_DPMS_OFF); - mipi_dsi_host_unregister(&dsi->dsi_host); - encoder->funcs->destroy(encoder); drm_connector_cleanup(&dsi->connector); } @@ -1502,6 +1486,18 @@ static int exynos_dsi_probe(struct platform_device *pdev) platform_set_drvdata(pdev, &exynos_dsi_display); + ret = mipi_dsi_host_register(&dsi->dsi_host); + if (ret) + goto err_del_component; + + dsi->panel = of_drm_find_panel(dsi->panel_node); + if (!dsi->panel) { + mipi_dsi_host_unregister(&dsi->dsi_host); + return -EPROBE_DEFER; + } + + drm_panel_attach(dsi->panel, &dsi->connector); + ret = component_add(&pdev->dev, &exynos_dsi_component_ops); if (ret) goto err_del_component; @@ -1515,6 +1511,10 @@ err_del_component: static int exynos_dsi_remove(struct platform_device *pdev) { + struct exynos_dsi *dsi = exynos_dsi_display.ctx; + + mipi_dsi_host_unregister(&dsi->dsi_host); + component_del(&pdev->dev, &exynos_dsi_component_ops); exynos_drm_component_del(&pdev->dev);