|
@@ -340,14 +340,14 @@ bool pdbs_dpm_evaluate_typec_current(struct pdb_config *cfg,
|
340
|
340
|
|
341
|
341
|
/* If we have no configuration or don't want 5 V, Type-C Current can't
|
342
|
342
|
* possibly satisfy our needs */
|
343
|
|
- /* TODO Check if 5 V is inside the voltage range */
|
344
|
|
- if (scfg == NULL || PD_MV2PDV(scfg->v) != PD_MV2PDV(5000)) {
|
|
343
|
+ if (scfg == NULL || (scfg->v != 5000 && (scfg->vmin > 5000
|
|
344
|
+ || scfg->vmax < 5000))) {
|
345
|
345
|
dpm_data->_capability_match = false;
|
346
|
346
|
return false;
|
347
|
347
|
}
|
348
|
348
|
|
349
|
349
|
/* Get the current we want */
|
350
|
|
- uint16_t current = dpm_get_current(scfg, scfg->v);
|
|
350
|
+ uint16_t current = dpm_get_current(scfg, 5000);
|
351
|
351
|
|
352
|
352
|
/* If 1.5 A is available and we want no more than that, great. */
|
353
|
353
|
if (tcc == fusb_tcc_1_5 && current <= 150) {
|