From mboxrd@z Thu Jan 1 00:00:00 1970 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 06F9AC6379F for ; Tue, 21 Feb 2023 11:51:09 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2CC2610E3A3; Tue, 21 Feb 2023 11:51:08 +0000 (UTC) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0377710E3A3 for ; Tue, 21 Feb 2023 11:51:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1676980265; x=1708516265; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=dA0UV9DVYzws8NY0piO2Q7OcBlhHBKKb6Y0abZOE/X0=; b=dEy9Cg8p1UAZJgIcv4X7J2Czpv3kJMUe9M0XL66zfRsWD4OQ6+MUHUz9 8TzJqkBwc0U1m4d6/1orcx6TgQeR/SLzJVv981iTdqpr0e+tAhLFh8Ymw oHa0mjdKATGwfMJiwsGOQMN8YQI+2jKn1TkKoZLP9O9ICGtDiUahD9FUN 2FRG1virPz6fLwiCUeWds345GtnQnzJAmp68LNAXJOLRoJl9EK/StMc5L SbSjaLtOgXO8gwpCIRJHraa6EU1bFr37KMzAm4gGGXFeP3hrGM2UubHl4 pOcyRDQMs9yUo93Wet0nxDu6CuoioKzDBEOsx0HwTRcTHJZUcUOJK69ly g==; X-IronPort-AV: E=McAfee;i="6500,9779,10627"; a="395092760" X-IronPort-AV: E=Sophos;i="5.97,315,1669104000"; d="scan'208";a="395092760" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Feb 2023 03:51:05 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10627"; a="740377282" X-IronPort-AV: E=Sophos;i="5.97,315,1669104000"; d="scan'208";a="740377282" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga004.fm.intel.com with ESMTP; 21 Feb 2023 03:50:57 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1pURAb-009wL4-2S; Tue, 21 Feb 2023 13:50:53 +0200 Date: Tue, 21 Feb 2023 13:50:53 +0200 From: Andy Shevchenko To: Pin-yen Lin Subject: Re: [PATCH v12 05/10] drm/bridge: anx7625: Check for Type-C during panel registration Message-ID: References: <20230221095054.1868277-1-treapking@chromium.org> <20230221095054.1868277-6-treapking@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230221095054.1868277-6-treapking@chromium.org> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo 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: Heikki Krogerus , Andrzej Hajda , "Rafael J . Wysocki" , dri-devel@lists.freedesktop.org, Laurent Pinchart , Krzysztof Kozlowski , Guenter Roeck , Marek Vasut , chrome-platform@lists.linux.dev, Robert Foss , Javier Martinez Canillas , Jernej Skrabec , linux-acpi@vger.kernel.org, devicetree@vger.kernel.org, Sakari Ailus , =?iso-8859-1?Q?N=EDcolas_F_=2E_R_=2E_A_=2E?= Prado , Jonas Karlman , Allen Chen , Stephen Boyd , Rob Herring , Hsin-Yi Wang , Benson Leung , Xin Ji , AngeloGioacchino Del Regno , Neil Armstrong , Thomas Zimmermann , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, Daniel Scally , Prashant Malani Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Tue, Feb 21, 2023 at 05:50:49PM +0800, Pin-yen Lin wrote: > 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. ... > + port_node = of_graph_get_port_by_id(np, 1); > + fwnode_for_each_typec_mode_switch(&port_node->fwnode, fwnode) { > + fwnode_handle_put(fwnode); > + return 0; > + } With the proposed count API: unsigned int count; ... port_node = ... count = typec_mode_switch_node_count(&port_node->fwnode); if (count == 0) return 0; -- With Best Regards, Andy Shevchenko