diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2021-04-08 19:17:21 +0800 |
---|---|---|
committer | Wolfram Sang <wsa@kernel.org> | 2021-04-10 21:54:11 +0200 |
commit | 71aee62783e9dc16472acf7657ce16318613ad2f (patch) | |
tree | 3ed18f0fc242f937ab5508a7dc48047fd19ad692 /drivers/i2c/busses/i2c-designware-master.c | |
parent | d62fbdb99a85730af408399bfae9fa2aa708c6f1 (diff) | |
download | lwn-71aee62783e9dc16472acf7657ce16318613ad2f.tar.gz lwn-71aee62783e9dc16472acf7657ce16318613ad2f.zip |
i2c: designware: Switch over to i2c_freq_mode_string()
Use generic i2c_freq_mode_string() helper to print chosen bus speed.
Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Yicong Yang <yangyicong@hisilicon.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Diffstat (limited to 'drivers/i2c/busses/i2c-designware-master.c')
-rw-r--r-- | drivers/i2c/busses/i2c-designware-master.c | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/drivers/i2c/busses/i2c-designware-master.c b/drivers/i2c/busses/i2c-designware-master.c index 8a59470a82ad..ceae6b2fed83 100644 --- a/drivers/i2c/busses/i2c-designware-master.c +++ b/drivers/i2c/busses/i2c-designware-master.c @@ -39,10 +39,10 @@ static void i2c_dw_configure_fifo_master(struct dw_i2c_dev *dev) 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; + const char *fp_str = ""; u32 ic_clk; int ret; @@ -157,22 +157,10 @@ static int i2c_dw_set_timings_master(struct dw_i2c_dev *dev) ret = i2c_dw_set_sda_hold(dev); if (ret) - goto out; - - switch (dev->master_cfg & DW_IC_CON_SPEED_MASK) { - case DW_IC_CON_SPEED_STD: - mode_str = "Standard Mode"; - break; - case DW_IC_CON_SPEED_HIGH: - mode_str = "High Speed Mode"; - break; - default: - mode_str = "Fast Mode"; - } - dev_dbg(dev->dev, "Bus speed: %s%s\n", mode_str, fp_str); + return ret; -out: - return ret; + dev_dbg(dev->dev, "Bus speed: %s\n", i2c_freq_mode_string(t->bus_freq_hz)); + return 0; } /** |