aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses/i2c-designware-platdrv.c
diff options
context:
space:
mode:
authorRomain Baeriswyl <Romain.Baeriswyl@abilis.com>2014-01-20 11:43:43 -0500
committerWolfram Sang <wsa@the-dreams.de>2014-03-09 04:29:08 -0400
commit6468276b22069d4442aafcd8c59e5d8ccae23f5f (patch)
treeed2cc9b10bf940ddc6da148618140b662086f853 /drivers/i2c/busses/i2c-designware-platdrv.c
parent5029a22a45056603497c82445db9dd203b050e82 (diff)
i2c: designware: make SCL and SDA falling time configurable
This patch allows to set independantly SCL and SDA falling times. The tLOW period is computed by taking into account the SCL falling time. The tHIGH period is computed by taking into account the SDA falling time. For instance in case the margin on tLOW is considered too small, it can be increased by increasing the SCL falling time which is by default set at 300ns. The same applies for tHIGH period with the help of SDA falling time. Signed-off-by: Romain Baeriswyl <romainba@abilis.com> Reviewed-by: Christian Ruppert <christian.ruppert@abilis.com> Acked-by: Shinya Kuribayashi <skuribay@pobox.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c/busses/i2c-designware-platdrv.c')
-rw-r--r--drivers/i2c/busses/i2c-designware-platdrv.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
index d0bdac0498ce..fc243992b4b4 100644
--- a/drivers/i2c/busses/i2c-designware-platdrv.c
+++ b/drivers/i2c/busses/i2c-designware-platdrv.c
@@ -159,6 +159,13 @@ static int dw_i2c_probe(struct platform_device *pdev)
159 "i2c-sda-hold-time-ns", &ht); 159 "i2c-sda-hold-time-ns", &ht);
160 dev->sda_hold_time = div_u64((u64)ic_clk * ht + 500000, 160 dev->sda_hold_time = div_u64((u64)ic_clk * ht + 500000,
161 1000000); 161 1000000);
162
163 of_property_read_u32(pdev->dev.of_node,
164 "i2c-sda-falling-time-ns",
165 &dev->sda_falling_time);
166 of_property_read_u32(pdev->dev.of_node,
167 "i2c-scl-falling-time-ns",
168 &dev->scl_falling_time);
162 } 169 }
163 170
164 dev->functionality = 171 dev->functionality =