Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Maxime Coquelin <maxime.coquelin@st.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>

authored by

Maxime COQUELIN and committed by
Wolfram Sang
52976fa7 28772ac8

+19 -13
+19 -13
drivers/i2c/busses/i2c-st.c
··· 206 206 writel_relaxed(readl_relaxed(reg) & ~mask, reg); 207 207 } 208 208 209 - /* From I2C Specifications v0.5 */ 209 + /* 210 + * From I2C Specifications v0.5. 211 + * 212 + * All the values below have +10% margin added to be 213 + * compatible with some out-of-spec devices, 214 + * like HDMI link of the Toshiba 19AV600 TV. 215 + */ 210 216 static struct st_i2c_timings i2c_timings[] = { 211 217 [I2C_MODE_STANDARD] = { 212 218 .rate = 100000, 213 - .rep_start_hold = 4000, 214 - .rep_start_setup = 4700, 215 - .start_hold = 4000, 216 - .data_setup_time = 250, 217 - .stop_setup_time = 4000, 218 - .bus_free_time = 4700, 219 + .rep_start_hold = 4400, 220 + .rep_start_setup = 5170, 221 + .start_hold = 4400, 222 + .data_setup_time = 275, 223 + .stop_setup_time = 4400, 224 + .bus_free_time = 5170, 219 225 }, 220 226 [I2C_MODE_FAST] = { 221 227 .rate = 400000, 222 - .rep_start_hold = 600, 223 - .rep_start_setup = 600, 224 - .start_hold = 600, 225 - .data_setup_time = 100, 226 - .stop_setup_time = 600, 227 - .bus_free_time = 1300, 228 + .rep_start_hold = 660, 229 + .rep_start_setup = 660, 230 + .start_hold = 660, 231 + .data_setup_time = 110, 232 + .stop_setup_time = 660, 233 + .bus_free_time = 1430, 228 234 }, 229 235 }; 230 236