summaryrefslogtreecommitdiff
path: root/driver/ppc
diff options
context:
space:
mode:
authorEric Yilun Lin <yllin@chromium.org>2021-12-09 16:55:01 +0800
committerCommit Bot <commit-bot@chromium.org>2021-12-23 05:41:19 +0000
commit78c5a71af9054a69219f3832b5eb640cf2e6e899 (patch)
tree3895e3947c5a6c73d0de502e894042dede74d977 /driver/ppc
parent5785c1dbb935f9cdca7b2591517db6a1135978f2 (diff)
downloadchrome-ec-78c5a71af9054a69219f3832b5eb640cf2e6e899.tar.gz
rt1718s: support FRS detection at TCPC driver
Make set_frs_enable() available at TCPC driver as well. BUG=b:209924385 TEST=make buildall BRANCH=none Change-Id: Ia52185ce91bdc7e989779738f9eb4c9020db2901 Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3325865 Tested-by: Eric Yilun Lin <yllin@google.com> Auto-Submit: Eric Yilun Lin <yllin@google.com> Reviewed-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org>
Diffstat (limited to 'driver/ppc')
-rw-r--r--driver/ppc/rt1718s.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/driver/ppc/rt1718s.c b/driver/ppc/rt1718s.c
index 96cb789cd0..68bd1aad16 100644
--- a/driver/ppc/rt1718s.c
+++ b/driver/ppc/rt1718s.c
@@ -169,15 +169,20 @@ static int rt1718s_is_vbus_present(int port)
}
#endif
+int rt1718s_frs_init(int port)
+{
+ /* Set Rx frs unmasked */
+ RETURN_ERROR(update_bits(port, RT1718S_RT_MASK1,
+ RT1718S_RT_MASK1_M_RX_FRS, 0xFF));
+ return EC_SUCCESS;
+}
+
static int rt1718s_init(int port)
{
atomic_clear(&flags[port]);
if (IS_ENABLED(CONFIG_USB_PD_FRS_PPC))
- /* Set Rx frs unmasked */
- RETURN_ERROR(update_bits(port, RT1718S_RT_MASK1,
- RT1718S_RT_MASK1_M_RX_FRS,
- 0xFF));
+ RETURN_ERROR(rt1718s_frs_init(port));
return EC_SUCCESS;
}
@@ -189,8 +194,7 @@ static int rt1718s_set_polarity(int port, int polarity)
}
#endif
-#ifdef CONFIG_USB_PD_FRS_PPC
-static int rt1718s_set_frs_enable(int port, int enable)
+int rt1718s_set_frs_enable(int port, int enable)
{
/*
* Use write instead of update to save 2 i2c read.
@@ -210,7 +214,6 @@ static int rt1718s_set_frs_enable(int port, int enable)
RETURN_ERROR(write_reg(port, RT1718S_VBUS_CTRL_EN, vbus_ctrl_en));
return EC_SUCCESS;
}
-#endif
const struct ppc_drv rt1718s_ppc_drv = {
.init = &rt1718s_init,