Advertisement
Guest User

Raspberry pi linux - bcm2708 i2c patch

a guest
Feb 5th, 2013
313
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 0.70 KB | None | 0 0
  1. @@ -151,6 +151,8 @@ static inline void bcm2708_bsc_setup(struct bcm2708_i2c *bi)
  2.         u32 cdiv;
  3.         u32 c = BSC_C_I2CEN | BSC_C_INTD | BSC_C_ST | BSC_C_CLEAR_1;
  4.  
  5. +       u32 clkt;
  6. +
  7.         bus_hz = clk_get_rate(bi->clk);
  8.         cdiv = bus_hz / baudrate;
  9.  
  10. @@ -163,6 +165,11 @@ static inline void bcm2708_bsc_setup(struct bcm2708_i2c *bi
  11.         bcm2708_wr(bi, BSC_A, bi->msg->addr);
  12.         bcm2708_wr(bi, BSC_DLEN, bi->msg->len);
  13.         bcm2708_wr(bi, BSC_C, c);
  14. +
  15. +       /* longer clock stretching timeout (needed by sht21), */
  16. +       /* default timeout is 64 i2c clock cycles (0x40) */
  17. +       clkt = baudrate / 10; /* set to 100 ms */
  18. +       bcm2708_wr(bi, BSC_CLKT, clkt);
  19.  }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement