3 #define TRACE_SYSTEM ucsi
5 #if !defined(__UCSI_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
8 #include <linux/tracepoint.h>
12 DECLARE_EVENT_CLASS(ucsi_log_ack,
21 TP_printk("ACK %s", ucsi_ack_str(__entry->ack))
24 DEFINE_EVENT(ucsi_log_ack, ucsi_ack,
29 DECLARE_EVENT_CLASS(ucsi_log_control,
30 TP_PROTO(struct ucsi_control *ctrl),
36 __entry->ctrl = ctrl->raw_cmd;
38 TP_printk("control=%08llx (%s)", __entry->ctrl,
39 ucsi_cmd_str(__entry->ctrl))
42 DEFINE_EVENT(ucsi_log_control, ucsi_command,
43 TP_PROTO(struct ucsi_control *ctrl),
47 DECLARE_EVENT_CLASS(ucsi_log_command,
48 TP_PROTO(struct ucsi_control *ctrl, int ret),
55 __entry->ctrl = ctrl->raw_cmd;
58 TP_printk("%s -> %s (err=%d)", ucsi_cmd_str(__entry->ctrl),
59 __entry->ret < 0 ? "FAIL" : "OK",
60 __entry->ret < 0 ? __entry->ret : 0)
63 DEFINE_EVENT(ucsi_log_command, ucsi_run_command,
64 TP_PROTO(struct ucsi_control *ctrl, int ret),
68 DEFINE_EVENT(ucsi_log_command, ucsi_reset_ppm,
69 TP_PROTO(struct ucsi_control *ctrl, int ret),
73 DECLARE_EVENT_CLASS(ucsi_log_cci,
82 TP_printk("CCI=%08x %s", __entry->cci, ucsi_cci_str(__entry->cci))
85 DEFINE_EVENT(ucsi_log_cci, ucsi_notify,
90 DECLARE_EVENT_CLASS(ucsi_log_connector_status,
91 TP_PROTO(int port, struct ucsi_connector_status *status),
92 TP_ARGS(port, status),
97 __field(u8, connected)
99 __field(u8, partner_flags)
100 __field(u8, partner_type)
101 __field(u32, request_data_obj)
102 __field(u8, bc_status)
105 __entry->port = port - 1;
106 __entry->change = status->change;
107 __entry->opmode = status->pwr_op_mode;
108 __entry->connected = status->connected;
109 __entry->pwr_dir = status->pwr_dir;
110 __entry->partner_flags = status->partner_flags;
111 __entry->partner_type = status->partner_type;
112 __entry->request_data_obj = status->request_data_obj;
113 __entry->bc_status = status->bc_status;
115 TP_printk("port%d status: change=%04x, opmode=%x, connected=%d, "
116 "sourcing=%d, partner_flags=%x, partner_type=%x, "
117 "request_data_obj=%08x, BC status=%x", __entry->port,
118 __entry->change, __entry->opmode, __entry->connected,
119 __entry->pwr_dir, __entry->partner_flags, __entry->partner_type,
120 __entry->request_data_obj, __entry->bc_status)
123 DEFINE_EVENT(ucsi_log_connector_status, ucsi_connector_change,
124 TP_PROTO(int port, struct ucsi_connector_status *status),
125 TP_ARGS(port, status)
128 DEFINE_EVENT(ucsi_log_connector_status, ucsi_register_port,
129 TP_PROTO(int port, struct ucsi_connector_status *status),
130 TP_ARGS(port, status)
133 #endif /* __UCSI_TRACE_H */
135 /* This part must be outside protection */
137 #undef TRACE_INCLUDE_PATH
138 #define TRACE_INCLUDE_PATH .
140 #undef TRACE_INCLUDE_FILE
141 #define TRACE_INCLUDE_FILE trace
143 #include <trace/define_trace.h>