mirror of
https://github.com/torvalds/linux
synced 2024-10-08 04:12:40 +00: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:
parent
ef9c00dbd3
commit
441529bed4
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue