Re: [PATCH v3 2/3] i2c: add support for HiSilicon I2C controller

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2021/3/23 1:04, Andy Shevchenko wrote:
> 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).

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.

> 




[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux