diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2018-07-25 17:39:26 +0300 |
---|---|---|
committer | Wolfram Sang <wsa@the-dreams.de> | 2018-08-08 23:28:52 +0300 |
commit | e3ea52b578be221d9d5564d17005d01a8d390b92 (patch) | |
tree | 57682048fbd59d960bee350f362c7e39f4542baa /drivers/i2c/busses/i2c-designware-master.c | |
parent | 4717be73c2843a3d6d8546872177a19358f6b7b5 (diff) | |
download | linux-e3ea52b578be221d9d5564d17005d01a8d390b92.tar.xz |
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.c | 7 |
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. |