summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Collyer <scollyer@google.com>2023-05-11 19:40:20 -0700
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-05-15 17:41:12 +0000
commitbfaf5b4b479fd3b4ef713d6e9e85392dc2652467 (patch)
tree0208fd56ce92845fda79dfaf6507a6427694fe41
parent8d1ea27042db3f86cdf05fea26423864caf04d4b (diff)
downloadchrome-ec-bfaf5b4b479fd3b4ef713d6e9e85392dc2652467.tar.gz
ppc: ktu1125: Fix register used for VCONN control
The register that was being used to enable/disable VCONN (KTU1125_SET_SW_CFG) was incorrect. It should be KTU1125_CTRL_SW_CFG. In addition, VCONN was being applied to wrong CC line. KTU1125_CC1S_VCONN --> applies VCONN to CC1 when the polarity is CC2 KTU1125_CC2S_VCONN --> applies VCONN to CC2 when the polarity is CC1 BUG=b:267589112 TEST=Verfied using totalphase that VCONN is being enabled and the CC voltage of the CC data line is correct. Change-Id: I45c85800849dbabeac36d976525de7d058ad23f4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4519354 Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Reviewed-by: Boris Mittelberg <bmbm@google.com> Commit-Queue: Scott Collyer <scollyer@chromium.org>
-rw-r--r--driver/ppc/ktu1125.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/driver/ppc/ktu1125.c b/driver/ppc/ktu1125.c
index 647512d801..24b03e8538 100644
--- a/driver/ppc/ktu1125.c
+++ b/driver/ppc/ktu1125.c
@@ -348,11 +348,15 @@ static int ktu1125_set_vconn(int port, int enable)
polarity = polarity_rm_dts(pd_get_polarity(port));
if (enable) {
- flags |= polarity ? KTU1125_CC2S_VCONN : KTU1125_CC1S_VCONN;
- status = set_flags(port, KTU1125_SET_SW_CFG, flags);
+ /*
+ * If polarity is CC1, then apply VCONN on CC2.
+ * else if polarity is CC2, then apply VCONN on CC1
+ */
+ flags |= polarity ? KTU1125_CC1S_VCONN : KTU1125_CC2S_VCONN;
+ status = set_flags(port, KTU1125_CTRL_SW_CFG, flags);
} else {
flags |= KTU1125_CC1S_VCONN | KTU1125_CC2S_VCONN;
- status = clr_flags(port, KTU1125_SET_SW_CFG, flags);
+ status = clr_flags(port, KTU1125_CTRL_SW_CFG, flags);
}
return status;