summaryrefslogtreecommitdiff
path: root/drivers/platform/chrome
diff options
context:
space:
mode:
authorPrashant Malani <pmalani@chromium.org>2023-01-04 09:08:45 +0300
committerPrashant Malani <pmalani@chromium.org>2023-01-10 23:47:32 +0300
commit441529bed41cd6f368fe337ebbb4920e3519da24 (patch)
tree6c0d21667ca908f41c10aaa02a348cff1fd27e23 /drivers/platform/chrome
parentef9c00dbd383d2b68207cc996caa05c25c7894f5 (diff)
downloadlinux-441529bed41cd6f368fe337ebbb4920e3519da24.tar.xz
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
Diffstat (limited to 'drivers/platform/chrome')
-rw-r--r--drivers/platform/chrome/cros_typec_switch.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/platform/chrome/cros_typec_switch.c b/drivers/platform/chrome/cros_typec_switch.c
index 2536bda03bf3..9ed1605f4071 100644
--- a/drivers/platform/chrome/cros_typec_switch.c
+++ b/drivers/platform/chrome/cros_typec_switch.c
@@ -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;