On 05/04/2013 06:53 PM, Andreas Färber wrote:
Am 04.05.2013 16:09, schrieb Jean-Christophe DUBOIS:
+#include "qemu/bswap.h"
Is this one needed?
No, I will remove it.
+enum IMXI2CRegisters {
+ IMX_I2C_IADR = 0x00,
+ IMX_I2C_IFDR = 0x04,
+ IMX_I2C_I2CR = 0x08,
+ IMX_I2C_I2SR = 0x0c,
+ IMX_I2C_I2DR = 0x10,
+};
+
+enum IMXI2CCRBits {
+ IMX_I2C_I2CR_IEN = 1 << 7,
+ IMX_I2C_I2CR_IIEN = 1 << 6,
+ IMX_I2C_I2CR_MSTA = 1 << 5,
+ IMX_I2C_I2CR_MTX = 1 << 4,
+ IMX_I2C_I2CR_TXAK = 1 << 3,
+ IMX_I2C_I2CR_RSTA = 1 << 2,
+};
+
+enum IMXI2CSRBits {
+ IMX_I2C_I2SR_ICF = 1 << 7,
+ IMX_I2C_I2SR_IAAF = 1 << 6,
+ IMX_I2C_I2SR_IBB = 1 << 5,
+ IMX_I2C_I2SR_IAL = 1 << 4,
+ IMX_I2C_I2SR_SRW = 1 << 2,
+ IMX_I2C_I2SR_IIF = 1 << 1,
+ IMX_I2C_I2SR_RXAK = 1 << 0,
+};
+
+enum IMXI2CDirection {
+ IMX_I2C_READ,
+ IMX_I2C_WRITE,
+};
libqos/i2c-omap.c was a driver for an unmaintained legacy device.
i.MX I2C however is being added by you in 2/4, so it would be better to
put these constants in a header in 2/4 for reuse here (i2c/imx_regs.h?).
Otherwise looking fine!
Will do in next version.
Meanwhile, other comments on the series are welcome.
JC
Regards,
Andreas