diff options
author | Eric Yilun Lin <yllin@chromium.org> | 2021-05-14 15:36:41 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-09-01 02:11:16 +0000 |
commit | 61bbfcaa37ecec87a9cea89e0f8fc65ecbecd13e (patch) | |
tree | f37906b9bb648028e8613e6069fa515b07b1db6f /zephyr | |
parent | 272e74878f45d744dfebad5847f0f32ed5cbb137 (diff) | |
download | chrome-ec-61bbfcaa37ecec87a9cea89e0f8fc65ecbecd13e.tar.gz |
usbpd: support dynamic PDO selection
Support dynamic PDO selection CONFIG_USB_PD_DPS.
This config controls the charging voltage and power according to the
input power and battery configuration.
DPS would continuously evaluate the system load and current charging
voltage, and decide a new one by below:
1. If the PDO can fulfill system desired power.
2. If the PDO is efficient for the battery configuration.
To detect if the system load cannot be fulfilled by the current PDO,
it checks:
1. if the input current closes to the PDO current limit.
2. if the input power closes to the PDO maximum power.
To detect if the system load can be fulfilled by a more efficient PDO,
it checks:
- if the voltage of a new PDO is closer to the battery voltage than the
current PDO, and the power is able fulfill the system load.
BUG=b:169532537
TEST=1. tested on asurada, the charging voltage is able to switch to
different PDOs under different system loads
2. tested that the DPS is able to switch charge port
(e.g. C1 12V -> C0 9V) based on the provided PDOs.
BRANCH=asurada
Change-Id: I7c7706b331dc0d4f8ac68569dc7ed852fc9308e3
Signed-off-by: Eric Yilun Lin <yllin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2897064
Tested-by: Eric Yilun Lin <yllin@google.com>
Reviewed-by: Diana Z <dzigterman@chromium.org>
Commit-Queue: Eric Yilun Lin <yllin@google.com>
Diffstat (limited to 'zephyr')
-rw-r--r-- | zephyr/Kconfig.usbc | 11 | ||||
-rw-r--r-- | zephyr/shim/include/config_chip.h | 5 |
2 files changed, 16 insertions, 0 deletions
diff --git a/zephyr/Kconfig.usbc b/zephyr/Kconfig.usbc index e40eba1140..b687c4a5cc 100644 --- a/zephyr/Kconfig.usbc +++ b/zephyr/Kconfig.usbc @@ -421,6 +421,17 @@ endchoice # Trigger implementation endif # PLATFORM_EC_USB_PD_FRS +config PLATFORM_EC_USB_PD_DPS + bool "Board can support Dynamic PDO Selection" + depends on PLATFORM_EC_BATTERY + default n + help + Enable this if the board needs dynamic PDO selection. + DPS picks a power efficient PDO regarding to the underlying battery + configuration and the system loading. + Default configuration can be overrided by `dps_config` to adapt + to each board's need. + config PLATFORM_EC_USB_PD_DUAL_ROLE_AUTO_TOGGLE bool "Board can use TCPC-controlled DRP toggle" depends on PLATFORM_EC_USB_PD_DUAL_ROLE diff --git a/zephyr/shim/include/config_chip.h b/zephyr/shim/include/config_chip.h index e4ad0ab28e..2c7ac5dfe3 100644 --- a/zephyr/shim/include/config_chip.h +++ b/zephyr/shim/include/config_chip.h @@ -1024,6 +1024,11 @@ #define CONFIG_USB_PD_ALT_MODE_UFP #endif +#undef CONFIG_USB_PD_DPS +#ifdef CONFIG_PLATFORM_EC_USB_PD_DPS +#define CONFIG_USB_PD_DPS +#endif + #undef CONFIG_DP_REDRIVER_TDP142 #ifdef CONFIG_PLATFORM_EC_DP_REDRIVER_TDP142 #define CONFIG_DP_REDRIVER_TDP142 |