24
24
#include "migration/vmstate.h"
25
25
#include "qemu/log.h"
26
26
#include "qemu/module.h"
27
+ #include "trace.h"
27
28
28
29
#ifndef DEBUG_IMX_GPIO
29
30
#define DEBUG_IMX_GPIO 0
@@ -34,14 +35,6 @@ typedef enum IMXGPIOLevel {
34
35
IMX_GPIO_LEVEL_HIGH = 1 ,
35
36
} IMXGPIOLevel ;
36
37
37
- #define DPRINTF (fmt , args ...) \
38
- do { \
39
- if (DEBUG_IMX_GPIO) { \
40
- fprintf(stderr, "[%s]%s: " fmt , TYPE_IMX_GPIO, \
41
- __func__, ##args); \
42
- } \
43
- } while (0)
44
-
45
38
static const char * imx_gpio_reg_name (uint32_t reg )
46
39
{
47
40
switch (reg ) {
@@ -111,6 +104,8 @@ static void imx_gpio_set(void *opaque, int line, int level)
111
104
IMXGPIOState * s = IMX_GPIO (opaque );
112
105
IMXGPIOLevel imx_level = level ? IMX_GPIO_LEVEL_HIGH : IMX_GPIO_LEVEL_LOW ;
113
106
107
+ trace_imx_gpio_set (DEVICE (s )-> canonical_path , line , imx_level );
108
+
114
109
imx_gpio_set_int_line (s , line , imx_level );
115
110
116
111
/* this is an input signal, so set PSR */
@@ -200,7 +195,8 @@ static uint64_t imx_gpio_read(void *opaque, hwaddr offset, unsigned size)
200
195
break ;
201
196
}
202
197
203
- DPRINTF ("(%s) = 0x%" PRIx32 "\n" , imx_gpio_reg_name (offset ), reg_value );
198
+ trace_imx_gpio_read (DEVICE (s )-> canonical_path , imx_gpio_reg_name (offset ),
199
+ reg_value );
204
200
205
201
return reg_value ;
206
202
}
@@ -210,8 +206,8 @@ static void imx_gpio_write(void *opaque, hwaddr offset, uint64_t value,
210
206
{
211
207
IMXGPIOState * s = IMX_GPIO (opaque );
212
208
213
- DPRINTF ( "(%s, value = 0x%" PRIx32 ")\n" , imx_gpio_reg_name (offset ),
214
- ( uint32_t ) value );
209
+ trace_imx_gpio_write ( DEVICE ( s ) -> canonical_path , imx_gpio_reg_name (offset ),
210
+ value );
215
211
216
212
switch (offset ) {
217
213
case DR_ADDR :
0 commit comments