|
@@ -30,6 +30,8 @@
|
30
|
30
|
|
31
|
31
|
bool pdb_dpm_led_pd_status = true;
|
32
|
32
|
|
|
33
|
+bool pdb_dpm_usb_comms = false;
|
|
34
|
+
|
33
|
35
|
|
34
|
36
|
/* The current draw when the output is disabled */
|
35
|
37
|
#define DPM_MIN_CURRENT PD_MA2PDI(100)
|
|
@@ -86,6 +88,9 @@ bool pdb_dpm_evaluate_capability(const union pd_msg *capabilities, union pd_msg
|
86
|
88
|
| PD_RDO_FV_CURRENT_SET(cfg->i)
|
87
|
89
|
| PD_RDO_NO_USB_SUSPEND | PD_RDO_OBJPOS_SET(i + 1);
|
88
|
90
|
}
|
|
91
|
+ if (pdb_dpm_usb_comms) {
|
|
92
|
+ request->obj[0] |= PD_RDO_USB_COMMS;
|
|
93
|
+ }
|
89
|
94
|
|
90
|
95
|
/* Update requested voltage */
|
91
|
96
|
dpm_requested_voltage = cfg->v;
|
|
@@ -101,6 +106,9 @@ bool pdb_dpm_evaluate_capability(const union pd_msg *capabilities, union pd_msg
|
101
|
106
|
| PD_RDO_FV_CURRENT_SET(DPM_MIN_CURRENT)
|
102
|
107
|
| PD_RDO_NO_USB_SUSPEND | PD_RDO_CAP_MISMATCH
|
103
|
108
|
| PD_RDO_OBJPOS_SET(1);
|
|
109
|
+ if (pdb_dpm_usb_comms) {
|
|
110
|
+ request->obj[0] |= PD_RDO_USB_COMMS;
|
|
111
|
+ }
|
104
|
112
|
|
105
|
113
|
/* Update requested voltage */
|
106
|
114
|
dpm_requested_voltage = PD_MV2PDV(5000);
|
|
@@ -140,6 +148,11 @@ void pdb_dpm_get_sink_capability(union pd_msg *cap)
|
140
|
148
|
cap->obj[0] |= PD_PDO_SNK_FIXED_UNCONSTRAINED;
|
141
|
149
|
}
|
142
|
150
|
|
|
151
|
+ /* Set the USB communications capable flag. */
|
|
152
|
+ if (pdb_dpm_usb_comms) {
|
|
153
|
+ cap->obj[0] |= PD_PDO_SNK_FIXED_USB_COMMS;
|
|
154
|
+ }
|
|
155
|
+
|
143
|
156
|
/* Set the Sink_Capabilities message header */
|
144
|
157
|
cap->hdr = PD_MSGTYPE_SINK_CAPABILITIES | PD_DATAROLE_UFP | PD_SPECREV_2_0
|
145
|
158
|
| PD_POWERROLE_SINK | PD_NUMOBJ(numobj);
|