platform/chrome: cros_ec_typec: Add DP mode check
[ Upstream commit c5bb32f57b ]
There are certain transitional situations where the dp_mode field in the
PD_CONTROL response might not be populated with the right DP pin
assignment value yet. Add a check for that to avoid sending an invalid
value to the Type C mode switch.
Signed-off-by: Prashant Malani <pmalani@chromium.org>
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Link: https://lore.kernel.org/r/20210421042108.2002-1-pmalani@chromium.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
b01b7999f4
commit
6a40e3f9a8
1 changed files with 5 additions and 0 deletions
|
|
@ -475,6 +475,11 @@ static int cros_typec_enable_dp(struct cros_typec_data *typec,
|
|||
return -ENOTSUPP;
|
||||
}
|
||||
|
||||
if (!pd_ctrl->dp_mode) {
|
||||
dev_err(typec->dev, "No valid DP mode provided.\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* Status VDO. */
|
||||
dp_data.status = DP_STATUS_ENABLED;
|
||||
if (port->mux_flags & USB_PD_MUX_HPD_IRQ)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue