aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authoraddy ke <addy.ke@rock-chips.com>2014-12-11 06:02:40 -0500
committerWolfram Sang <wsa@the-dreams.de>2015-01-13 10:21:04 -0500
commit1330e29105a3ad0a2a88d7a37ddd29d3f70675cf (patch)
tree1bd1859e23c0d2caf6cadf8a5052c644ff693770 /Documentation
parent9fae82e1acda8d4a6881be63cc38521b84007ba9 (diff)
i2c: rk3x: fix bug that cause measured high_ns doesn't meet I2C specification
The number of clock cycles to be written into the CLKDIV register that determines the I2C clk high phase includes the rise time. So to meet the timing requirements defined in the I2C specification which defines the minimal time SCL has to be high, the rise time has to taken into account. The same applies to the low phase with falling time. In my test on RK3288-Pink2 board, which is not an upstream board yet, if external pull-up resistor is 4.7K, rise_ns is about 700ns. So the measured high_ns is about 3900ns, which is less than 4000ns (the minimum high_ns in I2C specification for Standard-mode). To fix this bug min_low_ns should include fall time and min_high_ns should include rise time. This patch merged the patch from chromium project which can get the rise and fall times for signals from the device tree. This allows us to more accurately calculate timings. see: https://chromium-review.googlesource.com/#/c/232774/ Signed-off-by: Addy Ke <addy.ke@rock-chips.com> Reviewed-by: Doug Anderson <dianders@chromium.org> Tested-by: Doug Anderson <dianders@chromium.org> [wsa: fixed a typo in the docs] Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/devicetree/bindings/i2c/i2c-rk3x.txt11
1 files changed, 11 insertions, 0 deletions
diff --git a/Documentation/devicetree/bindings/i2c/i2c-rk3x.txt b/Documentation/devicetree/bindings/i2c/i2c-rk3x.txt
index dde6c22ce91a..c4fd545720af 100644
--- a/Documentation/devicetree/bindings/i2c/i2c-rk3x.txt
+++ b/Documentation/devicetree/bindings/i2c/i2c-rk3x.txt
@@ -21,6 +21,14 @@ Required on RK3066, RK3188 :
21Optional properties : 21Optional properties :
22 22
23 - clock-frequency : SCL frequency to use (in Hz). If omitted, 100kHz is used. 23 - clock-frequency : SCL frequency to use (in Hz). If omitted, 100kHz is used.
24 - i2c-scl-rising-time-ns : Number of nanoseconds the signal takes to rise
25 (t(r) in I2C specification). If not specified this is assumed to be
26 the maximum the specification allows(1000 ns for Standard-mode,
27 300 ns for Fast-mode) which might cause slightly slower communication.
28 - i2c-scl-falling-time-ns : Number of nanoseconds the signal takes to fall
29 (t(f) in the I2C specification). If not specified this is assumed to
30 be the maximum the specification allows (300 ns) which might cause
31 slightly slower communication.
24 32
25Example: 33Example:
26 34
@@ -39,4 +47,7 @@ i2c0: i2c@2002d000 {
39 47
40 clock-names = "i2c"; 48 clock-names = "i2c";
41 clocks = <&cru PCLK_I2C0>; 49 clocks = <&cru PCLK_I2C0>;
50
51 i2c-scl-rising-time-ns = <800>;
52 i2c-scl-falling-time-ns = <100>;
42}; 53};