diff options
| author | Masahiro Yamada <yamada.masahiro@socionext.com> | 2018-12-05 22:55:27 -0500 |
|---|---|---|
| committer | Wolfram Sang <wsa@the-dreams.de> | 2018-12-06 17:14:59 -0500 |
| commit | 8469636ab5d8c77645b953746c10fda6983a8830 (patch) | |
| tree | bb912f98a8108830ea93d2c7949a4ed1e7518194 /drivers/i2c | |
| parent | cd8843f541cc0ef057e27f1afba46374bbb84219 (diff) | |
i2c: uniphier: fix violation of tLOW requirement for Fast-mode
Currently, the clock duty is set as tLOW/tHIGH = 1/1. For Fast-mode,
tLOW is set to 1.25 us while the I2C spec requires tLOW >= 1.3 us.
tLOW/tHIGH = 5/4 would meet both Standard-mode and Fast-mode:
Standard-mode: tLOW = 5.56 us, tHIGH = 4.44 us
Fast-mode: tLOW = 1.39 us, tHIGH = 1.11 us
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c')
| -rw-r--r-- | drivers/i2c/busses/i2c-uniphier.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/i2c/busses/i2c-uniphier.c b/drivers/i2c/busses/i2c-uniphier.c index 454f914ae66d..c488e558aef7 100644 --- a/drivers/i2c/busses/i2c-uniphier.c +++ b/drivers/i2c/busses/i2c-uniphier.c | |||
| @@ -320,7 +320,13 @@ static void uniphier_i2c_hw_init(struct uniphier_i2c_priv *priv) | |||
| 320 | 320 | ||
| 321 | uniphier_i2c_reset(priv, true); | 321 | uniphier_i2c_reset(priv, true); |
| 322 | 322 | ||
| 323 | writel((cyc / 2 << 16) | cyc, priv->membase + UNIPHIER_I2C_CLK); | 323 | /* |
| 324 | * Bit30-16: clock cycles of tLOW. | ||
| 325 | * Standard-mode: tLOW = 4.7 us, tHIGH = 4.0 us | ||
| 326 | * Fast-mode: tLOW = 1.3 us, tHIGH = 0.6 us | ||
| 327 | * "tLow/tHIGH = 5/4" meets both. | ||
| 328 | */ | ||
| 329 | writel((cyc * 5 / 9 << 16) | cyc, priv->membase + UNIPHIER_I2C_CLK); | ||
| 324 | 330 | ||
| 325 | uniphier_i2c_reset(priv, false); | 331 | uniphier_i2c_reset(priv, false); |
| 326 | } | 332 | } |
