From 814bde1b0af78e4059397a0ef3ab1fc5304d4908 Mon Sep 17 00:00:00 2001 From: Eric Yilun Lin Date: Fri, 15 Oct 2021 17:36:28 +0800 Subject: dps: reset PD voltage when dps disabled. To enforce the PD voltage back to the default value, we have to force a new request. BUG=b:169532537 TEST=dps dis, and a new PD request is issued BRANCH=asurada Change-Id: I4c7d1d6019a9095099dc992411890e394c71b820 Signed-off-by: Eric Yilun Lin Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3229048 Reviewed-by: Aseda Aboagye Commit-Queue: Eric Yilun Lin Tested-by: Eric Yilun Lin --- common/dps.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/dps.c b/common/dps.c index 235f4d4e08..b627bce90d 100644 --- a/common/dps.c +++ b/common/dps.c @@ -558,6 +558,9 @@ static int command_dps(int argc, char **argv) return EC_SUCCESS; } else if (!strcasecmp(argv[1], "dis")) { dps_enable(false); + /* issue a new PD request for a default voltage */ + if (dps_port != CHARGE_PORT_NONE) + pd_dpm_request(dps_port, DPM_REQUEST_NEW_POWER_LEVEL); return EC_SUCCESS; } else if (!strcasecmp(argv[1], "fakepwr")) { if (argc == 2) { -- cgit v1.2.1