Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp707513iog; Wed, 15 Jun 2022 10:29:49 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vmeyNz44i9BZjCMq/kY+57cdNtImbFc247inNp7qaaWigtXOInzH+vrULyi8V8l2+NQz6V X-Received: by 2002:a17:90b:4c10:b0:1e8:d377:4998 with SMTP id na16-20020a17090b4c1000b001e8d3774998mr11532061pjb.227.1655314189768; Wed, 15 Jun 2022 10:29:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655314189; cv=none; d=google.com; s=arc-20160816; b=T+kwXlNY/B/DTKKjNlpw6YklZlErGLX3hioPmWp5lXpIiu69QIz9BmOmcsDnzay2pZ bHu1gC7hwhwdIkWIM+AOKLyGHRfpQZtft+2oSrl5pQqrXVdydj6M0B+CXMwxEUXqYNYX memlZQHiZDl89fkl9ohIyxMKt1ns9E9jQs5v84eGqvXYI6xLOEihp4HXdb2DKkNq3Yl4 hJ2w32bYE9+G9BvDYMk6MrVavwyCR7EPcrQ1ZXikApgsmcfImIXama8nb0FngniG507A 6CRb1eWQun2RpeEWw8xAx3CpCOBKWZ4FsNxK6LATnD6N2VpSiOFdhQtRFsVIvHQC6oBD pPow== 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=2W8ZiDCOiI2bSKlNFhYrholIlbWHA9JNdcBup3bW7Yo=; b=N+K3a0eLDA3KKVJFgaTlpVavLmFWkY9WU5losgiqUYjcHW+tTUqTm4+9Np2ZKmixCD bObqvUaDsfJLkVq1t+tyCSr7DYnE7cuTeLixWSxEiy3zXQ7icMCoZ2+cgM4crdkkt4/T Ttbja4PZFgvuYGRhYM9Zb1K7wwl1+hci42uZWM3O7Oq9Vx+jhgyPkRUre3223GZf0UqZ xeLo1QMQQXcW8GJVsZNdAxaWtiMcks0udUv4o2Ebl6htFKYHaI1qpkM7DzO+bFEMr/lf l3EB2g3HlUj4NsPl1KgYz4IT53XOVsYxAlratVmexe9outleKk7LN71l73I9hsePA7wF 8W3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Hpp3AncT; 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 v11-20020a1709028d8b00b00159071eb8f6si16343093plo.502.2022.06.15.10.29.38; Wed, 15 Jun 2022 10:29:49 -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=Hpp3AncT; 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 S1350132AbiFORWz (ORCPT + 99 others); Wed, 15 Jun 2022 13:22:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350023AbiFORWx (ORCPT ); Wed, 15 Jun 2022 13:22:53 -0400 Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9FA1B2A708 for ; Wed, 15 Jun 2022 10:22:52 -0700 (PDT) Received: by mail-pl1-x62e.google.com with SMTP id i15so10989892plr.1 for ; Wed, 15 Jun 2022 10:22:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2W8ZiDCOiI2bSKlNFhYrholIlbWHA9JNdcBup3bW7Yo=; b=Hpp3AncTQoSOnV7UdHW2TvyOhTzBZiIH0LBgD/t5tp0ITB9U3aOqAo7WF6v6e8UoHc fy+xPhaHHN0pBCYm3iDpjYgr3ApnSfCrnFnteSX1XQQw2d7eOXGWyoYf0VitILM0XChL 19KtVerTsiYctQ0HQr3Ozthgj4KmrtiAJ0ptw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2W8ZiDCOiI2bSKlNFhYrholIlbWHA9JNdcBup3bW7Yo=; b=k5OtqtntH/YCDCfa7dPrxX/7lfeGTykOQtNDxSwJFON1eMLE5Z9UMchEy6GYx+S37e dTZVTGazFxWxjyBPKHmSWf9qyypx54toRIpHynHkWGt3p4tl26I8+07lgLst8B6v67US z8RlJdpP09P4tClNcrwKC0qKWmNPwzyJcLO0KWBH5emOAiekkZJBE7OMFnC7Y3ZaFNVR kddQ89en2jhb+iV/W1y4dv/LiH0LNZmupQtUBKHQ5ts4tjtxuCtQ3l0whzhsjWfbHA3k N7XSIeCTQrpHFwNV1Zjf+bvQPMhQHHyJuksXwlG/ryV7/3WkRZ0OFzWefkB1CPGaPFRt kSxw== X-Gm-Message-State: AJIora/GeGy5Wrb0VvpgKfKDvfXq/UdtmT/4FJychasEebGpdxs1Rcgh E/QurNLcgrwaRdWC2YmsmjvayZoLPF+5jA== X-Received: by 2002:a17:90b:380b:b0:1e6:67f6:c5b4 with SMTP id mq11-20020a17090b380b00b001e667f6c5b4mr11445610pjb.48.1655313771456; Wed, 15 Jun 2022 10:22:51 -0700 (PDT) Received: from pmalani.c.googlers.com.com (157.214.185.35.bc.googleusercontent.com. [35.185.214.157]) by smtp.gmail.com with ESMTPSA id d10-20020aa7814a000000b005103abd2fdbsm10147433pfn.206.2022.06.15.10.22.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jun 2022 10:22:51 -0700 (PDT) From: Prashant Malani To: linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org Cc: bleung@chromium.org, swboyd@chromium.org, heikki.krogerus@linux.intel.com, Prashant Malani , AngeloGioacchino Del Regno , =?UTF-8?q?N=C3=ADcolas=20F=20=2E=20R=20=2E=20A=20=2E=20Prado?= , Andrzej Hajda , Daniel Vetter , David Airlie , devicetree@vger.kernel.org (open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS), dri-devel@lists.freedesktop.org (open list:DRM DRIVERS), Greg Kroah-Hartman , Hsin-Yi Wang , Jernej Skrabec , Jonas Karlman , =?UTF-8?q?Jos=C3=A9=20Exp=C3=B3sito?= , Krzysztof Kozlowski , Laurent Pinchart , Maxime Ripard , Neil Armstrong , Pin-Yen Lin , Robert Foss , Rob Herring , Sam Ravnborg , Thomas Zimmermann , Xin Ji Subject: [PATCH v4 1/7] usb: typec: mux: Allow muxes to specify mode-switch Date: Wed, 15 Jun 2022 17:20:17 +0000 Message-Id: <20220615172129.1314056-2-pmalani@chromium.org> X-Mailer: git-send-email 2.36.1.476.g0c4daa206d-goog In-Reply-To: <20220615172129.1314056-1-pmalani@chromium.org> References: <20220615172129.1314056-1-pmalani@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.3 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,T_SCC_BODY_TEXT_LINE autolearn=ham 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 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 Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: NĂ­colas F. R. A. Prado Tested-by: NĂ­colas F. R. A. Prado --- Changes since v3: - No changes. Changes since v2: - Included Reviewed-by and Tested-by tags from v2. 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