Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp5896374rwl; Mon, 9 Jan 2023 01:03:22 -0800 (PST) X-Google-Smtp-Source: AMrXdXuv/itDRyM315aiOyD6gUsj6Dt8AAlv4yzvzGfjp4QpNNaK1Zni10341ETCPeWCeKhS69p1 X-Received: by 2002:a17:906:40c4:b0:7c1:ad6:7333 with SMTP id a4-20020a17090640c400b007c10ad67333mr53527482ejk.10.1673255002018; Mon, 09 Jan 2023 01:03:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673255002; cv=none; d=google.com; s=arc-20160816; b=0YDx1S6msavBSUwa60d+AZYp61dXzDzohPNnML2t5aLiJnizFqL6M35cZeIN+XyPHa 2ZDG1KjLG6NWwlVNuNHB1i5EC71utbqBFiZl3M1FnQ0v7ntS7+Axm3dh7VwK726cRyfg Ek5Nw5kQLcQoZx3Gei4P4Nx8vLEd1Rc07NaWxwDmHeRfLOvA1VSOoF7mxwogJR7GnXw6 fYxdouREILkBYFWqLlMg08fxB+N+RJFPb31Frhy9k9WAwC8kX3RKI4feYkJ7GhnXxW/m e8kY30tkmFvUL6tmace9BV/myk/eFDb+WyMWmdfa6DRaHNXahbryDNjX7HIBnOJPUVAT PQ0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=C65HbTqm4aoCrwDl2BLz1roa80SXzNKa5x0ufot4CrI=; b=FdA6NVLSu/HPwQl1lUPdPJNameLmF7JaCh1G/SqXVwd3OX2MySh5piAXjGiS0Ln3MB Jjvn8yoF1B+T5q4lpV/RQw8Hya/BmSVXrssFW/Ffp/4HnGLlMwgM/j4+1dS/XsAwEt1i 81nvB9KBXJBeg8rcyenT/i1HZjNlYZnF5Je/TS5tZN2EkXzWXko11sxvIH5uHPg33jXM bwrhh5fpR1VaQkhtzVFongwQ+n7zVS4l/HhUnMWiRn3RUm5E5yB2g4LPukhNudV528iG oAijWNvOkSCJP7wXmP4SzvgnTx+htI5MODnz0oayVxnJ0BHewpci3wb3H6Pgqt7+o6hA oZeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=kwl6+6yN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c15-20020a0564021f8f00b0048ecc09a43csi8597685edc.343.2023.01.09.01.03.09; Mon, 09 Jan 2023 01:03:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=kwl6+6yN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236849AbjAIImY (ORCPT + 54 others); Mon, 9 Jan 2023 03:42:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236618AbjAIIlm (ORCPT ); Mon, 9 Jan 2023 03:41:42 -0500 Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7441DBE00 for ; Mon, 9 Jan 2023 00:41:40 -0800 (PST) Received: by mail-pj1-x1032.google.com with SMTP id z4-20020a17090a170400b00226d331390cso8654640pjd.5 for ; Mon, 09 Jan 2023 00:41:40 -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=kwl6+6yNvmPlViyGA6MWyvEgFFpOn9l6Nlq4UwNmIoOAW/tQ1PUl3kldt28HENt/hv K8LSxwF+YxZ+5qLVbgwM7KPc0xLVNZotnK6YLa2G8XMn7DseLbTmvOAdJrBWIllrPZP8 P2bdx7qO8wYfxT4hoCXs/0pUlVRoM1vyLOEO8= 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=iM1GFitFo6iggjArJH5atQIcW5qZeuk3cEL1+jyyV9FozR4xcZwj+eBCKrd7ioCVjP 1Hf/+mSk6LOMxEw4LKYsUedehzl4zfq7FjKaTSnb1XuZ7MRMHd/8mcKrF2YVVSRPbPPk KhawPBEOeAkuP7733+wI3z8VmZmmPyww5w1ZOmbWUhrL/5pqpAahMsPQklG/aaL4hlxF w0QGTYBj60Ih9dBbGor7IA0We2GW+5INLGU8cLxR5tbbFE2MVpAzFAVvns/xWf5s4m1I UxgB5oJ9QVkUpHSyWTF/4AvXhew95ptyiYFingFnk4zBkOnIQerF9oxK8LkEQ5BHnxp/ o8mQ== X-Gm-Message-State: AFqh2kooWiaPhHf5WG3Ewr3Gas4H/RrlTpOZSSQetw8xcbSivWRVJ9dR DI3mjxkWgbzbeyM3Lj3lXN4JLw== X-Received: by 2002:a17:902:7c07:b0:193:bec:2122 with SMTP id x7-20020a1709027c0700b001930bec2122mr10562741pll.32.1673253700000; Mon, 09 Jan 2023 00:41:40 -0800 (PST) Received: from treapking.tpe.corp.google.com ([2401:fa00:1:10:801:a736:715:9a15]) by smtp.gmail.com with ESMTPSA id c14-20020a170902d48e00b00186acb14c4asm5568119plg.67.2023.01.09.00.41.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Jan 2023 00:41:39 -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 Cc: Hsin-Yi Wang , Pin-yen Lin , dri-devel@lists.freedesktop.org, Marek Vasut , Stephen Boyd , AngeloGioacchino Del Regno , Xin Ji , linux-acpi@vger.kernel.org, devicetree@vger.kernel.org, chrome-platform@lists.linux.dev, Thomas Zimmermann , Allen Chen , Javier Martinez Canillas , Lyude Paul , =?UTF-8?q?N=C3=ADcolas=20F=20=2E=20R=20=2E=20A=20=2E=20Prado?= , linux-kernel@vger.kernel.org Subject: [PATCH v9 5/9] drm/bridge: anx7625: Check for Type-C during panel registration Date: Mon, 9 Jan 2023 16:40:57 +0800 Message-Id: <20230109084101.265664-6-treapking@chromium.org> X-Mailer: git-send-email 2.39.0.314.g84b9a713c41-goog In-Reply-To: <20230109084101.265664-1-treapking@chromium.org> References: <20230109084101.265664-1-treapking@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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) { -- 2.39.0.314.g84b9a713c41-goog