Re: [PATCH v2 1/3] i2c: core: Provide generic definitions for bus frequencies

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

 



On Thu, Mar 05, 2020 at 09:58:29PM +0000, Peter Rosin wrote:
> On 2020-02-27 13:21, Andy Shevchenko wrote:
> > There are few maximum bus frequencies being used in the I²C core code.
> > Provide generic definitions for bus frequencies and use them in the core.
> > 
> > The drivers may use predefined constants where it is appropriate.
> > Some of them are already using these under slightly different names.
> > We will convert them later to use newly introduced defines.
> > 
> > These definitions will also help to avoid typos in the numbers that
> > may lead to subtle errors.

...

> > +/* I2C Frequency Modes */
> > +#define I2C_MAX_STANDARD_MODE_FREQ	100000
> > +#define I2C_MAX_FAST_MODE_FREQ		400000
> > +#define I2C_MAX_FAST_PLUS_MODE_FREQ	1000000
> > +#define I2C_MAX_TURBO_MODE_FREQ		1400000
> > +#define I2C_MAX_HIGH_SPEED_MODE_FREQ	3400000
> > +#define I2C_MAX_ULTRA_SPEED_MODE_FREQ	5000000
> 
> Am I the only one who do /not/ find these names readable?

Seems so :-)

> I can't seem to
> remember what frequency TURBO, HIGH, etc are and their ordering is
> difficult. It's all sounds like marketing buzz to me and my brain shuts
> off instantly.
> 
> This feels a lot like moving away from octal permissions for files, which
> is frowned upon...
> 
> Can we include some kind of indication of the actual frequency in the
> names as well please?
> 
> Perhaps something like I2C_MAX_STANDARD_MODE_100KHZ?

It's definitely a duplicate information here.

In I²C we have quite established range of frequencies (4 out of 6 in above
list), so, their names already implying very well defined frequencies.

For the rest 2 perhaps it's good to have something like your proposal,
but it will be inconsistent with the rest and with many controller
specifications.

Wolfram, what do you think about Peter's idea?

-- 
With Best Regards,
Andy Shevchenko





[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