From patchwork Thu Jan 5 13:24:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pin-yen Lin X-Patchwork-Id: 13089880 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0A0D6C3DA7A for ; Thu, 5 Jan 2023 13:25:43 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0727E10E725; Thu, 5 Jan 2023 13:25:42 +0000 (UTC) Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) by gabe.freedesktop.org (Postfix) with ESMTPS id EDDC410E725 for ; Thu, 5 Jan 2023 13:25:38 +0000 (UTC) Received: by mail-pj1-x102e.google.com with SMTP id j8-20020a17090a3e0800b00225fdd5007fso2012366pjc.2 for ; Thu, 05 Jan 2023 05:25:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=C65HbTqm4aoCrwDl2BLz1roa80SXzNKa5x0ufot4CrI=; b=EcSiBdYwt+3fFTqI3pD+Z1cWbfdlPdT1QRYJXeDcGanBNH+YzpSIj4FWtukHqzOYqu 2ozT6CU7PjO0z3oXwZ1RGBrtkJrX1qxyw3nEO/Gdr0dlaN/snPPv0OW2d8tedJ0FpcAw kxMlloNT946vDD52UbOffRvbe6M3ZkG/q5cIU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=C65HbTqm4aoCrwDl2BLz1roa80SXzNKa5x0ufot4CrI=; b=7dmD19zlAmcYTClfD4qJjVD0A9/Qk3Q8hK2Vwx+H9+/nb1keAo2ZLKb6BSX8EZrBQQ zETlNEiXzAcImB5OxUAE8pj8irvhT1K29ZloKpfZDo9vUBkX7jBii0nAOzeQoNaYltUD E5m7LqkVEfNXgoFukwIj7PFqmKAJkntZyEzxL0HYnzS9kZXj5YenHA3SNQE6UbWdjAAl ElZoIsiGQ8U4mOA4A0seHGrQrpPNeQ0Lp4CI+A+dYYl0X1d6JTTWjvWyhNm7WkZJqqTh z+DVbvcUIb0V7k5dxerEsPRvs1hA0qqN8qE0ZVbZm6hWYizaHUyqVLWq/QVJulfSw3SB X+fg== X-Gm-Message-State: AFqh2koxGI2JhfMiLnKKrJVBlO6s8M2HaIbz2nfxhjc3oZLsAFL9hm5I qXkswBMbGIxVwZ1x6yrEY0ijDA== X-Google-Smtp-Source: AMrXdXuwu1cZsCmcp/+3j0ERmkFrfCApL1/twQ/14n+uQtu92DgDzeoXL5AjjzzzYyfKtWC3hp69rQ== X-Received: by 2002:a17:90b:d98:b0:221:4cd7:3401 with SMTP id bg24-20020a17090b0d9800b002214cd73401mr54129230pjb.10.1672925138498; Thu, 05 Jan 2023 05:25:38 -0800 (PST) Received: from treapking.tpe.corp.google.com ([2401:fa00:1:10:7a61:eb85:2e3:2bd0]) by smtp.gmail.com with ESMTPSA id gk22-20020a17090b119600b00225e670e4c7sm1372682pjb.35.2023.01.05.05.25.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Jan 2023 05:25:38 -0800 (PST) From: Pin-yen Lin To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , David Airlie , Daniel Vetter , Rob Herring , Krzysztof Kozlowski , Andy Shevchenko , Daniel Scally , Heikki Krogerus , Sakari Ailus , Greg Kroah-Hartman , "Rafael J . Wysocki" , Prashant Malani , Benson Leung , Guenter Roeck Subject: [PATCH v7 5/9] drm/bridge: anx7625: Check for Type-C during panel registration Date: Thu, 5 Jan 2023 21:24:53 +0800 Message-Id: <20230105132457.4125372-6-treapking@chromium.org> X-Mailer: git-send-email 2.39.0.314.g84b9a713c41-goog In-Reply-To: <20230105132457.4125372-1-treapking@chromium.org> References: <20230105132457.4125372-1-treapking@chromium.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marek Vasut , chrome-platform@lists.linux.dev, =?utf-8?q?N=C3=ADcolas_F_=2E_R_=2E_A_=2E_Prado?= , Pin-yen Lin , Allen Chen , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Javier Martinez Canillas , linux-acpi@vger.kernel.org, devicetree@vger.kernel.org, Thomas Zimmermann , Hsin-Yi Wang , Stephen Boyd , Xin Ji , AngeloGioacchino Del Regno Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The output port endpoints can be connected to USB-C connectors. Running drm_of_find_panel_or_bridge() with such endpoints leads to a continuous return value of -EPROBE_DEFER, even though there is no panel present. To avoid this, check for the existence of a "mode-switch" property in the port endpoint, and skip panel registration completely if so. Signed-off-by: Pin-yen Lin --- (no changes since v6) Changes in v6: - New in v6 drivers/gpu/drm/bridge/analogix/anx7625.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c index b375887e655d..1cf242130b91 100644 --- a/drivers/gpu/drm/bridge/analogix/anx7625.c +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c @@ -1649,7 +1649,7 @@ static int anx7625_get_swing_setting(struct device *dev, static int anx7625_parse_dt(struct device *dev, struct anx7625_platform_data *pdata) { - struct device_node *np = dev->of_node, *ep0; + struct device_node *np = dev->of_node, *ep0, *sw; int bus_type, mipi_lanes; anx7625_get_swing_setting(dev, pdata); @@ -1688,6 +1688,17 @@ static int anx7625_parse_dt(struct device *dev, if (of_property_read_bool(np, "analogix,audio-enable")) pdata->audio_en = 1; + /* + * Don't bother finding a panel if a Type-C `mode-switch` property is + * present in one of the endpoints. + */ + for_each_endpoint_of_node(np, sw) { + if (of_property_read_bool(sw, "mode-switch")) { + of_node_put(sw); + return 0; + } + } + pdata->panel_bridge = devm_drm_of_get_bridge(dev, np, 1, 0); if (IS_ERR(pdata->panel_bridge)) { if (PTR_ERR(pdata->panel_bridge) == -ENODEV) {