From patchwork Fri May 9 08:51:50 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inki Dae X-Patchwork-Id: 4140921 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 B0ACB9F387 for ; Fri, 9 May 2014 08:51:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EBC9E200DF for ; Fri, 9 May 2014 08:51:54 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id E0570200CC for ; Fri, 9 May 2014 08:51:53 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3D75A6EF5C; Fri, 9 May 2014 01:51:53 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout2.samsung.com (mailout2.samsung.com [203.254.224.25]) by gabe.freedesktop.org (Postfix) with ESMTP id 419D86EF5C for ; Fri, 9 May 2014 01:51:52 -0700 (PDT) Received: from epcpsbgr1.samsung.com (u141.gpu120.samsung.co.kr [203.254.230.141]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N5A00E1PTYFHC10@mailout2.samsung.com> for dri-devel@lists.freedesktop.org; Fri, 09 May 2014 17:51:51 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.115]) by epcpsbgr1.samsung.com (EPCPMTA) with SMTP id 1B.70.18501.6279C635; Fri, 09 May 2014 17:51:51 +0900 (KST) X-AuditID: cbfee68d-b7f4e6d000004845-12-536c9726285f Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 69.A4.27725.6279C635; Fri, 09 May 2014 17:51:50 +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 <0N5A00GO7TYEB1H0@mmp1.samsung.com>; Fri, 09 May 2014 17:51:50 +0900 (KST) From: Inki Dae To: airlied@linux.ie, dri-devel@lists.freedesktop.org Subject: [PATCH] drm/exynos: hdmi: consider legacy dt binding Date: Fri, 09 May 2014 17:51:50 +0900 Message-id: <1399625510-12349-1-git-send-email-inki.dae@samsung.com> X-Mailer: git-send-email 1.7.9.5 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrALMWRmVeSWpSXmKPExsWyRsSkWFd9ek6wwdXnTBa9504yWVz5+p7N YtL9CSwOzB7bvz1g9bjffZzJo2/LKsYA5igum5TUnMyy1CJ9uwSujCU35zIW/BGq+NjRwdLA eIG/i5GTQ0LAROLqu10sELaYxIV769m6GLk4hASWMkq8f/uZFaZo36lbzCC2kMAiRol9GyQh irqZJNa/uMoIkmATUJWYuOI+G4gtImAq0TFpKdhUZgFliYv9S8GahQVsJbZc2QI2lAWoftXB 0+wgNq+Ai8SMKd1ANRxAyxQk5kyyAZkvIXCbTeJmy31GiHoBiW+TD7FA1MhKbDrADHGbpMTB FTdYJjAKLmBkWMUomlqQXFCclF5kqFecmFtcmpeul5yfu4kRGHqn/z3r3cF4+4D1IcZkoHET maVEk/OBoZtXEm9obGZkYWpiamxkbmlGmrCSOG/Sw6QgIYH0xJLU7NTUgtSi+KLSnNTiQ4xM HJxSDYz8Ai7VawV/Bh88nJpT8+no4bn7c9+Xi7ay6knc07vK8+SRxAPhLYZuBdOTfLR9k55v /ORerGsVLjph+xTJQl6rPXffmjLpL2o8xnSk71TvzlDJexaTM69NPfO/9fGEz3aLLuV0B6b/ OzhB58QJXrWLxZLfdD74MjGEtCd/b/n5KLxQ0m521CclluKMREMt5qLiRAAShEK+UwIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprLIsWRmVeSWpSXmKPExsVy+t9jAV216TnBBhsOWVj0njvJZHHl63s2 i0n3J7A4MHts//aA1eN+93Emj74tqxgDmKMaGG0yUhNTUosUUvOS81My89JtlbyD453jTc0M DHUNLS3MlRTyEnNTbZVcfAJ03TJzgFYpKZQl5pQChQISi4uV9O0wTQgNcdO1gGmM0PUNCYLr MTJAAwlrGDOW3JzLWPBHqOJjRwdLA+MF/i5GTg4JAROJfaduMUPYYhIX7q1nA7GFBBYxSuzb INnFyAVkdzNJrH9xlREkwSagKjFxxX2wIhEBU4mOSUtZQGxmAWWJi/1LwQYJC9hKbLmyhRXE ZgGqX3XwNDuIzSvgIjFjSjdQDQfQMgWJOZNsJjByL2BkWMUomlqQXFCclJ5rqFecmFtcmpeu l5yfu4kRHNjPpHYwrmywOMQowMGoxMP7Ykp2sBBrYllxZe4hRgkOZiURXuUpOcFCvCmJlVWp RfnxRaU5qcWHGJOBlk9klhJNzgdGXV5JvKGxiZmRpZG5oYWRsTlpwkrivAdarQOFBNITS1Kz U1MLUotgtjBxcEo1MKpUX3PJcGKcEVd+avv3Y53X4hg+//t9YDen7t8GkZvnsxJ2vzsdGdHz /VTrnxXKq73+u0vcU1Jqn9UW+1proqBK566udYf048pfxs2KmdWTfXJzIhsP6/Ud5+cXijuZ X9a4end/rlHMjj69afPTnhur79IOubVa4UDOcsUbZe9KtC2bNu3mUlRiKc5INNRiLipOBAC6 e+o6sAIAAA== DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected 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.8 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 This patch considers legacy dt binding, and resolves the issue that the use of existing dtb is broken. To resove the dt broken issue, this path tries to get legacy dt nodes from existing dtb directly prior to getting new dt nodes. Signed-off-by: Inki Dae Acked-by: Kyungmin Park --- drivers/gpu/drm/exynos/exynos_hdmi.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c index 6acc1e3..a8bac62 100644 --- a/drivers/gpu/drm/exynos/exynos_hdmi.c +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c @@ -2240,6 +2240,25 @@ static const struct component_ops hdmi_component_ops = { .unbind = hdmi_unbind, }; +static struct device_node *hdmi_legacy_ddc_dt_binding(struct device *dev) +{ + const char *compatible_str = "samsung,exynos4210-hdmiddc"; + struct device_node *np; + + np = of_find_compatible_node(NULL, NULL, compatible_str); + if (np) + return of_get_next_parent(np); + + return NULL; +} + +static struct device_node *hdmi_legacy_phy_dt_binding(struct device *dev) +{ + const char *compatible_str = "samsung,exynos4212-hdmiphy"; + + return of_find_compatible_node(NULL, NULL, compatible_str); +} + static int hdmi_probe(struct platform_device *pdev) { struct device_node *ddc_node, *phy_node; @@ -2295,18 +2314,28 @@ static int hdmi_probe(struct platform_device *pdev) return ret; } + ddc_node = hdmi_legacy_ddc_dt_binding(dev); + if (ddc_node) + goto out_get_ddc_adpt; + /* DDC i2c driver */ ddc_node = of_parse_phandle(dev->of_node, "ddc", 0); if (!ddc_node) { DRM_ERROR("Failed to find ddc node in device tree\n"); return -ENODEV; } + +out_get_ddc_adpt: hdata->ddc_adpt = of_find_i2c_adapter_by_node(ddc_node); if (!hdata->ddc_adpt) { DRM_ERROR("Failed to get ddc i2c adapter by node\n"); return -ENODEV; } + phy_node = hdmi_legacy_phy_dt_binding(dev); + if (phy_node) + goto out_get_phy_port; + /* hdmiphy i2c driver */ phy_node = of_parse_phandle(dev->of_node, "phy", 0); if (!phy_node) { @@ -2315,6 +2344,7 @@ static int hdmi_probe(struct platform_device *pdev) goto err_ddc; } +out_get_phy_port: if (drv_data->is_apb_phy) { hdata->regs_hdmiphy = of_iomap(phy_node, 0); if (!hdata->regs_hdmiphy) {