Closed
Description
The bcm2708 default clock stretching timeout is too short to allow waiting for conversions of sht21. Without this patch accesses to the sensor would result in an I/O-Error.
--- a/i2c-bcm2708.c
+++ b/i2c-bcm2708.c
@@ -151,6 +151,8 @@ static inline void bcm2708_bsc_setup(struct bcm2708_i2c *bi)
u32 cdiv;
u32 c = BSC_C_I2CEN | BSC_C_INTD | BSC_C_ST | BSC_C_CLEAR_1;
-
u32 clkt;
- bus_hz = clk_get_rate(bi->clk);
cdiv = bus_hz / baudrate;
- bus_hz = clk_get_rate(bi->clk);
@@ -163,6 +165,11 @@ static inline void bcm2708_bsc_setup(struct bcm2708_i2c *bi
bcm2708_wr(bi, BSC_A, bi->msg->addr);
bcm2708_wr(bi, BSC_DLEN, bi->msg->len);
bcm2708_wr(bi, BSC_C, c);
+
-
/\* longer clock stretching timeout (needed by sht21), */
-
/\* default timeout is 64 i2c clock cycles (0x40) */
-
clkt = baudrate / 10; /\* set to 100 ms */
-
}
bcm2708_wr(bi, BSC_CLKT, clkt);
Greetings Oliver
Metadata
Metadata
Assignees
Labels
No labels