Commit 53eeb073 authored by Prashant Malani's avatar Prashant Malani

platform/chrome: cros_ec_typec: Make try power role optional

Some boards prefer not to specify a try-power-role. Update the port
property parsing logic to not error out in case a try-power-role is not
specified.

Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: default avatarPrashant Malani <pmalani@chromium.org>
Acked-by: default avatarHeikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/chrome-platform/20220127191659.3560810-1-pmalani@chromium.org/
parent 664de6a2
......@@ -115,17 +115,18 @@ static int cros_typec_parse_port_props(struct typec_capability *cap,
return ret;
cap->data = ret;
/* Try-power-role is optional. */
ret = fwnode_property_read_string(fwnode, "try-power-role", &buf);
if (ret) {
dev_err(dev, "try-power-role not found: %d\n", ret);
return ret;
dev_warn(dev, "try-power-role not found: %d\n", ret);
cap->prefer_role = TYPEC_NO_PREFERRED_ROLE;
} else {
ret = typec_find_power_role(buf);
if (ret < 0)
return ret;
cap->prefer_role = ret;
}
ret = typec_find_power_role(buf);
if (ret < 0)
return ret;
cap->prefer_role = ret;
cap->fwnode = fwnode;
return 0;
......
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