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

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
......@@ -246,14 +246,16 @@ static int cros_typec_register_switches(struct cros_typec_switch_data *sdata)
port->port_num = index;
sdata->ports[index] = port;
ret = cros_typec_register_retimer(port, fwnode);
if (ret) {
dev_err(dev, "Retimer switch register failed\n");
goto err_switch;
if (fwnode_property_present(fwnode, "retimer-switch")) {
ret = cros_typec_register_retimer(port, fwnode);
if (ret) {
dev_err(dev, "Retimer switch register failed\n");
goto err_switch;
}
dev_dbg(dev, "Retimer switch registered for index %llu\n", index);
}
dev_dbg(dev, "Retimer switch registered for index %llu\n", index);
if (!fwnode_property_present(fwnode, "mode-switch"))
continue;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment