aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c
diff options
context:
space:
mode:
authorSonic Zhang <sonic.zhang@analog.com>2012-06-13 04:22:47 -0400
committerWolfram Sang <w.sang@pengutronix.de>2012-07-13 02:37:31 -0400
commit90c16bbf57412d69fb29ca61a3942c8f433aa381 (patch)
tree14686f57898f6f275dd9d0524e3e3a4a4e7a6aee /drivers/i2c
parentf88aafe513df2b2daad0883d70daee7a51e89c82 (diff)
i2c: i2c-bfin-twi: Move blackfin TWI register access Macro to head file.
Depend on 1e92bf6d80b5a0a137455c96bf6cdd9c1a5b531e Signed-off-by: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/busses/i2c-bfin-twi.c45
1 files changed, 0 insertions, 45 deletions
diff --git a/drivers/i2c/busses/i2c-bfin-twi.c b/drivers/i2c/busses/i2c-bfin-twi.c
index f4fbbd211ddd..0cf780fd6ef1 100644
--- a/drivers/i2c/busses/i2c-bfin-twi.c
+++ b/drivers/i2c/busses/i2c-bfin-twi.c
@@ -33,51 +33,6 @@
33#define TWI_I2C_MODE_COMBINED 3 33#define TWI_I2C_MODE_COMBINED 3
34#define TWI_I2C_MODE_REPEAT 4 34#define TWI_I2C_MODE_REPEAT 4
35 35
36struct bfin_twi_iface {
37 int irq;
38 spinlock_t lock;
39 char read_write;
40 u8 command;
41 u8 *transPtr;
42 int readNum;
43 int writeNum;
44 int cur_mode;
45 int manual_stop;
46 int result;
47 struct i2c_adapter adap;
48 struct completion complete;
49 struct i2c_msg *pmsg;
50 int msg_num;
51 int cur_msg;
52 u16 saved_clkdiv;
53 u16 saved_control;
54 void __iomem *regs_base;
55};
56
57
58#define DEFINE_TWI_REG(reg, off) \
59static inline u16 read_##reg(struct bfin_twi_iface *iface) \
60 { return bfin_read16(iface->regs_base + (off)); } \
61static inline void write_##reg(struct bfin_twi_iface *iface, u16 v) \
62 { bfin_write16(iface->regs_base + (off), v); }
63
64DEFINE_TWI_REG(CLKDIV, 0x00)
65DEFINE_TWI_REG(CONTROL, 0x04)
66DEFINE_TWI_REG(SLAVE_CTL, 0x08)
67DEFINE_TWI_REG(SLAVE_STAT, 0x0C)
68DEFINE_TWI_REG(SLAVE_ADDR, 0x10)
69DEFINE_TWI_REG(MASTER_CTL, 0x14)
70DEFINE_TWI_REG(MASTER_STAT, 0x18)
71DEFINE_TWI_REG(MASTER_ADDR, 0x1C)
72DEFINE_TWI_REG(INT_STAT, 0x20)
73DEFINE_TWI_REG(INT_MASK, 0x24)
74DEFINE_TWI_REG(FIFO_CTL, 0x28)
75DEFINE_TWI_REG(FIFO_STAT, 0x2C)
76DEFINE_TWI_REG(XMT_DATA8, 0x80)
77DEFINE_TWI_REG(XMT_DATA16, 0x84)
78DEFINE_TWI_REG(RCV_DATA8, 0x88)
79DEFINE_TWI_REG(RCV_DATA16, 0x8C)
80
81static void bfin_twi_handle_interrupt(struct bfin_twi_iface *iface, 36static void bfin_twi_handle_interrupt(struct bfin_twi_iface *iface,
82 unsigned short twi_int_status) 37 unsigned short twi_int_status)
83{ 38{