summaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses/i2c-designware-master.c
diff options
context:
space:
mode:
authorAndy Shevchenko2018-07-25 16:39:26 +0200
committerWolfram Sang2018-08-08 22:28:52 +0200
commite3ea52b578be221d9d5564d17005d01a8d390b92 (patch)
tree57682048fbd59d960bee350f362c7e39f4542baa /drivers/i2c/busses/i2c-designware-master.c
parenti2c: core: Parse SDA hold time from firmware (diff)
downloadkernel-qcow2-linux-e3ea52b578be221d9d5564d17005d01a8d390b92.tar.gz
kernel-qcow2-linux-e3ea52b578be221d9d5564d17005d01a8d390b92.tar.xz
kernel-qcow2-linux-e3ea52b578be221d9d5564d17005d01a8d390b92.zip
i2c: designware: Convert to use struct i2c_timings
Instead of using custom variables and parser, convert the driver to use the ones provided by I2C core. No functional change intended. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Tested-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c/busses/i2c-designware-master.c')
-rw-r--r--drivers/i2c/busses/i2c-designware-master.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/i2c/busses/i2c-designware-master.c b/drivers/i2c/busses/i2c-designware-master.c
index a1717bff06a8..c69b8348cf4c 100644
--- a/drivers/i2c/busses/i2c-designware-master.c
+++ b/drivers/i2c/busses/i2c-designware-master.c
@@ -51,6 +51,7 @@ static int i2c_dw_set_timings_master(struct dw_i2c_dev *dev)
const char *mode_str, *fp_str = "";
u32 comp_param1;
u32 sda_falling_time, scl_falling_time;
+ struct i2c_timings *t = &dev->timings;
int ret;
ret = i2c_dw_acquire_lock(dev);
@@ -60,8 +61,8 @@ static int i2c_dw_set_timings_master(struct dw_i2c_dev *dev)
i2c_dw_release_lock(dev);
/* Set standard and fast speed dividers for high/low periods */
- sda_falling_time = dev->sda_falling_time ?: 300; /* ns */
- scl_falling_time = dev->scl_falling_time ?: 300; /* ns */
+ sda_falling_time = t->sda_fall_ns ?: 300; /* ns */
+ scl_falling_time = t->scl_fall_ns ?: 300; /* ns */
/* Calculate SCL timing parameters for standard mode if not set */
if (!dev->ss_hcnt || !dev->ss_lcnt) {
@@ -85,7 +86,7 @@ static int i2c_dw_set_timings_master(struct dw_i2c_dev *dev)
* difference is the timing parameter values since the registers are
* the same.
*/
- if (dev->clk_freq == 1000000) {
+ if (t->bus_freq_hz == 1000000) {
/*
* Check are fast mode plus parameters available and use
* fast mode if not.