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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 319EFC43334 for ; Tue, 14 Jun 2022 07:42:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354535AbiFNHmy (ORCPT ); Tue, 14 Jun 2022 03:42:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59558 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231326AbiFNHmx (ORCPT ); Tue, 14 Jun 2022 03:42:53 -0400 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B05512A82; Tue, 14 Jun 2022 00:42:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655192571; x=1686728571; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=+MarE9Bt954nv0S2s3X8rKe2+hnrvQ0fK8d6D4CykL8=; b=MfJHrsJBYF3xes+G9W7b00L8WNW81KOGMYTWptfTfECA8iUHg98ET32R Z2pc4eefW1cEew5ZBAlaUCh4CyOxkMeKXWLYR4f7Jj7jBq0JfZqDkMFbp DHz06YytCLP2h23BhaFBcLStr442MC05xMci0YRp/y9Z8FkdbNDErA1E0 VKr5Db6XFWMelqHcjr44RTL+/YPxZvYq9tO/7yO3cL3ngfKHXi601eFyp 5sro9A73eBM7hiBTw9xjmSkNMuKBf/OmUrL1lCO4IsLTfreKku05LEMFk c9m94k4UMhDO0KX8S7EDqN6pWPlpmqDXT4f+Kv6hp/p5heKmRUH8T6M+q Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10377"; a="279258600" X-IronPort-AV: E=Sophos;i="5.91,299,1647327600"; d="scan'208";a="279258600" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jun 2022 00:42:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,299,1647327600"; d="scan'208";a="726695020" Received: from kuha.fi.intel.com ([10.237.72.185]) by fmsmga001.fm.intel.com with SMTP; 14 Jun 2022 00:42:43 -0700 Received: by kuha.fi.intel.com (sSMTP sendmail emulation); Tue, 14 Jun 2022 10:42:42 +0300 Date: Tue, 14 Jun 2022 10:42:42 +0300 From: Heikki Krogerus To: Prashant Malani Cc: linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, bleung@chromium.org, swboyd@chromium.org, Andrzej Hajda , AngeloGioacchino Del Regno , Daniel Vetter , David Airlie , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , "open list:DRM DRIVERS" , Greg Kroah-Hartman , Hsin-Yi Wang , Jernej Skrabec , Jonas Karlman , =?iso-8859-1?Q?Jos=E9_Exp=F3sito?= , Krzysztof Kozlowski , Laurent Pinchart , Maxime Ripard , Neil Armstrong , =?iso-8859-1?Q?N=EDcolas_F=2E_R=2E_A=2E?= Prado , Pin-Yen Lin , Robert Foss , Rob Herring , Sam Ravnborg , Thomas Zimmermann , Xin Ji Subject: Re: [PATCH v2 1/7] usb: typec: mux: Allow muxes to specify mode-switch Message-ID: References: <20220609181106.3695103-1-pmalani@chromium.org> <20220609181106.3695103-2-pmalani@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220609181106.3695103-2-pmalani@chromium.org> Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org On Thu, Jun 09, 2022 at 06:09:40PM +0000, Prashant Malani wrote: > Loosen the typec_mux_match() requirements so that searches where an > alt mode is not specified, but the target mux device lists the > "mode-switch" property, return a success. > > This is helpful in Type C port drivers which would like to get a pointer > to the mux switch associated with a Type C port, but don't want to > specify a particular alt mode. > > Signed-off-by: Prashant Malani Reviewed-by: Heikki Krogerus > --- > > Changes since v1: > - No changes. > > drivers/usb/typec/mux.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/drivers/usb/typec/mux.c b/drivers/usb/typec/mux.c > index fd55c2c516a5..464330776cd6 100644 > --- a/drivers/usb/typec/mux.c > +++ b/drivers/usb/typec/mux.c > @@ -281,9 +281,13 @@ static void *typec_mux_match(struct fwnode_handle *fwnode, const char *id, > if (match) > goto find_mux; > > - /* Accessory Mode muxes */ > if (!desc) { > - match = fwnode_property_present(fwnode, "accessory"); > + /* > + * Accessory Mode muxes & muxes which explicitly specify > + * the required identifier can avoid SVID matching. > + */ > + match = fwnode_property_present(fwnode, "accessory") || > + fwnode_property_present(fwnode, id); > if (match) > goto find_mux; > return NULL; > -- > 2.36.1.476.g0c4daa206d-goog -- heikki