summaryrefslogtreecommitdiff
path: root/board/freescale/common/qixis.h
diff options
context:
space:
mode:
authorAlison Wang <b18965@freescale.com>2014-12-03 15:00:46 +0800
committerYork Sun <yorksun@freescale.com>2014-12-11 09:39:06 -0800
commit2565d18de0c57d95b32686f11aa98fd40d8a7e26 (patch)
tree540e84ad8592cd64ac5d345230b298e5f9f9bd4d /board/freescale/common/qixis.h
parent50f0c6632527cbdc3c67f60a7f51ccba2564b567 (diff)
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 <jason.jin@freescale.com> Signed-off-by: Alison Wang <alison.wang@freescale.com> Reviewed-by: York Sun <yorksun@freescale.com>
Diffstat (limited to 'board/freescale/common/qixis.h')
-rw-r--r--board/freescale/common/qixis.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/board/freescale/common/qixis.h b/board/freescale/common/qixis.h
index d8fed14ce9..52d20219ec 100644
--- a/board/freescale/common/qixis.h
+++ b/board/freescale/common/qixis.h
@@ -100,8 +100,15 @@ u8 qixis_read_i2c(unsigned int reg);
void qixis_write_i2c(unsigned int reg, u8 value);
#endif
+#if defined(CONFIG_QIXIS_I2C_ACCESS) && defined(CONFIG_SYS_I2C_FPGA_ADDR)
+#define QIXIS_READ(reg) qixis_read_i2c(offsetof(struct qixis, reg))
+#define QIXIS_WRITE(reg, value) \
+ qixis_write_i2c(offsetof(struct qixis, reg), value)
+#else
#define QIXIS_READ(reg) qixis_read(offsetof(struct qixis, reg))
#define QIXIS_WRITE(reg, value) qixis_write(offsetof(struct qixis, reg), value)
+#endif
+
#ifdef CONFIG_SYS_I2C_FPGA_ADDR
#define QIXIS_READ_I2C(reg) qixis_read_i2c(offsetof(struct qixis, reg))
#define QIXIS_WRITE_I2C(reg, value) \