On Wed, Mar 24, 2021 at 06:21:36PM +0800, Yicong Yang wrote: > On 2021/3/23 1:04, Andy Shevchenko wrote: > > On Mon, Mar 22, 2021 at 07:10:12PM +0800, Yicong Yang wrote: ... > >> +static const char *hisi_i2c_speed_string(u32 bus_freq_hz) > >> +{ > >> + switch (bus_freq_hz) { > >> + case I2C_MAX_STANDARD_MODE_FREQ: > >> + return "100K"; > >> + case I2C_MAX_FAST_MODE_FREQ: > >> + return "400K"; > >> + case I2C_MAX_HIGH_SPEED_MODE_FREQ: > >> + return "3.4M"; > >> + default: > >> + return "unknown"; > >> + } > >> +} > > > > Just realized that if you print the name of the mode (and maybe frequency > > value) then it can be moved to generic I²C code and other will benefit out of > > this (DesignWare is the first in my mind). > > sure, that's good. but the i2c core doesn't make use of the speed mode > information so maybe print of this information is rather driver depended. Yes, but it's useful. And since we will have at least two users of this it is a good justification to use I²C core to keep and provide this API. -- With Best Regards, Andy Shevchenko