|
@@ -116,8 +116,15 @@ void pdb_dpm_get_sink_capability(union pd_msg *cap)
|
116
|
116
|
|
117
|
117
|
bool pdb_dpm_evaluate_typec_current(void)
|
118
|
118
|
{
|
119
|
|
- /* Get the current configuration */
|
120
|
|
- struct pdb_config *cfg = pdb_config_flash_read();
|
|
119
|
+ static bool cfg_set = false;
|
|
120
|
+ static struct pdb_config *cfg = NULL;
|
|
121
|
+
|
|
122
|
+ /* Only get the configuration the first time this function runs, since its
|
|
123
|
+ * location will never change without rebooting into setup mode. */
|
|
124
|
+ if (!cfg_set) {
|
|
125
|
+ cfg = pdb_config_flash_read();
|
|
126
|
+ cfg_set = true;
|
|
127
|
+ }
|
121
|
128
|
|
122
|
129
|
/* If we have no configuration or don't want 5 V, Type-C Current can't
|
123
|
130
|
* possibly satisfy our needs */
|