9 #ifndef __ASM_BFIN_TWI_H__
10 #define __ASM_BFIN_TWI_H__
12 #include <linux/types.h>
13 #include <linux/i2c.h>
19 #define __BFP(m) u16 m; u16 __pad_##m
67 #define DEFINE_TWI_REG(reg_name, reg) \
68 static inline u16 read_##reg_name(struct bfin_twi_iface *iface) \
69 { return bfin_read16(&iface->regs_base->reg); } \
70 static inline void write_##reg_name(struct bfin_twi_iface *iface, u16 v) \
71 { bfin_write16(&iface->regs_base->reg, v); }
119 #define CLKLOW(x) ((x) & 0xFF)
120 #define CLKHI(y) (((y)&0xFF)<<0x8)
123 #define PRESCALE 0x007F
124 #define TWI_ENA 0x0080
129 #define SADD_LEN 0x0002
130 #define STDVAL 0x0004
140 #define MADD_LEN 0x0002
144 #define RSTART 0x0020
146 #define SDAOVR 0x4000
147 #define SCLOVR 0x8000
151 #define LOSTARB 0x0002
154 #define BUFRDERR 0x0010
155 #define BUFWRERR 0x0020
156 #define SDASEN 0x0040
157 #define SCLSEN 0x0080
158 #define BUSBUSY 0x0100
167 #define XMTSERV 0x0040
168 #define RCVSERV 0x0080
171 #define XMTFLUSH 0x0001
172 #define RCVFLUSH 0x0002
173 #define XMTINTLEN 0x0004
174 #define RCVINTLEN 0x0008
177 #define XMTSTAT 0x0003
178 #define XMT_EMPTY 0x0000
179 #define XMT_HALF 0x0001
180 #define XMT_FULL 0x0003
182 #define RCVSTAT 0x000C
183 #define RCV_EMPTY 0x0000
184 #define RCV_HALF 0x0004
185 #define RCV_FULL 0x000C