提交 144a96f7 编写于 作者: P Prashant Malani 提交者: Greg Kroah-Hartman

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: NPrashant Malani <pmalani@chromium.org>
Reviewed-by: NHeikki Krogerus <heikki.krogerus@linux.intel.com>
Reviewed-by: NAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: NNícolas F. R. A. Prado <nfraprado@collabora.com>
Tested-by: NNícolas F. R. A. Prado <nfraprado@collabora.com>
Link: https://lore.kernel.org/r/20220615172129.1314056-2-pmalani@chromium.orgSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 d9be8d5c
...@@ -281,9 +281,13 @@ static void *typec_mux_match(struct fwnode_handle *fwnode, const char *id, ...@@ -281,9 +281,13 @@ static void *typec_mux_match(struct fwnode_handle *fwnode, const char *id,
if (match) if (match)
goto find_mux; goto find_mux;
/* Accessory Mode muxes */
if (!desc) { 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) if (match)
goto find_mux; goto find_mux;
return NULL; return NULL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册