From 0c7848ad95b4fdebda70365a74da76032466ab1f Mon Sep 17 00:00:00 2001 From: Boris Mittelberg Date: Thu, 20 Apr 2023 16:30:03 -0700 Subject: ktu1125: set polarity only when applying VCONN Makes set_polarity a no-op. CC polarity should only be set when VCONN is applied. BUG=b:278116464 BRANCH=none TEST=manual test on rex sku2 Change-Id: I27d818bb75a2d79ef74e6eb7976e6e896f93be1a Signed-off-by: Boris Mittelberg Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4455743 Reviewed-by: Diana Z Reviewed-by: Scott Collyer --- driver/ppc/ktu1125.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'driver') diff --git a/driver/ppc/ktu1125.c b/driver/ppc/ktu1125.c index 698c4f6cb1..647512d801 100644 --- a/driver/ppc/ktu1125.c +++ b/driver/ppc/ktu1125.c @@ -280,15 +280,12 @@ static int ktu1125_is_sourcing_vbus(int port) #ifdef CONFIG_USBC_PPC_POLARITY static int ktu1125_set_polarity(int port, int polarity) { - if (polarity) { - /* CC2 active. */ - clr_flags(port, KTU1125_CTRL_SW_CFG, KTU1125_CC2S_VCONN); - return set_flags(port, KTU1125_CTRL_SW_CFG, KTU1125_CC1S_VCONN); - } - - /* else CC1 active. */ - clr_flags(port, KTU1125_CTRL_SW_CFG, KTU1125_CC1S_VCONN); - return set_flags(port, KTU1125_CTRL_SW_CFG, KTU1125_CC2S_VCONN); + /* + * KTU1125 doesn't need to be informed about polarity. + * Polarity is queried via pd_get_polarity when applying VCONN. + */ + ppc_prints("KTU1125 sets polarity only when applying VCONN", port); + return EC_SUCCESS; } #endif -- cgit v1.2.1