Commit 441529be authored by Prashant Malani's avatar Prashant Malani
Browse files

platform/chrome: cros_typec_switch: Check for retimer flag



Not all ports have retimers. Only register a retimer switch if the
"retimer-switch" property is present for that port's mux
device.

Signed-off-by: default avatarPrashant Malani <pmalani@chromium.org>
Reviewed-by: default avatarBenson Leung <bleung@chromium.org>
Link: https://lore.kernel.org/r/20230104060846.112216-2-pmalani@chromium.org
parent ef9c00db
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -246,6 +246,7 @@ static int cros_typec_register_switches(struct cros_typec_switch_data *sdata)
		port->port_num = index;
		sdata->ports[index] = port;

		if (fwnode_property_present(fwnode, "retimer-switch")) {
			ret = cros_typec_register_retimer(port, fwnode);
			if (ret) {
				dev_err(dev, "Retimer switch register failed\n");
@@ -253,6 +254,7 @@ static int cros_typec_register_switches(struct cros_typec_switch_data *sdata)
			}

			dev_dbg(dev, "Retimer switch registered for index %llu\n", index);
		}

		if (!fwnode_property_present(fwnode, "mode-switch"))
			continue;