1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * Copyright (C) 2020 MediaTek Inc.
4  */
5 #undef TRACE_SYSTEM
6 #define TRACE_SYSTEM ufs_mtk
7 
8 #if !defined(_TRACE_EVENT_UFS_MEDIATEK_H) || defined(TRACE_HEADER_MULTI_READ)
9 #define _TRACE_EVENT_UFS_MEDIATEK_H
10 
11 #include <linux/tracepoint.h>
12 
13 TRACE_EVENT(ufs_mtk_event,
14 	TP_PROTO(unsigned int type, unsigned int data),
15 	TP_ARGS(type, data),
16 
17 	TP_STRUCT__entry(
18 		__field(unsigned int, type)
19 		__field(unsigned int, data)
20 	),
21 
22 	TP_fast_assign(
23 		__entry->type = type;
24 		__entry->data = data;
25 	),
26 
27 	TP_printk("ufs: event=%u data=%u",
28 		  __entry->type, __entry->data)
29 );
30 
31 TRACE_EVENT(ufs_mtk_clk_scale,
32 	TP_PROTO(const char *name, bool scale_up, unsigned long clk_rate),
33 	TP_ARGS(name, scale_up, clk_rate),
34 
35 	TP_STRUCT__entry(
36 		__field(const char*, name)
37 		__field(bool, scale_up)
38 		__field(unsigned long, clk_rate)
39 	),
40 
41 	TP_fast_assign(
42 		__entry->name = name;
43 		__entry->scale_up = scale_up;
44 		__entry->clk_rate = clk_rate;
45 	),
46 
47 	TP_printk("ufs: clk (%s) scaled %s @ %lu",
48 		  __entry->name,
49 		  __entry->scale_up ? "up" : "down",
50 		  __entry->clk_rate)
51 );
52 
53 #endif
54 
55 #undef TRACE_INCLUDE_PATH
56 #undef TRACE_INCLUDE_FILE
57 #define TRACE_INCLUDE_PATH ../../drivers/ufs/host
58 #define TRACE_INCLUDE_FILE ufs-mediatek-trace
59 #include <trace/define_trace.h>
60