1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * Driver for TI TPS6598x USB Power Delivery controller family
4  *
5  * Copyright (C) 2020 Purism SPC
6  * Author: Guido Günther <agx@sigxcpu.org>
7  */
8 
9 #undef TRACE_SYSTEM
10 #define TRACE_SYSTEM tps6598x
11 
12 #if !defined(_TPS6598X_TRACE_H_) || defined(TRACE_HEADER_MULTI_READ)
13 #define _TPS6598X_TRACE_H_
14 
15 #include "tps6598x.h"
16 
17 #include <linux/stringify.h>
18 #include <linux/types.h>
19 #include <linux/tracepoint.h>
20 
21 #define show_irq_flags(flags) \
22 	__print_flags_u64(flags, "|", \
23 		{ TPS_REG_INT_PD_SOFT_RESET,			"PD_SOFT_RESET" }, \
24 		{ TPS_REG_INT_HARD_RESET,			"HARD_RESET" }, \
25 		{ TPS_REG_INT_PLUG_EVENT,			"PLUG_EVENT" }, \
26 		{ TPS_REG_INT_PR_SWAP_COMPLETE,			"PR_SWAP_COMPLETE" }, \
27 		{ TPS_REG_INT_DR_SWAP_COMPLETE,			"DR_SWAP_COMPLETE" }, \
28 		{ TPS_REG_INT_RDO_RECEIVED_FROM_SINK,		"RDO_RECEIVED_FROM_SINK" }, \
29 		{ TPS_REG_INT_BIST,				"BIST" }, \
30 		{ TPS_REG_INT_OVERCURRENT,			"OVERCURRENT" }, \
31 		{ TPS_REG_INT_ATTENTION_RECEIVED,		"ATTENTION_RECEIVED" }, \
32 		{ TPS_REG_INT_VDM_RECEIVED,			"VDM_RECEIVED" }, \
33 		{ TPS_REG_INT_NEW_CONTRACT_AS_CONSUMER,		"NEW_CONTRACT_AS_CONSUMER" }, \
34 		{ TPS_REG_INT_NEW_CONTRACT_AS_PROVIDER,		"NEW_CONTRACT_AS_PROVIDER" }, \
35 		{ TPS_REG_INT_SOURCE_CAP_MESSAGE_READY,		"SOURCE_CAP_MESSAGE_READY" }, \
36 		{ TPS_REG_INT_SINK_CAP_MESSAGE_READY,		"SINK_CAP_MESSAGE_READY" }, \
37 		{ TPS_REG_INT_PR_SWAP_REQUESTED,		"PR_SWAP_REQUESTED" }, \
38 		{ TPS_REG_INT_GOTO_MIN_RECEIVED,		"GOTO_MIN_RECEIVED" }, \
39 		{ TPS_REG_INT_USB_HOST_PRESENT,			"USB_HOST_PRESENT" }, \
40 		{ TPS_REG_INT_USB_HOST_PRESENT_NO_LONGER,	"USB_HOST_PRESENT_NO_LONGER" }, \
41 		{ TPS_REG_INT_HIGH_VOLTAGE_WARNING,		"HIGH_VOLTAGE_WARNING" }, \
42 		{ TPS_REG_INT_PP_SWITCH_CHANGED,		"PP_SWITCH_CHANGED" }, \
43 		{ TPS_REG_INT_POWER_STATUS_UPDATE,		"POWER_STATUS_UPDATE" }, \
44 		{ TPS_REG_INT_DATA_STATUS_UPDATE,		"DATA_STATUS_UPDATE" }, \
45 		{ TPS_REG_INT_STATUS_UPDATE,			"STATUS_UPDATE" }, \
46 		{ TPS_REG_INT_PD_STATUS_UPDATE,			"PD_STATUS_UPDATE" }, \
47 		{ TPS_REG_INT_ADC_LOW_THRESHOLD,		"ADC_LOW_THRESHOLD" }, \
48 		{ TPS_REG_INT_ADC_HIGH_THRESHOLD,		"ADC_HIGH_THRESHOLD" }, \
49 		{ TPS_REG_INT_CMD1_COMPLETE,			"CMD1_COMPLETE" }, \
50 		{ TPS_REG_INT_CMD2_COMPLETE,			"CMD2_COMPLETE" }, \
51 		{ TPS_REG_INT_ERROR_DEVICE_INCOMPATIBLE,	"ERROR_DEVICE_INCOMPATIBLE" }, \
52 		{ TPS_REG_INT_ERROR_CANNOT_PROVIDE_PWR,		"ERROR_CANNOT_PROVIDE_PWR" }, \
53 		{ TPS_REG_INT_ERROR_CAN_PROVIDE_PWR_LATER,	"ERROR_CAN_PROVIDE_PWR_LATER" }, \
54 		{ TPS_REG_INT_ERROR_POWER_EVENT_OCCURRED,	"ERROR_POWER_EVENT_OCCURRED" }, \
55 		{ TPS_REG_INT_ERROR_MISSING_GET_CAP_MESSAGE,	"ERROR_MISSING_GET_CAP_MESSAGE" }, \
56 		{ TPS_REG_INT_ERROR_PROTOCOL_ERROR,		"ERROR_PROTOCOL_ERROR" }, \
57 		{ TPS_REG_INT_ERROR_MESSAGE_DATA,		"ERROR_MESSAGE_DATA" }, \
58 		{ TPS_REG_INT_ERROR_DISCHARGE_FAILED,		"ERROR_DISCHARGE_FAILED" }, \
59 		{ TPS_REG_INT_SRC_TRANSITION,			"SRC_TRANSITION" }, \
60 		{ TPS_REG_INT_ERROR_UNABLE_TO_SOURCE,		"ERROR_UNABLE_TO_SOURCE" }, \
61 		{ TPS_REG_INT_VDM_ENTERED_MODE,			"VDM_ENTERED_MODE" }, \
62 		{ TPS_REG_INT_VDM_MSG_SENT,			"VDM_MSG_SENT" }, \
63 		{ TPS_REG_INT_DISCOVER_MODES_COMPLETE,		"DISCOVER_MODES_COMPLETE" }, \
64 		{ TPS_REG_INT_EXIT_MODES_COMPLETE,		"EXIT_MODES_COMPLETE" }, \
65 		{ TPS_REG_INT_USER_VID_ALT_MODE_ENTERED,	"USER_VID_ALT_MODE_ENTERED" }, \
66 		{ TPS_REG_INT_USER_VID_ALT_MODE_EXIT,		"USER_VID_ALT_MODE_EXIT" }, \
67 		{ TPS_REG_INT_USER_VID_ALT_MODE_ATTN_VDM,	"USER_VID_ALT_MODE_ATTN_VDM" }, \
68 		{ TPS_REG_INT_USER_VID_ALT_MODE_OTHER_VDM,	"USER_VID_ALT_MODE_OTHER_VDM" })
69 
70 #define show_cd321x_irq_flags(flags) \
71 	__print_flags_u64(flags, "|", \
72 		{ APPLE_CD_REG_INT_PLUG_EVENT,			"PLUG_EVENT" }, \
73 		{ APPLE_CD_REG_INT_POWER_STATUS_UPDATE,		"POWER_STATUS_UPDATE" }, \
74 		{ APPLE_CD_REG_INT_DATA_STATUS_UPDATE,		"DATA_STATUS_UPDATE" }, \
75 		{ APPLE_CD_REG_INT_STATUS_UPDATE,		"STATUS_UPDATE" })
76 
77 #define show_tps25750_irq_flags(flags) \
78 	__print_flags_u64(flags, "|", \
79 		{ TPS_REG_INT_PLUG_EVENT,			"PLUG_EVENT" }, \
80 		{ TPS_REG_INT_POWER_STATUS_UPDATE,		"POWER_STATUS_UPDATE" }, \
81 		{ TPS_REG_INT_STATUS_UPDATE,			"STATUS_UPDATE" }, \
82 		{ TPS_REG_INT_PD_STATUS_UPDATE,			"PD_STATUS_UPDATE" })
83 
84 #define TPS6598X_STATUS_FLAGS_MASK (GENMASK(31, 0) ^ (TPS_STATUS_CONN_STATE_MASK | \
85 						      TPS_STATUS_PP_5V0_SWITCH_MASK | \
86 						      TPS_STATUS_PP_HV_SWITCH_MASK | \
87 						      TPS_STATUS_PP_EXT_SWITCH_MASK | \
88 						      TPS_STATUS_PP_CABLE_SWITCH_MASK | \
89 						      TPS_STATUS_POWER_SOURCE_MASK | \
90 						      TPS_STATUS_VBUS_STATUS_MASK | \
91 						      TPS_STATUS_USB_HOST_PRESENT_MASK | \
92 						      TPS_STATUS_LEGACY_MASK))
93 
94 #define TPS25750_STATUS_FLAGS_MASK (GENMASK(31, 0) ^ (TPS_STATUS_CONN_STATE_MASK | \
95 						      GENMASK(19, 7) | \
96 						      TPS_STATUS_VBUS_STATUS_MASK | \
97 						      TPS_STATUS_USB_HOST_PRESENT_MASK | \
98 						      TPS_STATUS_LEGACY_MASK | \
99 						      BIT(26) | \
100 						      GENMASK(31, 28)))
101 
102 #define show_status_conn_state(status) \
103 	__print_symbolic(TPS_STATUS_CONN_STATE((status)), \
104 		{ TPS_STATUS_CONN_STATE_CONN_WITH_R_A,	"conn-Ra"  }, \
105 		{ TPS_STATUS_CONN_STATE_CONN_NO_R_A,	"conn-no-Ra" }, \
106 		{ TPS_STATUS_CONN_STATE_NO_CONN_R_A,	"no-conn-Ra" },	\
107 		{ TPS_STATUS_CONN_STATE_DEBUG_CONN,	"debug"	 }, \
108 		{ TPS_STATUS_CONN_STATE_AUDIO_CONN,	"audio"	 }, \
109 		{ TPS_STATUS_CONN_STATE_DISABLED,	"disabled" }, \
110 		{ TPS_STATUS_CONN_STATE_NO_CONN,	"no-conn" })
111 
112 #define show_status_pp_switch_state(status) \
113 	__print_symbolic(status, \
114 		{ TPS_STATUS_PP_SWITCH_STATE_IN,	"in" }, \
115 		{ TPS_STATUS_PP_SWITCH_STATE_OUT,	"out" }, \
116 		{ TPS_STATUS_PP_SWITCH_STATE_FAULT,	"fault" }, \
117 		{ TPS_STATUS_PP_SWITCH_STATE_DISABLED,	"off" })
118 
119 #define show_status_power_sources(status) \
120 	__print_symbolic(TPS_STATUS_POWER_SOURCE(status), \
121 		{ TPS_STATUS_POWER_SOURCE_VBUS,		"vbus" }, \
122 		{ TPS_STATUS_POWER_SOURCE_VIN_3P3,	"vin-3p3" }, \
123 		{ TPS_STATUS_POWER_SOURCE_DEAD_BAT,	"dead-battery" }, \
124 		{ TPS_STATUS_POWER_SOURCE_UNKNOWN,	"unknown" })
125 
126 #define show_status_vbus_status(status) \
127 	__print_symbolic(TPS_STATUS_VBUS_STATUS(status), \
128 		{ TPS_STATUS_VBUS_STATUS_VSAFE0V,	"vSafe0V" }, \
129 		{ TPS_STATUS_VBUS_STATUS_VSAFE5V,	"vSafe5V" }, \
130 		{ TPS_STATUS_VBUS_STATUS_PD,		"pd" }, \
131 		{ TPS_STATUS_VBUS_STATUS_FAULT,		"fault" })
132 
133 #define show_status_usb_host_present(status) \
134 	__print_symbolic(TPS_STATUS_USB_HOST_PRESENT(status), \
135 		{ TPS_STATUS_USB_HOST_PRESENT_PD_USB,	 "pd-usb" }, \
136 		{ TPS_STATUS_USB_HOST_PRESENT_NO_PD,	 "no-pd" }, \
137 		{ TPS_STATUS_USB_HOST_PRESENT_PD_NO_USB, "pd-no-usb" }, \
138 		{ TPS_STATUS_USB_HOST_PRESENT_NO,	 "no" })
139 
140 #define show_status_legacy(status) \
141 	__print_symbolic(TPS_STATUS_LEGACY(status),	     \
142 		{ TPS_STATUS_LEGACY_SOURCE,		 "source" }, \
143 		{ TPS_STATUS_LEGACY_SINK,		 "sink" }, \
144 		{ TPS_STATUS_LEGACY_NO,			 "no" })
145 
146 #define show_status_flags(flags) \
147 	__print_flags((flags & TPS6598X_STATUS_FLAGS_MASK), "|", \
148 		      { TPS_STATUS_PLUG_PRESENT,	"PLUG_PRESENT" }, \
149 		      { TPS_STATUS_PLUG_UPSIDE_DOWN,	"UPSIDE_DOWN" }, \
150 		      { TPS_STATUS_PORTROLE,		"PORTROLE" }, \
151 		      { TPS_STATUS_DATAROLE,		"DATAROLE" }, \
152 		      { TPS_STATUS_VCONN,		"VCONN" }, \
153 		      { TPS_STATUS_OVERCURRENT,		"OVERCURRENT" }, \
154 		      { TPS_STATUS_GOTO_MIN_ACTIVE,	"GOTO_MIN_ACTIVE" }, \
155 		      { TPS_STATUS_BIST,		"BIST" }, \
156 		      { TPS_STATUS_HIGH_VOLAGE_WARNING,	"HIGH_VOLAGE_WARNING" }, \
157 		      { TPS_STATUS_HIGH_LOW_VOLTAGE_WARNING, "HIGH_LOW_VOLTAGE_WARNING" })
158 
159 #define show_tps25750_status_flags(flags) \
160 	__print_flags((flags & TPS25750_STATUS_FLAGS_MASK), "|", \
161 		      { TPS_STATUS_PLUG_PRESENT,	"PLUG_PRESENT" }, \
162 		      { TPS_STATUS_PLUG_UPSIDE_DOWN,	"UPSIDE_DOWN" }, \
163 		      { TPS_STATUS_PORTROLE,		"PORTROLE" }, \
164 		      { TPS_STATUS_DATAROLE,		"DATAROLE" }, \
165 		      { TPS_STATUS_BIST,		"BIST" })
166 
167 #define show_power_status_source_sink(power_status) \
168 	__print_symbolic(TPS_POWER_STATUS_SOURCESINK(power_status), \
169 		{ 1, "sink" }, \
170 		{ 0, "source" })
171 
172 #define show_power_status_typec_status(power_status) \
173 	__print_symbolic(TPS_POWER_STATUS_PWROPMODE(power_status), \
174 		{ TPS_POWER_STATUS_TYPEC_CURRENT_PD,  "pd" }, \
175 		{ TPS_POWER_STATUS_TYPEC_CURRENT_3A0, "3.0A" }, \
176 		{ TPS_POWER_STATUS_TYPEC_CURRENT_1A5, "1.5A" }, \
177 		{ TPS_POWER_STATUS_TYPEC_CURRENT_USB, "usb" })
178 
179 #define show_power_status_bc12_status(power_status) \
180 	__print_symbolic(TPS_POWER_STATUS_BC12_STATUS(power_status), \
181 		{ TPS_POWER_STATUS_BC12_STATUS_DCP, "dcp" }, \
182 		{ TPS_POWER_STATUS_BC12_STATUS_CDP, "cdp" }, \
183 		{ TPS_POWER_STATUS_BC12_STATUS_SDP, "sdp" })
184 
185 #define show_tps25750_power_status_charger_detect_status(power_status) \
186 	__print_symbolic(TPS25750_POWER_STATUS_CHARGER_DETECT_STATUS(power_status), \
187 		{ TPS25750_POWER_STATUS_CHARGER_DET_STATUS_DISABLED,	"disabled"}, \
188 		{ TPS25750_POWER_STATUS_CHARGER_DET_STATUS_IN_PROGRESS,	"in progress"}, \
189 		{ TPS25750_POWER_STATUS_CHARGER_DET_STATUS_NONE,	"none"}, \
190 		{ TPS25750_POWER_STATUS_CHARGER_DET_STATUS_SPD,		"spd"}, \
191 		{ TPS25750_POWER_STATUS_CHARGER_DET_STATUS_BC_1_2_CPD,	"cpd"}, \
192 		{ TPS25750_POWER_STATUS_CHARGER_DET_STATUS_BC_1_2_DPD,	"dpd"}, \
193 		{ TPS25750_POWER_STATUS_CHARGER_DET_STATUS_DIV_1_DCP,	"divider 1 dcp"}, \
194 		{ TPS25750_POWER_STATUS_CHARGER_DET_STATUS_DIV_2_DCP,	"divider 2 dcp"}, \
195 		{ TPS25750_POWER_STATUS_CHARGER_DET_STATUS_DIV_3_DCP,	"divider 3 dpc"}, \
196 		{ TPS25750_POWER_STATUS_CHARGER_DET_STATUS_1_2V_DCP,	"1.2V dpc"})
197 
198 #define TPS_DATA_STATUS_FLAGS_MASK (GENMASK(31, 0) ^ (TPS_DATA_STATUS_DP_PIN_ASSIGNMENT_MASK | \
199 						      TPS_DATA_STATUS_TBT_CABLE_SPEED_MASK | \
200 						      TPS_DATA_STATUS_TBT_CABLE_GEN_MASK))
201 
202 #define show_data_status_flags(data_status) \
203 	__print_flags(data_status & TPS_DATA_STATUS_FLAGS_MASK, "|", \
204 		{ TPS_DATA_STATUS_DATA_CONNECTION,	"DATA_CONNECTION" }, \
205 		{ TPS_DATA_STATUS_UPSIDE_DOWN,		"DATA_UPSIDE_DOWN" }, \
206 		{ TPS_DATA_STATUS_ACTIVE_CABLE,		"ACTIVE_CABLE" }, \
207 		{ TPS_DATA_STATUS_USB2_CONNECTION,	"USB2_CONNECTION" }, \
208 		{ TPS_DATA_STATUS_USB3_CONNECTION,	"USB3_CONNECTION" }, \
209 		{ TPS_DATA_STATUS_USB3_GEN2,		"USB3_GEN2" }, \
210 		{ TPS_DATA_STATUS_USB_DATA_ROLE,	"USB_DATA_ROLE" }, \
211 		{ TPS_DATA_STATUS_DP_CONNECTION,	"DP_CONNECTION" }, \
212 		{ TPS_DATA_STATUS_DP_SINK,		"DP_SINK" }, \
213 		{ TPS_DATA_STATUS_TBT_CONNECTION,	"TBT_CONNECTION" }, \
214 		{ TPS_DATA_STATUS_TBT_TYPE,		"TBT_TYPE" }, \
215 		{ TPS_DATA_STATUS_OPTICAL_CABLE,	"OPTICAL_CABLE" }, \
216 		{ TPS_DATA_STATUS_ACTIVE_LINK_TRAIN,	"ACTIVE_LINK_TRAIN" }, \
217 		{ TPS_DATA_STATUS_FORCE_LSX,		"FORCE_LSX" }, \
218 		{ TPS_DATA_STATUS_POWER_MISMATCH,	"POWER_MISMATCH" })
219 
220 #define show_data_status_dp_pin_assignment(data_status) \
221 	__print_symbolic(TPS_DATA_STATUS_DP_SPEC_PIN_ASSIGNMENT(data_status), \
222 		{ TPS_DATA_STATUS_DP_SPEC_PIN_ASSIGNMENT_E, "E" }, \
223 		{ TPS_DATA_STATUS_DP_SPEC_PIN_ASSIGNMENT_F, "F" }, \
224 		{ TPS_DATA_STATUS_DP_SPEC_PIN_ASSIGNMENT_C, "C" }, \
225 		{ TPS_DATA_STATUS_DP_SPEC_PIN_ASSIGNMENT_D, "D" }, \
226 		{ TPS_DATA_STATUS_DP_SPEC_PIN_ASSIGNMENT_A, "A" }, \
227 		{ TPS_DATA_STATUS_DP_SPEC_PIN_ASSIGNMENT_B, "B" })
228 
229 #define maybe_show_data_status_dp_pin_assignment(data_status) \
230 	(data_status & TPS_DATA_STATUS_DP_CONNECTION ? \
231 	 show_data_status_dp_pin_assignment(data_status) : "")
232 
233 TRACE_EVENT(tps6598x_irq,
234 	    TP_PROTO(u64 event1,
235 		     u64 event2),
236 	    TP_ARGS(event1, event2),
237 
238 	    TP_STRUCT__entry(
239 			     __field(u64, event1)
240 			     __field(u64, event2)
241 			     ),
242 
243 	    TP_fast_assign(
244 			   __entry->event1 = event1;
245 			   __entry->event2 = event2;
246 			   ),
247 
248 	    TP_printk("event1=%s, event2=%s",
249 		      show_irq_flags(__entry->event1),
250 		      show_irq_flags(__entry->event2))
251 );
252 
253 TRACE_EVENT(cd321x_irq,
254 	    TP_PROTO(u64 event),
255 	    TP_ARGS(event),
256 
257 	    TP_STRUCT__entry(
258 			     __field(u64, event)
259 			     ),
260 
261 	    TP_fast_assign(
262 			   __entry->event = event;
263 			   ),
264 
265 	    TP_printk("event=%s",
266 		      show_cd321x_irq_flags(__entry->event))
267 );
268 
269 TRACE_EVENT(tps25750_irq,
270 	    TP_PROTO(u64 event),
271 	    TP_ARGS(event),
272 
273 	    TP_STRUCT__entry(
274 			     __field(u64, event)
275 			     ),
276 
277 	    TP_fast_assign(
278 			   __entry->event = event;
279 			   ),
280 
281 	    TP_printk("event=%s", show_tps25750_irq_flags(__entry->event))
282 );
283 
284 TRACE_EVENT(tps6598x_status,
285 	    TP_PROTO(u32 status),
286 	    TP_ARGS(status),
287 
288 	    TP_STRUCT__entry(
289 			     __field(u32, status)
290 			     ),
291 
292 	    TP_fast_assign(
293 			   __entry->status = status;
294 			   ),
295 
296 	    TP_printk("conn: %s, pp_5v0: %s, pp_hv: %s, pp_ext: %s, pp_cable: %s, "
297 		      "pwr-src: %s, vbus: %s, usb-host: %s, legacy: %s, flags: %s",
298 		      show_status_conn_state(__entry->status),
299 		      show_status_pp_switch_state(TPS_STATUS_PP_5V0_SWITCH(__entry->status)),
300 		      show_status_pp_switch_state(TPS_STATUS_PP_HV_SWITCH(__entry->status)),
301 		      show_status_pp_switch_state(TPS_STATUS_PP_EXT_SWITCH(__entry->status)),
302 		      show_status_pp_switch_state(TPS_STATUS_PP_CABLE_SWITCH(__entry->status)),
303 		      show_status_power_sources(__entry->status),
304 		      show_status_vbus_status(__entry->status),
305 		      show_status_usb_host_present(__entry->status),
306 		      show_status_legacy(__entry->status),
307 		      show_status_flags(__entry->status)
308 		    )
309 );
310 
311 TRACE_EVENT(tps25750_status,
312 	    TP_PROTO(u32 status),
313 	    TP_ARGS(status),
314 
315 	    TP_STRUCT__entry(
316 			     __field(u32, status)
317 			     ),
318 
319 	    TP_fast_assign(
320 			   __entry->status = status;
321 			   ),
322 
323 	    TP_printk("conn: %s, vbus: %s, usb-host: %s, legacy: %s, flags: %s",
324 		      show_status_conn_state(__entry->status),
325 		      show_status_vbus_status(__entry->status),
326 		      show_status_usb_host_present(__entry->status),
327 		      show_status_legacy(__entry->status),
328 		      show_tps25750_status_flags(__entry->status)
329 		    )
330 );
331 
332 TRACE_EVENT(tps6598x_power_status,
333 	    TP_PROTO(u16 power_status),
334 	    TP_ARGS(power_status),
335 
336 	    TP_STRUCT__entry(
337 			     __field(u16, power_status)
338 			     ),
339 
340 	    TP_fast_assign(
341 			   __entry->power_status = power_status;
342 			   ),
343 
344 	    TP_printk("conn: %d, pwr-role: %s, typec: %s, bc: %s",
345 		      !!TPS_POWER_STATUS_CONNECTION(__entry->power_status),
346 		      show_power_status_source_sink(__entry->power_status),
347 		      show_power_status_typec_status(__entry->power_status),
348 		      show_power_status_bc12_status(__entry->power_status)
349 		    )
350 );
351 
352 TRACE_EVENT(tps25750_power_status,
353 	    TP_PROTO(u16 power_status),
354 	    TP_ARGS(power_status),
355 
356 	    TP_STRUCT__entry(
357 			     __field(u16, power_status)
358 			     ),
359 
360 	    TP_fast_assign(
361 			   __entry->power_status = power_status;
362 			   ),
363 
364 	    TP_printk("conn: %d, pwr-role: %s, typec: %s, charger detect: %s",
365 		      !!TPS_POWER_STATUS_CONNECTION(__entry->power_status),
366 		      show_power_status_source_sink(__entry->power_status),
367 		      show_power_status_typec_status(__entry->power_status),
368 		      show_tps25750_power_status_charger_detect_status(__entry->power_status)
369 		    )
370 );
371 
372 TRACE_EVENT(tps6598x_data_status,
373 	    TP_PROTO(u32 data_status),
374 	    TP_ARGS(data_status),
375 
376 	    TP_STRUCT__entry(
377 			     __field(u32, data_status)
378 			     ),
379 
380 	    TP_fast_assign(
381 			   __entry->data_status = data_status;
382 			   ),
383 
384 	    TP_printk("%s%s%s",
385 		      show_data_status_flags(__entry->data_status),
386 		      __entry->data_status & TPS_DATA_STATUS_DP_CONNECTION ? ", DP pinout " : "",
387 		      maybe_show_data_status_dp_pin_assignment(__entry->data_status)
388 		    )
389 );
390 
391 #endif /* _TPS6598X_TRACE_H_ */
392 
393 /* This part must be outside protection */
394 #undef TRACE_INCLUDE_FILE
395 #define TRACE_INCLUDE_FILE trace
396 #undef TRACE_INCLUDE_PATH
397 #define TRACE_INCLUDE_PATH .
398 #include <trace/define_trace.h>
399