提交 52976fa7 编写于 作者: M Maxime COQUELIN 提交者: Wolfram Sang

i2c: st: Update i2c timings

The i2c timing values specified in the driver are the minimun values
defined in the I2C specifications. The I2C specification does not
specify any default or maximum values.

Some I2C devices are out of spec, such as the HDMI link of the Toshiba
19AV600 TV, and might not work properly with minimum values.

This patch adds a 10% margin on all the timings in both Normal and Fast modes.

Trial and error method have been used to find the minimum margin necessary to
have the out-of-spec device working, and a security margin has been added.
Signed-off-by: NMaxime Coquelin <maxime.coquelin@st.com>
Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
上级 28772ac8
...@@ -206,25 +206,31 @@ static inline void st_i2c_clr_bits(void __iomem *reg, u32 mask) ...@@ -206,25 +206,31 @@ static inline void st_i2c_clr_bits(void __iomem *reg, u32 mask)
writel_relaxed(readl_relaxed(reg) & ~mask, reg); writel_relaxed(readl_relaxed(reg) & ~mask, reg);
} }
/* From I2C Specifications v0.5 */ /*
* From I2C Specifications v0.5.
*
* All the values below have +10% margin added to be
* compatible with some out-of-spec devices,
* like HDMI link of the Toshiba 19AV600 TV.
*/
static struct st_i2c_timings i2c_timings[] = { static struct st_i2c_timings i2c_timings[] = {
[I2C_MODE_STANDARD] = { [I2C_MODE_STANDARD] = {
.rate = 100000, .rate = 100000,
.rep_start_hold = 4000, .rep_start_hold = 4400,
.rep_start_setup = 4700, .rep_start_setup = 5170,
.start_hold = 4000, .start_hold = 4400,
.data_setup_time = 250, .data_setup_time = 275,
.stop_setup_time = 4000, .stop_setup_time = 4400,
.bus_free_time = 4700, .bus_free_time = 5170,
}, },
[I2C_MODE_FAST] = { [I2C_MODE_FAST] = {
.rate = 400000, .rate = 400000,
.rep_start_hold = 600, .rep_start_hold = 660,
.rep_start_setup = 600, .rep_start_setup = 660,
.start_hold = 600, .start_hold = 660,
.data_setup_time = 100, .data_setup_time = 110,
.stop_setup_time = 600, .stop_setup_time = 660,
.bus_free_time = 1300, .bus_free_time = 1430,
}, },
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册