ANDROID: usb: typce: tcpci: Add vendor hook for chip specific features

Needed to implement chip specific features that are not defined
in the Type-C spec.

OOT_bug:
Bug: 169213252
Bug: 168245874
Bug: 173252019
Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
Change-Id: Ibd7b9171f105321c3010fb5b0a67d76a91224800
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
Badhri Jagan Sridharan
2021-03-17 20:42:37 -07:00
committed by Greg Kroah-Hartman
parent 08879ea0d6
commit 1a93d556d7
3 changed files with 14 additions and 0 deletions

View File

@@ -213,3 +213,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_show_mem);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_print_slabinfo_header);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cache_show);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_typec_tcpci_override_toggling);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_typec_tcpci_check_contaminant);

View File

@@ -426,6 +426,15 @@ static int tcpci_get_vbus(struct tcpc_dev *tcpc)
return !!(reg & TCPC_POWER_STATUS_VBUS_PRES);
}
static int tcpci_check_contaminant(struct tcpc_dev *tcpc)
{
struct tcpci *tcpci = tcpc_to_tcpci(tcpc);
int ret = 0;
trace_android_vh_typec_tcpci_check_contaminant(tcpci, tcpci->data, &ret);
return ret;
}
static bool tcpci_is_vbus_vsafe0v(struct tcpc_dev *tcpc)
{
struct tcpci *tcpci = tcpc_to_tcpci(tcpc);
@@ -744,6 +753,7 @@ struct tcpci *tcpci_register_port(struct device *dev, struct tcpci_data *data)
tcpci->tcpc.enable_frs = tcpci_enable_frs;
tcpci->tcpc.frs_sourcing_vbus = tcpci_frs_sourcing_vbus;
tcpci->tcpc.set_partner_usb_comm_capable = tcpci_set_partner_usb_comm_capable;
tcpci->tcpc.check_contaminant = tcpci_check_contaminant;
if (tcpci->data->auto_discharge_disconnect) {
tcpci->tcpc.enable_auto_vbus_discharge = tcpci_enable_auto_vbus_discharge;

View File

@@ -17,6 +17,9 @@ DECLARE_HOOK(android_vh_typec_tcpci_override_toggling,
TP_PROTO(struct tcpci *tcpci, struct tcpci_data *data, int *override_toggling),
TP_ARGS(tcpci, data, override_toggling));
DECLARE_HOOK(android_vh_typec_tcpci_check_contaminant,
TP_PROTO(struct tcpci *tcpci, struct tcpci_data *data, int *ret),
TP_ARGS(tcpci, data, ret));
#endif /* _TRACE_HOOK_UFSHCD_H */
/* This part must be outside protection */
#include <trace/define_trace.h>