genvif: Unconstrained_Power
BRANCH=none
TEST=verify XML output
Tested-by: Denis Brockus
@@ -1314,14 +1314,32 @@ static int gen_vif(const char *name,
supports_to_ufp);
}
- if (is_src())
+ if (is_src()) {
+ /* SRC capable */
+ if (IS_ENABLED(CONFIG_CHARGER))
+ /* USB-C UP bit set */
set_vif_field_b(&vif_fields[Unconstrained_Power],
"Unconstrained_Power",
- src_pdo[0] & PDO_FIXED_UNCONSTRAINED);
- else
+ (src_pdo[0] & PDO_FIXED_UNCONSTRAINED));
+ else {
+ /* Barrel charger being used */
+ int32_t dedicated_charge_port_count = 0;
+
+ #ifdef CONFIG_DEDICATED_CHARGE_PORT_COUNT
+ dedicated_charge_port_count =
+ CONFIG_DEDICATED_CHARGE_PORT_COUNT;
+ #endif
+
+ set_vif_field_b(&vif_fields[Unconstrained_Power],
+ "Unconstrained_Power",
+ (dedicated_charge_port_count > 0));
+ }
+ } else {
+ /* Not SRC capable */
set_vif_field_b(&vif_fields[Unconstrained_Power],
"Unconstrained_Power",
false);
+ }
set_vif_field_b(&vif_fields[VCONN_Swap_To_On_Supported],
"VCONN_Swap_To_On_Supported",
