diff options
-rw-r--r-- | common/usb_pd_tcpc.c | 10 | ||||
-rw-r--r-- | driver/tcpm/stub.c | 3 | ||||
-rw-r--r-- | test/usb_pd.c | 5 |
3 files changed, 17 insertions, 1 deletions
diff --git a/common/usb_pd_tcpc.c b/common/usb_pd_tcpc.c index db1722f2e6..491b471e22 100644 --- a/common/usb_pd_tcpc.c +++ b/common/usb_pd_tcpc.c @@ -970,6 +970,16 @@ int tcpc_get_cc(int port, int *cc1, int *cc2) return EC_SUCCESS; } +int board_select_rp_value(int port, int rp) __attribute__((weak)); + +int tcpc_select_rp_value(int port, int rp) +{ + if (board_select_rp_value) + return board_select_rp_value(port, rp); + else + return EC_ERROR_UNIMPLEMENTED; +} + int tcpc_set_polarity(int port, int polarity) { pd[port].polarity = polarity; diff --git a/driver/tcpm/stub.c b/driver/tcpm/stub.c index ae3f00f420..bb61c83024 100644 --- a/driver/tcpm/stub.c +++ b/driver/tcpm/stub.c @@ -15,6 +15,7 @@ extern int tcpc_alert_status(int port, int *alert); extern int tcpc_alert_status_clear(int port, uint16_t mask); extern int tcpc_alert_mask_set(int port, uint16_t mask); extern int tcpc_get_cc(int port, int *cc1, int *cc2); +extern int tcpc_select_rp_value(int port, int rp); extern int tcpc_set_cc(int port, int pull); extern int tcpc_set_polarity(int port, int polarity); extern int tcpc_set_power_status_mask(int port, uint8_t mask); @@ -68,7 +69,7 @@ int tcpm_get_cc(int port, int *cc1, int *cc2) int tcpm_select_rp_value(int port, int rp) { - return -EC_ERROR_UNIMPLEMENTED; + return tcpc_select_rp_value(port, rp); } int tcpm_set_cc(int port, int pull) diff --git a/test/usb_pd.c b/test/usb_pd.c index d87a4c3960..80c5d10885 100644 --- a/test/usb_pd.c +++ b/test/usb_pd.c @@ -72,6 +72,11 @@ int pd_vdm(int port, int cnt, uint32_t *payload, uint32_t **rpayload) return 0; } +int board_select_rp_value(int port, int rp) +{ + return 0; +} + /* Tests */ void inc_tx_id(int port) |