summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDeepti Deshatty <deepti.deshatty@intel.corp-partner.google.com>2022-12-14 14:23:17 +0530
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-12-15 02:15:35 +0000
commitf672c6d633a40e5390c6113f0b4bb684ffd719f9 (patch)
tree3fdd643b84b7a613571fdc4f0d242441a5299b3c
parent823f3287e09d1cf271d6259615fdff50198f935f (diff)
downloadchrome-ec-f672c6d633a40e5390c6113f0b4bb684ffd719f9.tar.gz
nissa: allow Vconn swap only if 5V power rails are enabled
change allows port Vconn swap only if the platform power rails are up and stable. Without this change "hard resets" are seen in S5 power state while enumerating typec device on boot. BUG=b:258143457 TEST=Typec Dock enumeration verified on craask. BRANCH=none Change-Id: Ia6c80d05879ad7da61363b4bedb8ee5aeb8cc16e Signed-off-by: Deepti Deshatty <deepti.deshatty@intel.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4105949 Reviewed-by: Vijay P Hiremath <vijay.p.hiremath@intel.com> Reviewed-by: Andrew McRae <amcrae@google.com> Code-Coverage: Andrew McRae <amcrae@google.com>
-rw-r--r--zephyr/program/nissa/src/common.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/zephyr/program/nissa/src/common.c b/zephyr/program/nissa/src/common.c
index 2d2602655a..e03b82bca3 100644
--- a/zephyr/program/nissa/src/common.c
+++ b/zephyr/program/nissa/src/common.c
@@ -51,8 +51,11 @@ DECLARE_HOOK(HOOK_INIT, board_setup_init, HOOK_PRIO_INIT_I2C);
int pd_check_vconn_swap(int port)
{
- /* Allow VCONN swaps if the AP is on. */
- return chipset_in_state(CHIPSET_STATE_ANY_SUSPEND | CHIPSET_STATE_ON);
+ /* Do not allow vconn swap if 5V rail is off. */
+ const struct gpio_dt_spec *const ec_soc_dsw_pwrok_gpio =
+ GPIO_DT_FROM_NODELABEL(gpio_ec_soc_dsw_pwrok);
+
+ return gpio_pin_get_dt(ec_soc_dsw_pwrok_gpio);
}
/*