[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220615172129.1314056-2-pmalani@chromium.org>
Date: Wed, 15 Jun 2022 17:20:17 +0000
From: Prashant Malani <pmalani@...omium.org>
To: linux-kernel@...r.kernel.org, linux-usb@...r.kernel.org
Cc: bleung@...omium.org, swboyd@...omium.org,
heikki.krogerus@...ux.intel.com,
Prashant Malani <pmalani@...omium.org>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@...labora.com>,
Nícolas F . R . A . Prado
<nfraprado@...labora.com>, Andrzej Hajda <andrzej.hajda@...el.com>,
Daniel Vetter <daniel@...ll.ch>,
David Airlie <airlied@...ux.ie>,
devicetree@...r.kernel.org (open list:OPEN FIRMWARE AND FLATTENED
DEVICE TREE BINDINGS),
dri-devel@...ts.freedesktop.org (open list:DRM DRIVERS),
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Hsin-Yi Wang <hsinyi@...omium.org>,
Jernej Skrabec <jernej.skrabec@...il.com>,
Jonas Karlman <jonas@...boo.se>,
José Expósito <jose.exposito89@...il.com>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Laurent Pinchart <Laurent.pinchart@...asonboard.com>,
Maxime Ripard <maxime@...no.tech>,
Neil Armstrong <narmstrong@...libre.com>,
Pin-Yen Lin <treapking@...omium.org>,
Robert Foss <robert.foss@...aro.org>,
Rob Herring <robh+dt@...nel.org>,
Sam Ravnborg <sam@...nborg.org>,
Thomas Zimmermann <tzimmermann@...e.de>,
Xin Ji <xji@...logixsemi.com>
Subject: [PATCH v4 1/7] usb: typec: mux: Allow muxes to specify mode-switch
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 <pmalani@...omium.org>
Reviewed-by: Heikki Krogerus <heikki.krogerus@...ux.intel.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>
Reviewed-by: Nícolas F. R. A. Prado <nfraprado@...labora.com>
Tested-by: Nícolas F. R. A. Prado <nfraprado@...labora.com>
---
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
Powered by blists - more mailing lists