tcpm: Configure board specific post TCPC init

Some boards have TCPC configurations post TCPC initialization.
Added code to support those configurations.

BUG=b:64531818
BRANCH=glkrvp
TEST=Manually verified on GLKRVP. External GPIOs of PTN5110
     are configured properly.

Change-Id: I3da1c171839f22cf183dacf390cf033becddce0f
Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/624557
Commit-Ready: Vijay P Hiremath <vijay.p.hiremath@intel.com>
Tested-by: Vijay P Hiremath <vijay.p.hiremath@intel.com>
Reviewed-by: Shawn N <shawnn@chromium.org>
This commit is contained in:
Vijay Hiremath
2017-08-21 13:29:55 -07:00
committed by chrome-bot
parent 309289df45
commit 59ce941927
2 changed files with 20 additions and 1 deletions

View File

@@ -72,7 +72,17 @@ static inline void tcpc_lock(int port, int lock)
/* TCPM driver wrapper function */
static inline int tcpm_init(int port)
{
return tcpc_config[port].drv->init(port);
int rv;
rv = tcpc_config[port].drv->init(port);
if (rv)
return rv;
/* Board specific post TCPC init */
if (board_tcpc_post_init)
rv = board_tcpc_post_init(port);
return rv;
}
static inline int tcpm_release(int port)

View File

@@ -273,4 +273,13 @@ void tcpc_alert_clear(int port);
*/
int tcpc_run(int port, int evt);
/**
* Initialize board specific TCPC functions post TCPC initialization.
*
* @param port Type-C port number
*
* @return EC_SUCCESS or error
*/
int board_tcpc_post_init(int port) __attribute__((weak));
#endif /* __CROS_EC_USB_PD_TCPM_H */