]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
Revert "usb: typec: mux: avoid duplicated mux switches"
authorJens Glathe <jens.glathe@oldschoolsolutions.biz>
Sat, 30 May 2026 08:20:22 +0000 (10:20 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 8 Jul 2026 15:17:14 +0000 (17:17 +0200)
This reverts commit b145c3f29d62f71cc9d2d714e2d4ae4c8d3f863d.

The deduplication logic appears to cause issues with separate
SBU muxes. The mode-switch call on these (like gpio-sbu-mux)
never appeared, so no successful mode-switch happened. The more
high-end Parade PS883X redrivers are not affected due to being
retimer-switch. The revert fixes dp altmode mode-switch for both.

Tested on:
  Lenovo Thinkbook 16 G7 QOY
  Lenovo Ideapad 5 2in1 14Q8X9
  Microsoft Windows Dev Kit 2023 (Blackrock)
  Lenovo Thinkpad T14s G6

Fixes: b145c3f29d62 ("usb: typec: mux: avoid duplicated mux switches")
Cc: stable <stable@kernel.org>
Signed-off-by: Jens Glathe <jens.glathe@oldschoolsolutions.biz>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://patch.msgid.link/20260530-typc-mux-modeset-v1-1-64b0281e2cd6@oldschoolsolutions.biz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/mux.c

index db5e4a4c0a99699c4c0f715d281cdc85f1e68c77..9b908c46bd7df9fe78ac0a5eeeb9b03d6587ba80 100644 (file)
@@ -275,9 +275,7 @@ static int mux_fwnode_match(struct device *dev, const void *fwnode)
 static void *typec_mux_match(const struct fwnode_handle *fwnode,
                             const char *id, void *data)
 {
-       struct typec_mux_dev **mux_devs = data;
        struct device *dev;
-       int i;
 
        /*
         * Device graph (OF graph) does not give any means to identify the
@@ -293,14 +291,6 @@ static void *typec_mux_match(const struct fwnode_handle *fwnode,
        dev = class_find_device(&typec_mux_class, NULL, fwnode,
                                mux_fwnode_match);
 
-       /* Skip duplicates */
-       for (i = 0; i < TYPEC_MUX_MAX_DEVS; i++)
-               if (to_typec_mux_dev(dev) == mux_devs[i]) {
-                       put_device(dev);
-                       return NULL;
-               }
-
-
        return dev ? to_typec_mux_dev(dev) : ERR_PTR(-EPROBE_DEFER);
 }
 
@@ -326,8 +316,7 @@ struct typec_mux *fwnode_typec_mux_get(struct fwnode_handle *fwnode)
                return ERR_PTR(-ENOMEM);
 
        count = fwnode_connection_find_matches(fwnode, "mode-switch",
-                                              (void **)mux_devs,
-                                              typec_mux_match,
+                                              NULL, typec_mux_match,
                                               (void **)mux_devs,
                                               ARRAY_SIZE(mux_devs));
        if (count <= 0) {