From patchwork Thu Nov 24 10:20:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pin-yen Lin X-Patchwork-Id: 25434 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp3305920wrr; Thu, 24 Nov 2022 02:24:22 -0800 (PST) X-Google-Smtp-Source: AA0mqf7eERm3+YB6PHWNLdbMR0/m1zeaHMunKa4288zSjtEqyOv6LXJL9iB9/37znsL9ZDYbDvpr X-Received: by 2002:a05:6402:4011:b0:461:96ba:b9c with SMTP id d17-20020a056402401100b0046196ba0b9cmr29821855eda.353.1669285462233; Thu, 24 Nov 2022 02:24:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669285462; cv=none; d=google.com; s=arc-20160816; b=ZhyAcrvjyiU1/Ig7RyrCM0vch3Af7FTkduF8CdHWSVEZrQU4iRO1AECkI6shhbXNA7 GhJy/JtINsJreZ7yGulKb34anf5F6XEQeBG+VjslhAaz23mJhaNpd97X/w3Cn3ge7c2P A2HhGtkeUYK9HeWVA4pCGmQEhkEJ8TIJQYKMFjtPntiO0PtWO9pFI+u1rBy5Zdh8igRr 8ppAjCI/FZUDL7u5222Tptpswuyw8RIwEnlajqBdiWavGtoWLRZyQAh8l33jpb/F1BLf EX+UCeHdC4ZKXUpze0No0Jx8QLX+fpyybIOymVlWf2ZRAYmwEcu1kHWChI+f1m/8pzV1 kYLw== 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=xSARwn2UnE9YTFUF2W3+HZEu0BpMDJn1tvX56Vn2aEc=; b=X+9K3AVm2Q2+afZklU1t67y+hkROJ23L4GTIO3TkgpdLoZWci7Tq9WT3zOMg+SvjkU RDbwFs4A3aZQcUS4MZGqWg8Wo//L+hyS+SCDHBOCSfFfQogevkOrv6VWKL2ot4gejEDs q9IkbNZvjXLsL69Zl7Exb1A5Jp5oIfh9b3by3Jw84RhlFUucPBD7kaUnmB1Dp0iMG7VA Im66pdSm2nwAUyxkQa9Mj6Fpn00UbTPGpSFxS9Ap6shpKJ6/HEN0kmWC0siXT0wF/nGK Hm2PM7FdZAyEz3wNlBfkZpjpCAC/ilPxbT8yK70lp9dHXGPqPmloV0TT9oGHkG8xaDsG +McA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Ug9Id50c; 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 ji10-20020a170907980a00b007b5ce4a436esi699317ejc.513.2022.11.24.02.23.59; Thu, 24 Nov 2022 02:24:22 -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=Ug9Id50c; 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 S229730AbiKXKWL (ORCPT + 99 others); Thu, 24 Nov 2022 05:22:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229837AbiKXKVe (ORCPT ); Thu, 24 Nov 2022 05:21:34 -0500 Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com [IPv6:2607:f8b0:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6CD0614E6D9 for ; Thu, 24 Nov 2022 02:21:33 -0800 (PST) Received: by mail-pf1-x42a.google.com with SMTP id a16so854122pfg.4 for ; Thu, 24 Nov 2022 02:21:33 -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=xSARwn2UnE9YTFUF2W3+HZEu0BpMDJn1tvX56Vn2aEc=; b=Ug9Id50cct6zOXOQoNNjH9g7+k3Y+GPROT/0at83jSeiIUZNvMxLUnWXIfKhQWwCqD BvLcx+EY9+QMbGcQ5JRGAFFNl5qvTOXxO0htrR5T7HhUAP4Z9WIyIPI3a2F/bEF3byyF wVpCmNKlejLHByIQdI99O8XbYNYoezW4RvB7U= 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=xSARwn2UnE9YTFUF2W3+HZEu0BpMDJn1tvX56Vn2aEc=; b=uAbGqOCDK9GWvG5LDy7elZWy2K2XNUSI0/PxxBdzxE53yPkQImo4omK9buTX9MED3M MgEwf0dcSCx85VMI/0WaaisZYBldfTazni+S5+itc7n7+8HJ9is+gnPUfrM+OLRpgS+f 6tPaNQA61D2c45la3E9A7fuB6smX6+5eAVTF++LLI6rQJooA/efT605ncFR15Mikp2kU KEl1Klbwx5QCr9ozd9WiVzUMgb7PLnLrDCitDDRCTWIh7C0s7Z/ECU/wcj6iisFLZFf9 sR0pcZOsw/MmFQDB+BuSFL01aG0huLbmCvnHh8yjpN+V4Oq0SMTW+sj8eT8IWpGHvxqE tvjA== X-Gm-Message-State: ANoB5pkW3YdvP2kmtgwKg2OsF2zN9MJMXtjVWaKORa76wvuJSovJ3mpE Qh67mbSXLVEB9CgXbcFhjJ6X9g== X-Received: by 2002:a05:6a00:80f:b0:571:8794:e845 with SMTP id m15-20020a056a00080f00b005718794e845mr15217721pfk.18.1669285292953; Thu, 24 Nov 2022 02:21:32 -0800 (PST) Received: from treapking.tpe.corp.google.com ([2401:fa00:1:10:d446:708:8556:dfee]) by smtp.gmail.com with ESMTPSA id t123-20020a625f81000000b005747b59fc54sm854584pfb.172.2022.11.24.02.21.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Nov 2022 02:21:32 -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: Javier Martinez Canillas , Stephen Boyd , dri-devel@lists.freedesktop.org, Hsin-Yi Wang , Thomas Zimmermann , devicetree@vger.kernel.org, Pin-yen Lin , chrome-platform@lists.linux.dev, linux-acpi@vger.kernel.org, Marek Vasut , Xin Ji , Lyude Paul , =?utf-8?q?N=C3=ADcolas_F_=2E_R_=2E_A_=2E_Pra?= =?utf-8?q?do?= , AngeloGioacchino Del Regno , linux-kernel@vger.kernel.org, Allen Chen Subject: [PATCH v6 4/7] drm/bridge: anx7625: Check for Type-C during panel registration Date: Thu, 24 Nov 2022 18:20:53 +0800 Message-Id: <20221124102056.393220-5-treapking@chromium.org> X-Mailer: git-send-email 2.38.1.584.g0f3c55d4c2-goog In-Reply-To: <20221124102056.393220-1-treapking@chromium.org> References: <20221124102056.393220-1-treapking@chromium.org> MIME-Version: 1.0 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750372672680422547?= X-GMAIL-MSGID: =?utf-8?q?1750372672680422547?= 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 --- 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 b0ff1ecb80a5..b9e3d6ad8846 100644 --- a/drivers/gpu/drm/bridge/analogix/anx7625.c +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c @@ -1650,7 +1650,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); @@ -1689,6 +1689,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) {