From patchwork Tue Apr 18 12:40:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Hajda X-Patchwork-Id: 9685477 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2810B602C9 for ; Tue, 18 Apr 2017 12:40:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1A24E2522B for ; Tue, 18 Apr 2017 12:40:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0F0312841C; Tue, 18 Apr 2017 12:40:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 99A3228400 for ; Tue, 18 Apr 2017 12:40:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753457AbdDRMkV (ORCPT ); Tue, 18 Apr 2017 08:40:21 -0400 Received: from mailout3.w1.samsung.com ([210.118.77.13]:46152 "EHLO mailout3.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752911AbdDRMkU (ORCPT ); Tue, 18 Apr 2017 08:40:20 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OOL00DS0V733490@mailout3.w1.samsung.com> for linux-samsung-soc@vger.kernel.org; Tue, 18 Apr 2017 13:40:15 +0100 (BST) Received: from eusmges5.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170418124014eucas1p1f822d556023990eb0fff204ea4102dad~2flFdAJsA2632826328eucas1p1x; Tue, 18 Apr 2017 12:40:14 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges5.samsung.com (EUCPMTA) with SMTP id 00.80.25577.E2906F85; Tue, 18 Apr 2017 13:40:14 +0100 (BST) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170418124013eucas1p1524b3f5028ca0d5b9d962ab17c557913~2flE0i6pw1502415024eucas1p1Z; Tue, 18 Apr 2017 12:40:13 +0000 (GMT) X-AuditID: cbfec7f5-f792f6d0000063e9-0e-58f6092ee4fb Received: from eusync1.samsung.com ( [203.254.199.211]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 73.E6.17452.EA906F85; Tue, 18 Apr 2017 13:42:22 +0100 (BST) Received: from AMDC2768.DIGITAL.local ([106.120.43.17]) by eusync1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OOL006UZV6ZTM40@eusync1.samsung.com>; Tue, 18 Apr 2017 13:40:13 +0100 (BST) From: Andrzej Hajda To: Inki Dae Cc: Andrzej Hajda , Bartlomiej Zolnierkiewicz , Marek Szyprowski , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH 5/7] drm/exynos/mic: use mode info stored in CRTC to detect i80 mode Date: Tue, 18 Apr 2017 14:40:01 +0200 Message-id: <1492519203-23537-6-git-send-email-a.hajda@samsung.com> X-Mailer: git-send-email 2.7.4 In-reply-to: <1492519203-23537-1-git-send-email-a.hajda@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrFIsWRmVeSWpSXmKPExsWy7djPc7p6nN8iDPr3c1ncWneO1WLjjPWs Fle+vmezmHR/AovFjPP7mCzWHrnL7sDmcb/7OJNH35ZVjB6fN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yhKr9rWzgxQxC1xhlGj/1gU2SlggTGJG7xtGEJtFQFWi/dwSVhCbV8BZ YsfiKUwQ6+Qkbp7rBBvKKeAi0XvuNFiNEFDN+jknGScw8i5gZFjFKJJaWpybnltsqFecmFtc mpeul5yfu4kRGK7bjv3cvIPx0sbgQ4wCHIxKPLwr9n2JEGJNLCuuzD3EKMHBrCTCu+7D1wgh 3pTEyqrUovz4otKc1OJDjKZAR01klhJNzgfGUl5JvKGJobmloZGxhYW5kZGSOG/JhyvhQgLp iSWp2ampBalFMH1MHJxSDYwi26OS9uwxq/ffcG92vvmTeTk9Dun5el4rK5itRfVm7JFafDNl 7aKMG/aXuOaEvsk03ldw+WO6ulpSw2dm/Qm3Wi7tKtpv9zL3TGfoP9VpnpO5n22tW/aGv1bk y0QFc7Oc5QYqvpbTXe8fXbHw0ukctalc3/w5jjzhL92/LbaRM4xvx9sTffxKLMUZiYZazEXF iQB/Q7/RbQIAAA== X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170418124013eucas1p1524b3f5028ca0d5b9d962ab17c557913 X-Msg-Generator: CA X-Sender-IP: 182.198.249.179 X-Local-Sender: =?UTF-8?B?QW5kcnplaiBIYWpkYRtTUlBPTC1LZXJuZWwgKFRQKRvsgrw=?= =?UTF-8?B?7ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?UTF-8?B?QW5kcnplaiBIYWpkYRtTUlBPTC1LZXJuZWwgKFRQKRtTYW1z?= =?UTF-8?B?dW5nIEVsZWN0cm9uaWNzG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Sender-Code: =?UTF-8?B?QzEwG0VIURtDMTBDRDAyQ0QwMjczOTI=?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170418124013eucas1p1524b3f5028ca0d5b9d962ab17c557913 X-RootMTR: 20170418124013eucas1p1524b3f5028ca0d5b9d962ab17c557913 References: <1492519203-23537-1-git-send-email-a.hajda@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP MIC driver should use info from CRTC to check mode of work instead of illegally peeking into nodes of other devices. Signed-off-by: Andrzej Hajda --- drivers/gpu/drm/exynos/exynos_drm_mic.c | 44 +++------------------------------ 1 file changed, 4 insertions(+), 40 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_mic.c b/drivers/gpu/drm/exynos/exynos_drm_mic.c index e457205..9f2fa8a 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_mic.c +++ b/drivers/gpu/drm/exynos/exynos_drm_mic.c @@ -21,9 +21,12 @@ #include #include #include +#include #include #include +#include + /* Sysreg registers for MIC */ #define DSD_CFG_MUX 0x1004 #define MIC0_RGB_MUX (1 << 0) @@ -85,12 +88,6 @@ #define MIC_BS_SIZE_2D(x) ((x) & 0x3fff) -enum { - ENDPOINT_DECON_NODE, - ENDPOINT_DSI_NODE, - NUM_ENDPOINTS -}; - static char *clk_names[] = { "pclk_mic0", "sclk_rgb_vclk_to_mic0" }; #define NUM_CLKS ARRAY_SIZE(clk_names) static DEFINE_MUTEX(mic_mutex); @@ -229,36 +226,6 @@ static void mic_set_reg_on(struct exynos_mic *mic, bool enable) writel(reg, mic->reg + MIC_OP); } -static int parse_dt(struct exynos_mic *mic) -{ - int ret = 0, i, j; - struct device_node *remote_node; - struct device_node *nodes[3]; - - /* - * The order of endpoints does matter. - * The first node must be for decon and the second one must be for dsi. - */ - for (i = 0, j = 0; i < NUM_ENDPOINTS; i++) { - remote_node = of_graph_get_remote_node(mic->dev->of_node, i, 0); - if (!remote_node) { - ret = -EPIPE; - goto exit; - } - nodes[j++] = remote_node; - - if (i == ENDPOINT_DECON_NODE && - of_get_child_by_name(remote_node, "i80-if-timings")) - mic->i80_mode = 1; - } - -exit: - while (--j > -1) - of_node_put(nodes[j]); - - return ret; -} - static void mic_disable(struct drm_bridge *bridge) { } static void mic_post_disable(struct drm_bridge *bridge) @@ -286,6 +253,7 @@ static void mic_mode_set(struct drm_bridge *bridge, mutex_lock(&mic_mutex); drm_display_mode_to_videomode(mode, &mic->vm); + mic->i80_mode = to_exynos_crtc(bridge->encoder->crtc)->i80_mode; mutex_unlock(&mic_mutex); } @@ -425,10 +393,6 @@ static int exynos_mic_probe(struct platform_device *pdev) mic->dev = dev; - ret = parse_dt(mic); - if (ret) - goto err; - ret = of_address_to_resource(dev->of_node, 0, &res); if (ret) { DRM_ERROR("mic: Failed to get mem region for MIC\n");