From: Prashant Malani Date: Wed, 15 Jun 2022 17:20:17 +0000 (+0000) Subject: usb: typec: mux: Allow muxes to specify mode-switch X-Git-Tag: v6.6.17~6909^2~129 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=144a96f7f96e412c3367f51cf2c57f52e3f1110d;p=platform%2Fkernel%2Flinux-rpi.git 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 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 Link: https://lore.kernel.org/r/20220615172129.1314056-2-pmalani@chromium.org Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/typec/mux.c b/drivers/usb/typec/mux.c index fd55c2c..4643307 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;