Skip to content

Commit 2565d18

Browse files
Alison WangYork Sun
Alison Wang
authored and
York Sun
committed
ls102xa: qixis: Add CONFIG_QIXIS_I2C_ACCESS macro
Through adding CONFIG_QIXIS_I2C_ACCESS macro, QIXIS_READ(reg)/QIXIS_WRITE(reg, value) can be used for both i2c and ifc access to QIXIS FPGA. This is more convenient for coding. Signed-off-by: Jason Jin <[email protected]> Signed-off-by: Alison Wang <[email protected]> Reviewed-by: York Sun <[email protected]>
1 parent 50f0c66 commit 2565d18

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

board/freescale/common/qixis.h

+7
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,15 @@ u8 qixis_read_i2c(unsigned int reg);
100100
void qixis_write_i2c(unsigned int reg, u8 value);
101101
#endif
102102

103+
#if defined(CONFIG_QIXIS_I2C_ACCESS) && defined(CONFIG_SYS_I2C_FPGA_ADDR)
104+
#define QIXIS_READ(reg) qixis_read_i2c(offsetof(struct qixis, reg))
105+
#define QIXIS_WRITE(reg, value) \
106+
qixis_write_i2c(offsetof(struct qixis, reg), value)
107+
#else
103108
#define QIXIS_READ(reg) qixis_read(offsetof(struct qixis, reg))
104109
#define QIXIS_WRITE(reg, value) qixis_write(offsetof(struct qixis, reg), value)
110+
#endif
111+
105112
#ifdef CONFIG_SYS_I2C_FPGA_ADDR
106113
#define QIXIS_READ_I2C(reg) qixis_read_i2c(offsetof(struct qixis, reg))
107114
#define QIXIS_WRITE_I2C(reg, value) \

0 commit comments

Comments
 (0)