Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp5777574imm; Tue, 12 Jun 2018 13:10:51 -0700 (PDT) X-Google-Smtp-Source: ADUXVKK1/wXTO+8bJU3TkHRqlfMlSYwox+OI22NIJgiK9h8mtStHKhTmwkLB24FSLX1lo61tgIit X-Received: by 2002:a63:a356:: with SMTP id v22-v6mr1527540pgn.182.1528834251349; Tue, 12 Jun 2018 13:10:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528834251; cv=none; d=google.com; s=arc-20160816; b=vCRLzzARSHuFUZ9pNV6o6aH99Z8spdwH0MG40lEtBIyCkdpZPP9hvs8C+iT48IPHlN KVXPK4vF9bZRYvAnx82ZZtKF8AKjPDm/+n2Qj+JJIu2PqdOiT4XULiUTpZaXhKHtddb1 IQ1B3RRuNjXSKYfai97wDiW/jImshXmcv7oUC1xOe7baqeKKbPNydW+s++euSNl/2JNw XzjNl7LbnPr+ebhv/EjfApOjDx6sWV27hh/+7CdeMZUUTd9nolcwtLFTOmLAszM5u3Ot lDocZJWURtjTNSjThxBsqs0Qiil2NGGv+EjF+enin7C55tKGIMbpgI/dqejvWKeSKBtj 25nA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=ewuXkJXr/9olX86VLtPvFNTEIiXlp+VX546bTyuG2+8=; b=b0L0I0XoZXr+qjQ4uZZMJN+FJVhPjbOOIXM2s2jBWG2eCrIAXVaXMKrPXdyK87yu01 SVe6yaqxotOu7whfch+O9FMexwhayztyOTiq0t8qImgLTADh51gShAT0TaAwGWPHtXMo GQnywUJygowTLOWm4S7A7Bp1/DQPtRiA5EzkQ8IJyjOVVXK/rOvmf1FD4K7TNoRyHmTN chDQ7CW8LcLRe0OoMUoESO+ujKocxZcpP8F7L0Wsuav3M8z/k9tE2CwReFHaJTQdtBSA 6mUTJOvGloKLN9nRmYiO4pWRv5v04xMPLoJTxRJgWlYWdPOiSn21VHtbF3CcoTNfK4Xn WjSg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x14-v6si939997pll.37.2018.06.12.13.10.37; Tue, 12 Jun 2018 13:10:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934368AbeFLUIP (ORCPT + 99 others); Tue, 12 Jun 2018 16:08:15 -0400 Received: from mailoutvs14.siol.net ([185.57.226.205]:38432 "EHLO mail.siol.net" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933942AbeFLUCN (ORCPT ); Tue, 12 Jun 2018 16:02:13 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.siol.net (Zimbra) with ESMTP id 63242521F6A; Tue, 12 Jun 2018 22:02:11 +0200 (CEST) X-Virus-Scanned: amavisd-new at psrvmta12.zcs-production.pri Received: from mail.siol.net ([127.0.0.1]) by localhost (psrvmta12.zcs-production.pri [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id 9vKsOn2UTKfT; Tue, 12 Jun 2018 22:02:10 +0200 (CEST) Received: from mail.siol.net (localhost [127.0.0.1]) by mail.siol.net (Zimbra) with ESMTPS id BAD58521DC5; Tue, 12 Jun 2018 22:02:10 +0200 (CEST) Received: from localhost.localdomain (unknown [194.152.15.144]) (Authenticated sender: 031275009) by mail.siol.net (Zimbra) with ESMTPSA id 38F60522174; Tue, 12 Jun 2018 22:02:08 +0200 (CEST) From: Jernej Skrabec To: maxime.ripard@bootlin.com, wens@csie.org, robh+dt@kernel.org Cc: airlied@linux.ie, gustavo@padovan.org, maarten.lankhorst@linux.intel.com, seanpaul@chromium.org, mark.rutland@arm.com, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-sunxi@googlegroups.com Subject: [PATCH v2 09/27] drm/sun4i: Don't skip TCONs if they don't have channel 0 Date: Tue, 12 Jun 2018 22:00:18 +0200 Message-Id: <20180612200036.21483-10-jernej.skrabec@siol.net> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180612200036.21483-1-jernej.skrabec@siol.net> References: <20180612200036.21483-1-jernej.skrabec@siol.net> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org TV TCONs (channel 1 only) are always connected to TV or HDMI encoder. Because of that, all output endpoints on such TCON node will point to a encoder which is part of component framework. Correct current graph traversing algorithm in such way that it doesn't skip output enpoints with id 0 on TV TCONs. Signed-off-by: Jernej Skrabec --- drivers/gpu/drm/sun4i/sun4i_drv.c | 52 +++++++++++++++++++++---------- 1 file changed, 35 insertions(+), 17 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun4i_drv.c b/drivers/gpu/drm/sun4i/sun4i_drv.c index e6c62c079146..6ddf4eaccb40 100644 --- a/drivers/gpu/drm/sun4i/sun4i_drv.c +++ b/drivers/gpu/drm/sun4i/sun4i_drv.c @@ -198,6 +198,22 @@ static bool sun4i_drv_node_is_tcon(struct device_node *node) return !!of_match_node(sun4i_tcon_of_table, node); } +static bool sun4i_drv_node_is_tcon_with_ch0(struct device_node *node) +{ + const struct of_device_id *match; + + match = of_match_node(sun4i_tcon_of_table, node); + if (match) { + struct sun4i_tcon_quirks *quirks; + + quirks = (struct sun4i_tcon_quirks *)match->data; + + return quirks->has_channel_0; + } + + return false; +} + static bool sun4i_drv_node_is_tcon_top(struct device_node *node) { return !!of_match_node(sun8i_tcon_top_of_table, node); @@ -256,14 +272,7 @@ static void sun4i_drv_traverse_endpoints(struct endpoint_list *list, continue; } - /* - * If the node is our TCON, the first port is used for - * panel or bridges, and will not be part of the - * component framework. - */ if (sun4i_drv_node_is_tcon(node)) { - struct of_endpoint endpoint; - /* * TCON TOP is always probed before TCON. However, TCON * points back to TCON TOP when it is source for HDMI. @@ -276,16 +285,25 @@ static void sun4i_drv_traverse_endpoints(struct endpoint_list *list, continue; } - if (of_graph_parse_endpoint(ep, &endpoint)) { - DRM_DEBUG_DRIVER("Couldn't parse endpoint\n"); - of_node_put(remote); - continue; - } - - if (!endpoint.id) { - DRM_DEBUG_DRIVER("Endpoint is our panel... skipping\n"); - of_node_put(remote); - continue; + /* + * If the node is our TCON with channel 0, the first + * port is used for panel or bridges, and will not be + * part of the component framework. + */ + if (sun4i_drv_node_is_tcon_with_ch0(node)) { + struct of_endpoint endpoint; + + if (of_graph_parse_endpoint(ep, &endpoint)) { + DRM_DEBUG_DRIVER("Couldn't parse endpoint\n"); + of_node_put(remote); + continue; + } + + if (!endpoint.id) { + DRM_DEBUG_DRIVER("Endpoint is our panel... skipping\n"); + of_node_put(remote); + continue; + } } } -- 2.17.1