1 /* SPDX-License-Identifier: GPL-2.0-or-later */
4 #define TRACE_SYSTEM fsi_master_i2cr
6 #if !defined(_TRACE_FSI_MASTER_I2CR_H) || defined(TRACE_HEADER_MULTI_READ)
7 #define _TRACE_FSI_MASTER_I2CR_H
9 #include <linux/tracepoint.h>
11 TRACE_EVENT(i2cr_i2c_error
,
12 TP_PROTO(const struct i2c_client
*client
, uint32_t command
, int rc
),
13 TP_ARGS(client
, command
, rc
),
17 __array(unsigned char, command
, sizeof(uint32_t))
18 __field(unsigned short, addr
)
21 __entry
->bus
= client
->adapter
->nr
;
23 memcpy(__entry
->command
, &command
, sizeof(uint32_t));
24 __entry
->addr
= client
->addr
;
26 TP_printk("%d-%02x command:{ %*ph } rc:%d", __entry
->bus
, __entry
->addr
,
27 (int)sizeof(uint32_t), __entry
->command
, __entry
->rc
)
30 TRACE_EVENT(i2cr_read
,
31 TP_PROTO(const struct i2c_client
*client
, uint32_t command
, uint64_t *data
),
32 TP_ARGS(client
, command
, data
),
35 __array(unsigned char, data
, sizeof(uint64_t))
36 __array(unsigned char, command
, sizeof(uint32_t))
37 __field(unsigned short, addr
)
40 __entry
->bus
= client
->adapter
->nr
;
41 memcpy(__entry
->data
, data
, sizeof(uint64_t));
42 memcpy(__entry
->command
, &command
, sizeof(uint32_t));
43 __entry
->addr
= client
->addr
;
45 TP_printk("%d-%02x command:{ %*ph } { %*ph }", __entry
->bus
, __entry
->addr
,
46 (int)sizeof(uint32_t), __entry
->command
, (int)sizeof(uint64_t), __entry
->data
)
49 TRACE_EVENT(i2cr_status
,
50 TP_PROTO(const struct i2c_client
*client
, uint64_t status
),
51 TP_ARGS(client
, status
),
53 __field(uint64_t, status
)
55 __field(unsigned short, addr
)
58 __entry
->status
= status
;
59 __entry
->bus
= client
->adapter
->nr
;
60 __entry
->addr
= client
->addr
;
62 TP_printk("%d-%02x %016llx", __entry
->bus
, __entry
->addr
, __entry
->status
)
65 TRACE_EVENT(i2cr_status_error
,
66 TP_PROTO(const struct i2c_client
*client
, uint64_t status
, uint64_t error
, uint64_t log
),
67 TP_ARGS(client
, status
, error
, log
),
69 __field(uint64_t, error
)
70 __field(uint64_t, log
)
71 __field(uint64_t, status
)
73 __field(unsigned short, addr
)
76 __entry
->error
= error
;
78 __entry
->status
= status
;
79 __entry
->bus
= client
->adapter
->nr
;
80 __entry
->addr
= client
->addr
;
82 TP_printk("%d-%02x status:%016llx error:%016llx log:%016llx", __entry
->bus
, __entry
->addr
,
83 __entry
->status
, __entry
->error
, __entry
->log
)
86 TRACE_EVENT(i2cr_write
,
87 TP_PROTO(const struct i2c_client
*client
, uint32_t command
, uint64_t data
),
88 TP_ARGS(client
, command
, data
),
91 __array(unsigned char, data
, sizeof(uint64_t))
92 __array(unsigned char, command
, sizeof(uint32_t))
93 __field(unsigned short, addr
)
96 __entry
->bus
= client
->adapter
->nr
;
97 memcpy(__entry
->data
, &data
, sizeof(uint64_t));
98 memcpy(__entry
->command
, &command
, sizeof(uint32_t));
99 __entry
->addr
= client
->addr
;
101 TP_printk("%d-%02x command:{ %*ph } { %*ph }", __entry
->bus
, __entry
->addr
,
102 (int)sizeof(uint32_t), __entry
->command
, (int)sizeof(uint64_t), __entry
->data
)
107 #include <trace/define_trace.h>