Message ID | 20230331091145.737305-6-treapking@chromium.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp437144vqo; Fri, 31 Mar 2023 02:43:51 -0700 (PDT) X-Google-Smtp-Source: AKy350a1a1dmJDmTEeRfdfQfk/dcIzvxB1hrkjwLjFueFfTvsrxhj4paZDYZaTFH8OX7pNXvmuyv X-Received: by 2002:a17:907:a64a:b0:92e:e9c2:7b9c with SMTP id vu10-20020a170907a64a00b0092ee9c27b9cmr27276092ejc.77.1680255831047; Fri, 31 Mar 2023 02:43:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680255831; cv=none; d=google.com; s=arc-20160816; b=qNPFtK30W1umSjblYxicze5XKmdHynInKE8mSuhzrvLbNhQ7NbHXEA40fByNDNX4OS x1hdy5oqUhFgifxvfb6/iUDFR74GYjSnOqpZTYCKGZzjRfy8iwyjE8Nj1WJxXGytUfB0 TLOk0w7/BSjmNVQM7pLS/E01nGe6HqYFlW3Z18PxxOvontIrQ/geUt+A2usmUbMaPnET iswjAzI4xsBf7kp01bOdn1O9nzuKEMSpzjdl7nTR2PDq8CleBLu0IxGz4VGjzbNMSOB7 YE6a1/INZm5QtBFSEXnOTq1z78ExAoCaUT9kAtxmwDv5gzrQHeyvuGs8ciGbFlkNugc/ B4GA== 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=um8Apq5PS0w4vw2h+FoHStjqhneujAsh8s3PG+yoPJU=; b=p4jgwKyT3oX/tr/FNoAGdVD3D9vhLChDdcCr/y/nu0mnooSQmSPmZbMQdLbI/o6vBQ Gn/188f3Lp0v7vDDYPmXHkyfx23klwKFSAAnYDZDt9StEvDvw4yPMa8oWSgxFGpTH/7p VqzBOl6qjfubvNGRMLZvxHTDSSKdoCShGKOdG/OKvX7Q4/VZZppUIk6RxceK6vfkhyIo vNLyUATTnOZJF2379QkEULhQnfZU0kLcJT1oxRtXEXx4LiMx8ma16LadzXCHJVVE9t3B XFzUQEuuwwROtCFITOYlOLIa4CgXc1feUjM+j/jBhiqlXooPBMDBfAELcx3IkI1xWvab l6BA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=X1MYjT+7; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mh12-20020a170906eb8c00b009321d63a17asi1609416ejb.1004.2023.03.31.02.43.27; Fri, 31 Mar 2023 02:43:51 -0700 (PDT) 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=X1MYjT+7; 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 S232109AbjCaJNI (ORCPT <rfc822;jimliu8233@gmail.com> + 99 others); Fri, 31 Mar 2023 05:13:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231824AbjCaJMg (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 31 Mar 2023 05:12:36 -0400 Received: from mail-pg1-x52b.google.com (mail-pg1-x52b.google.com [IPv6:2607:f8b0:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A9B3E1EFDF for <linux-kernel@vger.kernel.org>; Fri, 31 Mar 2023 02:12:24 -0700 (PDT) Received: by mail-pg1-x52b.google.com with SMTP id y35so13019153pgl.4 for <linux-kernel@vger.kernel.org>; Fri, 31 Mar 2023 02:12:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1680253944; 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=um8Apq5PS0w4vw2h+FoHStjqhneujAsh8s3PG+yoPJU=; b=X1MYjT+7uhS5MGdPK2Wj21iPoxh6eqxnteUDlhMJL0p+MXbIB6g+hfbiNjTNfhPnr7 hqaiMqZhpSYhOlbEiai15gKbDMOYTs5oJdD4V1D9AliUdodPPnSMSgm2y8GezXmPsHVO +b4An7P8iElbXJAUopLDhV2CwpckTAmg+4fJA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680253944; 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=um8Apq5PS0w4vw2h+FoHStjqhneujAsh8s3PG+yoPJU=; b=iIUOthMQh4CS3Sxv1vBbX2X29i4R3KBxQVNugtzT/QNxNVoW+NG3F5HNkGgnpco4GO CgL5c1tyzfjCl/rIxNCVFm3i9NhD2+HH3TaAo+td8ipb0CFjoyrYlD4XkdwRbyaD7dbF gWo40ENLecJBS/PERkxoKWkrpFjiiB89nYoYCOHtdPZx4alcEz3QGC3+wy5SXzSepLLO aW9uZyEUHaeWG0oz8sVsddbNCdjkDuu2F/mE7PFmExQWQtpzr9BZ0BDVy0dTdOQOArjP D+uYbju4Rv1zaJnRnhf9R2PQ2lVxZZMI+FaseZ3P1dZ5kLqZFFdXUQZH3bvVeCv+DtST QOyw== X-Gm-Message-State: AAQBX9fvAY7QkV3RYlBOxropcvCegpIAOlBh1IMRefgGyfBIRCXIQuTb bDjnZVjugt/nvpHulZAAwykcsA== X-Received: by 2002:a62:4e8f:0:b0:625:cf6d:b260 with SMTP id c137-20020a624e8f000000b00625cf6db260mr25068880pfb.6.1680253943821; Fri, 31 Mar 2023 02:12:23 -0700 (PDT) Received: from treapking.tpe.corp.google.com ([2401:fa00:1:10:ae9d:db7a:8a71:d458]) by smtp.gmail.com with ESMTPSA id n6-20020a62e506000000b006227c3d5e29sm1360905pff.16.2023.03.31.02.12.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Mar 2023 02:12:23 -0700 (PDT) From: Pin-yen Lin <treapking@chromium.org> To: Andrzej Hajda <andrzej.hajda@intel.com>, Neil Armstrong <neil.armstrong@linaro.org>, Robert Foss <rfoss@kernel.org>, Laurent Pinchart <Laurent.pinchart@ideasonboard.com>, Jonas Karlman <jonas@kwiboo.se>, Jernej Skrabec <jernej.skrabec@gmail.com>, David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Andy Shevchenko <andriy.shevchenko@linux.intel.com>, Daniel Scally <djrscally@gmail.com>, Heikki Krogerus <heikki.krogerus@linux.intel.com>, Sakari Ailus <sakari.ailus@linux.intel.com>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, "Rafael J . Wysocki" <rafael@kernel.org>, Prashant Malani <pmalani@chromium.org>, Benson Leung <bleung@chromium.org>, Guenter Roeck <groeck@chromium.org> Cc: Xin Ji <xji@analogixsemi.com>, Marek Vasut <marex@denx.de>, Hsin-Yi Wang <hsinyi@chromium.org>, Thomas Zimmermann <tzimmermann@suse.de>, AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>, Lyude Paul <lyude@redhat.com>, devicetree@vger.kernel.org, Stephen Boyd <swboyd@chromium.org>, dri-devel@lists.freedesktop.org, linux-acpi@vger.kernel.org, chrome-platform@lists.linux.dev, =?utf-8?q?N?= =?utf-8?q?=C3=ADcolas_F_=2E_R_=2E_A_=2E_Prado?= <nfraprado@collabora.com>, Javier Martinez Canillas <javierm@redhat.com>, Pin-yen Lin <treapking@chromium.org>, linux-kernel@vger.kernel.org, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de> Subject: [PATCH v15 05/10] drm/bridge: anx7625: Check for Type-C during panel registration Date: Fri, 31 Mar 2023 17:11:40 +0800 Message-Id: <20230331091145.737305-6-treapking@chromium.org> X-Mailer: git-send-email 2.40.0.348.gf938b09366-goog In-Reply-To: <20230331091145.737305-1-treapking@chromium.org> References: <20230331091145.737305-1-treapking@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.2 required=5.0 tests=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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761875938236948643?= X-GMAIL-MSGID: =?utf-8?q?1761875938236948643?= |
Series |
Register Type-C mode-switch in DP bridge endpoints
|
|
Commit Message
Pin-yen Lin
March 31, 2023, 9:11 a.m. UTC
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 <treapking@chromium.org> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> --- Changes in v15: - Collect review tag Changes in v14: - Collect review tag Changes in v13: - Use the new typec_mode_switch_node_count helper Changes in v12: - Updated to use fwnode_for_each_typec_mode_switch macro - Dropped collected tags Changes in v10: - Collected Reviewed-by and Tested-by tags Changes in v6: - New in v6 drivers/gpu/drm/bridge/analogix/anx7625.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c index 6846199a2ee1..3f6bf7674d32 100644 --- a/drivers/gpu/drm/bridge/analogix/anx7625.c +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c @@ -1648,7 +1648,8 @@ 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, *port_node; + unsigned int count; int bus_type, mipi_lanes; anx7625_get_swing_setting(dev, pdata); @@ -1687,6 +1688,15 @@ 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 in the output port. + */ + port_node = of_graph_get_port_by_id(np, 1); + count = typec_mode_switch_node_count(&port_node->fwnode); + if (count) + 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) {