On Mon, Mar 22, 2021 at 07:10:12PM +0800, Yicong Yang wrote: > Add HiSilicon I2C controller driver for the Kunpeng SoC. It provides > the access to the i2c busses, which connects to the eeprom, rtc, etc. > > The driver works with IRQ mode, and supports basic I2C features and 10bit > address. The DMA is not supported. ... > +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). -- With Best Regards, Andy Shevchenko