|
@@ -74,7 +74,7 @@ bool pdb_dpm_evaluate_capability(const union pd_msg *capabilities, union pd_msg
|
74
|
74
|
dpm_unconstrained_power = capabilities->obj[0] & PD_PDO_SRC_FIXED_UNCONSTRAINED;
|
75
|
75
|
|
76
|
76
|
/* Make sure we have configuration */
|
77
|
|
- if (cfg != NULL) {
|
|
77
|
+ if (cfg != NULL && pdb_dpm_output_enabled) {
|
78
|
78
|
/* Look at the PDOs to see if one matches our desires */
|
79
|
79
|
for (uint8_t i = 0; i < numobj; i++) {
|
80
|
80
|
/* Fixed Supply PDOs come first, so when we see a PDO that isn't a
|
|
@@ -117,8 +117,14 @@ bool pdb_dpm_evaluate_capability(const union pd_msg *capabilities, union pd_msg
|
117
|
117
|
PD_SPECREV_2_0 | PD_POWERROLE_SINK | PD_NUMOBJ(1);
|
118
|
118
|
request->obj[0] = PD_RDO_FV_MAX_CURRENT_SET(DPM_MIN_CURRENT)
|
119
|
119
|
| PD_RDO_FV_CURRENT_SET(DPM_MIN_CURRENT)
|
120
|
|
- | PD_RDO_NO_USB_SUSPEND | PD_RDO_CAP_MISMATCH
|
|
120
|
+ | PD_RDO_NO_USB_SUSPEND
|
121
|
121
|
| PD_RDO_OBJPOS_SET(1);
|
|
122
|
+ /* If the output is enabled and we got here, it must be a capability
|
|
123
|
+ * mismatch. */
|
|
124
|
+ if (pdb_dpm_output_enabled) {
|
|
125
|
+ request->obj[0] |= PD_RDO_CAP_MISMATCH;
|
|
126
|
+ }
|
|
127
|
+ /* If we can do USB communications, tell the power supply */
|
122
|
128
|
if (pdb_dpm_usb_comms) {
|
123
|
129
|
request->obj[0] |= PD_RDO_USB_COMMS;
|
124
|
130
|
}
|
|
@@ -126,7 +132,8 @@ bool pdb_dpm_evaluate_capability(const union pd_msg *capabilities, union pd_msg
|
126
|
132
|
/* Update requested voltage */
|
127
|
133
|
dpm_requested_voltage = PD_MV2PDV(5000);
|
128
|
134
|
|
129
|
|
- return false;
|
|
135
|
+ /* At this point, we have a capability match iff the output is disabled */
|
|
136
|
+ return !pdb_dpm_output_enabled;
|
130
|
137
|
}
|
131
|
138
|
|
132
|
139
|
void pdb_dpm_get_sink_capability(union pd_msg *cap)
|