Skip to content

Commit

Permalink
i2c: i2c-bfin-twi: Always access 16 bit MMR by bfin 16 bit access Macro.
Browse files Browse the repository at this point in the history
Otherwise, the compiler may optimize assemble code into 8bit access instruction
when target register is 8 bit width.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Bob Liu <lliubbo@gmail.com>
  • Loading branch information
Sonic Zhang authored and Bob Liu committed Jul 24, 2012
1 parent 335dd55 commit f794d7b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/blackfin/include/asm/bfin_twi.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ struct bfin_twi_iface {

#define DEFINE_TWI_REG(reg_name, reg) \
static inline u16 read_##reg_name(struct bfin_twi_iface *iface) \
{ return iface->regs_base->reg; } \
{ return bfin_read16(&iface->regs_base->reg); } \
static inline void write_##reg_name(struct bfin_twi_iface *iface, u16 v) \
{ iface->regs_base->reg = v; }
{ bfin_write16(&iface->regs_base->reg, v); }

DEFINE_TWI_REG(CLKDIV, clkdiv)
DEFINE_TWI_REG(CONTROL, control)
Expand Down

0 comments on commit f794d7b

Please sign in to comment.