Skip to content

Commit 144a96f

Browse files
Prashant Malanigregkh
authored andcommitted
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 <[email protected]> Reviewed-by: Heikki Krogerus <[email protected]> Reviewed-by: AngeloGioacchino Del Regno <[email protected]> Reviewed-by: Nícolas F. R. A. Prado <[email protected]> Tested-by: Nícolas F. R. A. Prado <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent d9be8d5 commit 144a96f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

drivers/usb/typec/mux.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,9 +281,13 @@ static void *typec_mux_match(struct fwnode_handle *fwnode, const char *id,
281281
if (match)
282282
goto find_mux;
283283

284-
/* Accessory Mode muxes */
285284
if (!desc) {
286-
match = fwnode_property_present(fwnode, "accessory");
285+
/*
286+
* Accessory Mode muxes & muxes which explicitly specify
287+
* the required identifier can avoid SVID matching.
288+
*/
289+
match = fwnode_property_present(fwnode, "accessory") ||
290+
fwnode_property_present(fwnode, id);
287291
if (match)
288292
goto find_mux;
289293
return NULL;

0 commit comments

Comments
 (0)