summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew McRae <amcrae@google.com>2022-12-15 13:46:31 +1100
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-12-15 23:57:19 +0000
commit55a0acd2796d53bdd9bef2898886528a67701119 (patch)
treef3ac81f9ff0ef6e0777174b1e44df14d258a4b14
parentb6fd56e2f7f472d8f80f67324a243a2b37ef9aa0 (diff)
downloadchrome-ec-55a0acd2796d53bdd9bef2898886528a67701119.tar.gz
usbc-pd: Use correct config item for AP pwr
Use CONFIG_AP_POWER_CONTROL for detecting when the AP has power sequence enabled rather than CONFIG_POWER_COMMON. The latter is only enabled for the legacy AP power sequence. BUG=b:258143457 TEST=zmake build --all; twister -T zephyr/test; make buildall BRANCH=none Change-Id: Ia85cd08442fe872ecb042c6302235ff8a6b4f001 Signed-off-by: Andrew McRae <amcrae@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4109988 Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Deepti Deshatty <deepti.deshatty@intel.corp-partner.google.com> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
-rw-r--r--common/usb_common.c2
-rw-r--r--common/usb_pd_protocol.c6
-rw-r--r--common/usbc/usb_tc_drp_acc_trysrc_sm.c9
3 files changed, 8 insertions, 9 deletions
diff --git a/common/usb_common.c b/common/usb_common.c
index a92b1e380f..ff8b39f47c 100644
--- a/common/usb_common.c
+++ b/common/usb_common.c
@@ -385,7 +385,7 @@ mux_state_t get_mux_mode_to_set(int port)
* If the SoC is down, then we disconnect the MUX to save power since
* no one cares about the data lines.
*/
- if (IS_ENABLED(CONFIG_POWER_COMMON) &&
+ if (IS_ENABLED(CONFIG_AP_POWER_CONTROL) &&
chipset_in_or_transitioning_to_state(CHIPSET_STATE_ANY_OFF))
return USB_PD_MUX_NONE;
diff --git a/common/usb_pd_protocol.c b/common/usb_pd_protocol.c
index c946f417f8..9179e53be3 100644
--- a/common/usb_pd_protocol.c
+++ b/common/usb_pd_protocol.c
@@ -2322,7 +2322,7 @@ __maybe_unused static void exit_supported_alt_mode(int port)
}
}
-#ifdef CONFIG_POWER_COMMON
+#ifdef CONFIG_AP_POWER_CONTROL
static void handle_new_power_state(int port)
{
if (chipset_in_or_transitioning_to_state(CHIPSET_STATE_ANY_OFF)) {
@@ -2341,7 +2341,7 @@ static void handle_new_power_state(int port)
/* Ensure mux is set properly after chipset transition */
set_usb_mux_with_current_data_role(port);
}
-#endif /* CONFIG_POWER_COMMON */
+#endif /* CONFIG_AP_POWER_CONTROL */
#ifdef CONFIG_USB_PD_DUAL_ROLE
enum pd_dual_role_states pd_get_dual_role(int port)
@@ -2955,7 +2955,7 @@ void pd_task(void *u)
if (evt & PD_EVENT_DEVICE_ACCESSED)
handle_device_access(port);
#endif
-#ifdef CONFIG_POWER_COMMON
+#ifdef CONFIG_AP_POWER_CONTROL
if (evt & PD_EVENT_POWER_STATE_CHANGE)
handle_new_power_state(port);
#endif
diff --git a/common/usbc/usb_tc_drp_acc_trysrc_sm.c b/common/usbc/usb_tc_drp_acc_trysrc_sm.c
index dc94dc12fc..c2394f8aa1 100644
--- a/common/usbc/usb_tc_drp_acc_trysrc_sm.c
+++ b/common/usbc/usb_tc_drp_acc_trysrc_sm.c
@@ -1768,12 +1768,10 @@ void tc_event_check(int port, int evt)
pd_dpm_request(port, DPM_REQUEST_HARD_RESET_SEND);
}
-#ifdef CONFIG_POWER_COMMON
- if (IS_ENABLED(CONFIG_POWER_COMMON)) {
+ if (IS_ENABLED(CONFIG_AP_POWER_CONTROL)) {
if (evt & PD_EVENT_POWER_STATE_CHANGE)
handle_new_power_state(port);
}
-#endif /* CONFIG_POWER_COMMON */
if (IS_ENABLED(CONFIG_USB_PD_ALT_MODE_DFP)) {
int i;
@@ -1892,10 +1890,11 @@ static void pd_update_dual_role_config(int port)
__maybe_unused static void handle_new_power_state(int port)
{
- if (!IS_ENABLED(CONFIG_POWER_COMMON))
+ if (!IS_ENABLED(CONFIG_AP_POWER_CONTROL))
assert(0);
- if (IS_ENABLED(CONFIG_POWER_COMMON) && IS_ENABLED(CONFIG_USB_PE_SM)) {
+ if (IS_ENABLED(CONFIG_AP_POWER_CONTROL) &&
+ IS_ENABLED(CONFIG_USB_PE_SM)) {
if (chipset_in_or_transitioning_to_state(
CHIPSET_STATE_ANY_OFF)) {
/*