Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp8947389ybi; Tue, 23 Jul 2019 18:40:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqwVnJd6Ovm7Vt00+mHdLLdy/5XLLZVKBc41mzeBisFKRKVQcXaCJ3abFO2X5qbgrrVuY3T8 X-Received: by 2002:a17:902:f81:: with SMTP id 1mr82379802plz.191.1563932426737; Tue, 23 Jul 2019 18:40:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563932426; cv=none; d=google.com; s=arc-20160816; b=rjRrCcv9SPaKkNTuzEwYAQTaOBGGfAeTT/Z1AHEWWXEfZXFxgLgoXm0f7qjjc6U9H3 WhW8/WHG/uwQKQ9aXv/9wkA/zuS3pEmVdaSx/TPmxiCXU6DjTzvKLjT3u/MtYsGCym5J 8RvK1uQgf+T6p5byyegje6tCjJQMNqotWGzTiJLrmgnOmqzkZE8xFufDav9XD6emGKEX ZBF7I5okw4BDtCZOvAsTp3ATzQXk9jFBOKxeyEyP3DNh0AeEMwSDs8Mo6f7Y7gpaSq1A KuKXQJm9yLpni2U1u/5sAsh5LF9qWpq5tFF2BW50G6H+Ex5pikAgoOAoZfKhh4FhaQmB Q3/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=celJFZ3X+7OjxD8dTqtklUlMCjhNd8dyQ71b/aTLRfE=; b=XpOYk11CdmXpX3K41vOYCSxso9A6sd0Y2q4P+GPKLpA3dl182NR4oXANIMIPMpJctu 4+Zb3myefqT6IInKuaZdv3ZBLhrppLJHjBUmFy0odxA5q07piuAFk11YEzPKYQs2iFhx /KTC8KBdFSPEBwwmWV/iIK/QEiZlPsLCSa+pvnLhRL5cejdkYjhhxBrg0TSnDuzxC/Ja hhpf5ZNyTL+AM38hPcTrxoDGJEV/Ms8vP04zAat/CUJ2nJbYVyC31l0zG1L6jo/t+sZP yYTGLRBAdbOb7Y9TV7LucTnxlBYcu8h1yGZfjeFd1D083z5MreaNaDN7l1W/deR8A/Mi Kw4w== 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 r185si12305411pgr.506.2019.07.23.18.40.11; Tue, 23 Jul 2019 18:40:26 -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 S2390919AbfGWQzz (ORCPT + 99 others); Tue, 23 Jul 2019 12:55:55 -0400 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:54927 "EHLO relay2-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390765AbfGWQzy (ORCPT ); Tue, 23 Jul 2019 12:55:54 -0400 X-Originating-IP: 2.224.242.101 Received: from uno.lan (2-224-242-101.ip172.fastwebnet.it [2.224.242.101]) (Authenticated sender: jacopo@jmondi.org) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id 7A35E40005; Tue, 23 Jul 2019 16:55:49 +0000 (UTC) From: Jacopo Mondi To: Laurent Pinchart , Kieran Bingham , David Airlie , Daniel Vetter , fabrizio.castro@bp.renesas.com Cc: Jacopo Mondi , dri-devel@lists.freedesktop.org (open list:DRM DRIVERS FOR RENESAS), linux-renesas-soc@vger.kernel.org (open list:DRM DRIVERS FOR RENESAS), linux-kernel@vger.kernel.org (open list) Subject: [PATCH] drm: rcar_lvds: Fix dual link mode operations Date: Tue, 23 Jul 2019 18:57:00 +0200 Message-Id: <20190723165700.13124-1-jacopo+renesas@jmondi.org> X-Mailer: git-send-email 2.22.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The R-Car LVDS encoder units support dual-link operations by splitting the pixel output between the primary encoder and the companion one. In order for the primary encoder to succesfully control the companion's operations this should not fail at probe time and register itself its associated drm bridge so that the primary one can find it. Currently the companion encoder fails at probe time, causing the registration of the primary to fail preventing the whole DU unit to be registered correctly. Fixes: fa440d870358 ("drm: rcar-du: lvds: Add support for dual-link mode") Reported-by: Fabrizio Castro Signed-off-by: Jacopo Mondi --- The "Fixes" tag refers to a patch currently part of the renesas-drivers-2019-07-09-v5.2 branch of Geert's renesas-drivers tree. drivers/gpu/drm/rcar-du/rcar_lvds.c | 31 +++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/rcar-du/rcar_lvds.c b/drivers/gpu/drm/rcar-du/rcar_lvds.c index bada7ee98544..8b015ba95895 100644 --- a/drivers/gpu/drm/rcar-du/rcar_lvds.c +++ b/drivers/gpu/drm/rcar-du/rcar_lvds.c @@ -767,14 +767,29 @@ static int rcar_lvds_parse_dt(struct rcar_lvds *lvds) of_node_put(remote_input); of_node_put(remote); - /* - * On D3/E3 the LVDS encoder provides a clock to the DU, which can be - * used for the DPAD output even when the LVDS output is not connected. - * Don't fail probe in that case as the DU will need the bridge to - * control the clock. - */ - if (lvds->info->quirks & RCAR_LVDS_QUIRK_EXT_PLL) - return ret == -ENODEV ? 0 : ret; + switch (ret) { + case -ENODEV: + /* + * On D3/E3 the LVDS encoder provides a clock to the DU, which + * can be used for the DPAD output even when the LVDS output is + * not connected. Don't fail probe in that case as the DU will + * need the bridge to control the clock. + */ + if (lvds->info->quirks & RCAR_LVDS_QUIRK_EXT_PLL) + ret = 0; + break; + case -ENXIO: + /* + * When the LVDS output is used in dual link mode, the + * companion encoder fails at + * 'rcar_lvds_parse_dt_companion()'. Don't fail probe in + * that case as the master encoder will need the companion's + * bridge to control its operations. + */ + if (lvds->info->quirks & RCAR_LVDS_QUIRK_DUAL_LINK) + ret = 0; + break; + } return ret; } -- 2.22.0