mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-04-28 04:18:49 -04:00
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: Prashant Malani <pmalani@chromium.org> Reviewed-by: Benson Leung <bleung@chromium.org> Link: https://lore.kernel.org/r/20230104060846.112216-2-pmalani@chromium.org
This commit is contained in:
@@ -246,13 +246,15 @@ 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;
|
||||
|
||||
Reference in New Issue
Block a user