diff options
Diffstat (limited to 'zephyr/Kconfig.usbc')
-rw-r--r-- | zephyr/Kconfig.usbc | 46 |
1 files changed, 41 insertions, 5 deletions
diff --git a/zephyr/Kconfig.usbc b/zephyr/Kconfig.usbc index 903cf575c6..082f96ca7f 100644 --- a/zephyr/Kconfig.usbc +++ b/zephyr/Kconfig.usbc @@ -31,18 +31,54 @@ rsource "Kconfig.usb_charger" if PLATFORM_EC_USBC -config PLATFORM_EC_CHARGER_INPUT_CURRENT +config PLATFORM_EC_CHARGER_DEFAULT_CURRENT_LIMIT int "Charger input current in mA" depends on PLATFORM_EC_CHARGE_MANAGER default 512 help - This is the default input current for the board in mA. Many boards - also use this as the least maximum input current during transients. + Default input current limit for the board in mA. This value should depend on external power adapter, designed charging voltage, and the maximum power of the running system. For type-C - chargers, this should be set to 512 mA in order to not brown-out - low-current USB charge ports in accordance with USB-PD r3.0 Sec. 7.3 + chargers, this should be set to no more than 512 mA in order to not + brown-out low-current USB charge ports in accordance with USB-PD r3.0 + Sec. 7.3. + +config PLATFORM_EC_CHARGER_MIN_INPUT_CURRENT_LIMIT + int "Minimum charger input current limit in mA" + default 0 + depends on PLATFORM_EC_CHARGE_MANAGER + help + Minimum current limit in mA that will ever be set for chargers, even if a + lower limit is requested. + + If set, this should usually be set to no more than 2.5W divided by the + maximum supported input voltage in order to satisfy USB-PD pSnkStdby + requirements. Higher values may help devices stay alive under low-battery + conditions at the cost of violating standby power limits. + + Many boards set this to large values, since historically this number was + usually equal to the default current limit. New boards should avoid doing + so if possible, and usually leave this unset: customization of + board_set_charge_limit() should be considered instead if a device sometimes + requires amounts of power in violation of specs, to limit those violations + only to situations where they are necessary. + +config PLATFORM_EC_CHARGER_INPUT_CURRENT_DERATE_PCT + int "Charger input current derating percentage" + default 0 + depends on PLATFORM_EC_CHARGE_MANAGER + help + Setting this to a nonzero value causes actual charger current limits + to be adjusted by the given percentage. For example, setting this to + 4 and requesting a current limit of 1000 mA causes the charge manager + to program an actual current limit of 960 mA. + + This is useful if a charger consistently draws more current than the + programmed limit, or if it is desired to derate for other + safety-related reasons. If a more complex (non-linear) adjustment is + required, boards should override the board_set_charge_limit() + function instead of configuring this option. config PLATFORM_EC_USBC_OCP bool |