Merge "policy_engine: Don't allow MODE change if no active connection"
This commit is contained in:
commit
207cc877c1
1 changed files with 5 additions and 0 deletions
|
@ -2522,6 +2522,11 @@ static int usbpd_dr_set_property(struct dual_role_phy_instance *dual_role,
|
|||
case DUAL_ROLE_PROP_MODE:
|
||||
usbpd_dbg(&pd->dev, "Setting mode to %d\n", *val);
|
||||
|
||||
if (pd->current_state == PE_UNKNOWN) {
|
||||
usbpd_warn(&pd->dev, "No active connection. Don't allow MODE change\n");
|
||||
return -EAGAIN;
|
||||
}
|
||||
|
||||
/*
|
||||
* Forces disconnect on CC and re-establishes connection.
|
||||
* This does not use PD-based PR/DR swap
|
||||
|
|
Loading…
Add table
Reference in a new issue