|
@@ -25,18 +25,7 @@
|
|
#include "hw/i2c/i2c.h"
|
|
#include "hw/i2c/i2c.h"
|
|
#include "qemu/log.h"
|
|
#include "qemu/log.h"
|
|
#include "qemu/module.h"
|
|
#include "qemu/module.h"
|
|
-
|
|
|
|
-#ifndef DEBUG_IMX_I2C
|
|
|
|
-#define DEBUG_IMX_I2C 0
|
|
|
|
-#endif
|
|
|
|
-
|
|
|
|
-#define DPRINTF(fmt, args...) \
|
|
|
|
- do { \
|
|
|
|
- if (DEBUG_IMX_I2C) { \
|
|
|
|
- fprintf(stderr, "[%s]%s: " fmt , TYPE_IMX_I2C, \
|
|
|
|
- __func__, ##args); \
|
|
|
|
- } \
|
|
|
|
- } while (0)
|
|
|
|
|
|
+#include "trace.h"
|
|
|
|
|
|
static const char *imx_i2c_get_regname(unsigned offset)
|
|
static const char *imx_i2c_get_regname(unsigned offset)
|
|
{
|
|
{
|
|
@@ -152,8 +141,8 @@ static uint64_t imx_i2c_read(void *opaque, hwaddr offset,
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
|
|
|
|
- DPRINTF("read %s [0x%" HWADDR_PRIx "] -> 0x%02x\n",
|
|
|
|
- imx_i2c_get_regname(offset), offset, value);
|
|
|
|
|
|
+ trace_imx_i2c_read(DEVICE(s)->canonical_path, imx_i2c_get_regname(offset),
|
|
|
|
+ offset, value);
|
|
|
|
|
|
return (uint64_t)value;
|
|
return (uint64_t)value;
|
|
}
|
|
}
|
|
@@ -163,8 +152,8 @@ static void imx_i2c_write(void *opaque, hwaddr offset,
|
|
{
|
|
{
|
|
IMXI2CState *s = IMX_I2C(opaque);
|
|
IMXI2CState *s = IMX_I2C(opaque);
|
|
|
|
|
|
- DPRINTF("write %s [0x%" HWADDR_PRIx "] <- 0x%02x\n",
|
|
|
|
- imx_i2c_get_regname(offset), offset, (int)value);
|
|
|
|
|
|
+ trace_imx_i2c_read(DEVICE(s)->canonical_path, imx_i2c_get_regname(offset),
|
|
|
|
+ offset, value);
|
|
|
|
|
|
value &= 0xff;
|
|
value &= 0xff;
|
|
|
|
|