Skip to content

Commit

Permalink
blackfin: bf60x: twi: work around temporary anomaly 0501001
Browse files Browse the repository at this point in the history
Disable IRQ when reading MMR rcv_data8 and rcv_data16.

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 May 21, 2012
1 parent 1e92bf6 commit c41704f
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions arch/blackfin/include/asm/bfin_twi.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,35 @@ DEFINE_TWI_REG(FIFO_CTL, fifo_ctl)
DEFINE_TWI_REG(FIFO_STAT, fifo_stat)
DEFINE_TWI_REG(XMT_DATA8, xmt_data8)
DEFINE_TWI_REG(XMT_DATA16, xmt_data16)
#if !ANOMALY_05001001
DEFINE_TWI_REG(RCV_DATA8, rcv_data8)
DEFINE_TWI_REG(RCV_DATA16, rcv_data16)
#else
static inline u16 read_RCV_DATA8(struct bfin_twi_iface *iface)
{
u16 ret;
unsigned long flags;

flags = hard_local_irq_save();
ret = iface->regs_base->rcv_data8;
hard_local_irq_restore(flags);

return ret;
}

static inline u16 read_RCV_DATA16(struct bfin_twi_iface *iface)
{
u16 ret;
unsigned long flags;

flags = hard_local_irq_save();
ret = iface->regs_base->rcv_data16;
hard_local_irq_restore(flags);

return ret;
}
#endif


/* ******************** TWO-WIRE INTERFACE (TWI) MASKS ***********************/
/* TWI_CLKDIV Macros (Use: *pTWI_CLKDIV = CLKLOW(x)|CLKHI(y); ) */
Expand Down

0 comments on commit c41704f

Please sign in to comment.