Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp5775324imm; Tue, 12 Jun 2018 13:08:34 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLreT7xqna8b770idHgC0EK35wld7aPggL4BFC5QATh551cFgTq5U1RY+2u23VJIGHg3+TW X-Received: by 2002:a17:902:422:: with SMTP id 31-v6mr1938428ple.320.1528834114251; Tue, 12 Jun 2018 13:08:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528834114; cv=none; d=google.com; s=arc-20160816; b=XGDn92v7RHI9qxjiLm2x7Pmkshdg3onf5Hd8kfPZvwnVZex7nC6UuLCLS6moW2xhlo 0YuuJ3tAQpkAlGDenV5eHRkZ0rsbPr+XMaCHC4MhZ+zF3F9YDPd+lg76R6CQZvqhstdn Wt5nZCHaoV0qOwNEppuXiCh45AAwADeFgyNZcqedzzWq6KpfYkaDhptYb1oN3dkvo33d 0641zC4z82j9Np5XJI0+Hj9TDlH/Gz+ddmhWHC52bU6+4gTKtdJA8HeDcljhUH7SXofd qy68Q1bS+YvsF+3bgvpHND+lJqv0xohAeeLJta4PU46ygTYZJGqhFCNFsyRCr8eV73Ia AL5A== 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=bJ6vtWg3ewE1TC88iPp4T9GmLau/p/xSUHHRSX8LyiE=; b=u3vgiWNrAEpEu/Qs5Rhd0z6Mic14yeZyUZzuk/A79LO4hXdkxmZHYWfaEvZ0US3WYi vZSkN3WOxhnQS2AXMA8VKcSta3oxldLb85vl4E1RWqTa/ZSSpBdp3q1r8svhd07LUUoH dt3XwrDfLGCASAfTeL19zHScHIdbRc1C70yJTYxH2SL8ieoTk1zJhr2By9be/iof74tu Ii+XoANssGTAj1tSqHFDXgtGDpEFd5jQeg0QG+NwmDB+7bd2XtY3xW4mJQYb+HGtCtT/ kRrRhpgvjYpYgVu1A09cyMoetIjWn4zWzPIENc21Zf8XKY2BI27paPIPT9T8SfgZuPyf cpjA== 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 w4-v6si843760plp.357.2018.06.12.13.08.20; Tue, 12 Jun 2018 13:08:34 -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 S934462AbeFLUGF (ORCPT + 99 others); Tue, 12 Jun 2018 16:06:05 -0400 Received: from mailoutvs20.siol.net ([185.57.226.211]:38540 "EHLO mail.siol.net" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933611AbeFLUCX (ORCPT ); Tue, 12 Jun 2018 16:02:23 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.siol.net (Zimbra) with ESMTP id 902995223A9; Tue, 12 Jun 2018 22:02:21 +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 uGDPSuxPoeDw; Tue, 12 Jun 2018 22:02:21 +0200 (CEST) Received: from mail.siol.net (localhost [127.0.0.1]) by mail.siol.net (Zimbra) with ESMTPS id EBA8B522232; Tue, 12 Jun 2018 22:02:20 +0200 (CEST) Received: from localhost.localdomain (unknown [194.152.15.144]) (Authenticated sender: 031275009) by mail.siol.net (Zimbra) with ESMTPSA id 6BC7352235D; Tue, 12 Jun 2018 22:02:18 +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 13/27] drm/sun4i: Don't check for LVDS and RGB when TCON has only ch1 Date: Tue, 12 Jun 2018 22:00:22 +0200 Message-Id: <20180612200036.21483-14-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 LVDS and RGB interfaces are always connected to TCONs which have channel 0. It doesn't make sense to try to init them on TV TCONs. Add a check if TCON has channel 0 before trying to init LVDS or RGB interface. Signed-off-by: Jernej Skrabec --- drivers/gpu/drm/sun4i/sun4i_tcon.c | 32 ++++++++++++++++-------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c index 5dae623968f7..b1205a7bc20f 100644 --- a/drivers/gpu/drm/sun4i/sun4i_tcon.c +++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c @@ -1117,23 +1117,25 @@ static int sun4i_tcon_bind(struct device *dev, struct device *master, goto err_free_dotclock; } - /* - * If we have an LVDS panel connected to the TCON, we should - * just probe the LVDS connector. Otherwise, just probe RGB as - * we used to. - */ - remote = of_graph_get_remote_node(dev->of_node, 1, 0); - if (of_device_is_compatible(remote, "panel-lvds")) - if (can_lvds) - ret = sun4i_lvds_init(drm, tcon); + if (tcon->quirks->has_channel_0) { + /* + * If we have an LVDS panel connected to the TCON, we should + * just probe the LVDS connector. Otherwise, just probe RGB as + * we used to. + */ + remote = of_graph_get_remote_node(dev->of_node, 1, 0); + if (of_device_is_compatible(remote, "panel-lvds")) + if (can_lvds) + ret = sun4i_lvds_init(drm, tcon); + else + ret = -EINVAL; else - ret = -EINVAL; - else - ret = sun4i_rgb_init(drm, tcon); - of_node_put(remote); + ret = sun4i_rgb_init(drm, tcon); + of_node_put(remote); - if (ret < 0) - goto err_free_dotclock; + if (ret < 0) + goto err_free_dotclock; + } if (tcon->quirks->needs_de_be_mux) { /* -- 2.17.1