mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-12 19:04:59 +00:00
Fizz: Give highest priority to dedicated chargers
This patch gives the highest priority to dedicated chargers. It means if a dedicated power supply is being connected, other power supplies such as USB-C adapters will not be recognized as a new charger. BUG=b:65059574 BRANCH=none TEST=Boot Fizz on BJ adapter. Verify plugging in Type-C adapter doesn't shut down the system. Change-Id: Ie49b128ae64f917a227f9081148565a3f5356212 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/655638 Reviewed-by: Shawn N <shawnn@chromium.org>
This commit is contained in:
committed by
chrome-bot
parent
ac97fea2d7
commit
117e59cf7b
@@ -280,7 +280,7 @@ static void board_charge_manager_init(void)
|
||||
case CHARGE_PORT_BARRELJACK:
|
||||
cpi.voltage = input_voltage;
|
||||
cpi.current = 3330; /* TODO: Set right value */
|
||||
charge_manager_update_charge(CHARGE_SUPPLIER_PROPRIETARY, 1,
|
||||
charge_manager_update_charge(CHARGE_SUPPLIER_DEDICATED, 1,
|
||||
&cpi);
|
||||
/* Source only. Disable PD negotiation as a sink */
|
||||
break;
|
||||
|
||||
@@ -31,6 +31,9 @@
|
||||
/* Charge supplier priority: lower number indicates higher priority. */
|
||||
test_mockable const int supplier_priority[] = {
|
||||
[CHARGE_SUPPLIER_PD] = 0,
|
||||
#if CONFIG_DEDICATED_CHARGE_PORT_COUNT > 0
|
||||
[CHARGE_SUPPLIER_DEDICATED] = 0,
|
||||
#endif
|
||||
[CHARGE_SUPPLIER_TYPEC] = 1,
|
||||
[CHARGE_SUPPLIER_PROPRIETARY] = 1,
|
||||
[CHARGE_SUPPLIER_BC12_DCP] = 2,
|
||||
@@ -264,6 +267,7 @@ static void charge_manager_fill_power_info(int port,
|
||||
const int use_ramp_current = 0;
|
||||
#endif
|
||||
|
||||
/* TODO: Handle CHARGE_SUPPLIER_DEDICATED */
|
||||
switch (sup) {
|
||||
case CHARGE_SUPPLIER_PD:
|
||||
r->type = USB_CHG_TYPE_PD;
|
||||
|
||||
@@ -33,6 +33,9 @@ enum charge_supplier {
|
||||
CHARGE_SUPPLIER_PROPRIETARY,
|
||||
CHARGE_SUPPLIER_OTHER,
|
||||
CHARGE_SUPPLIER_VBUS,
|
||||
#if CONFIG_DEDICATED_CHARGE_PORT_COUNT > 0
|
||||
CHARGE_SUPPLIER_DEDICATED,
|
||||
#endif
|
||||
CHARGE_SUPPLIER_COUNT
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user