lkml.org 
[lkml]   [2021]   [Apr]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v7 2/5] i2c: core: add api to provide frequency mode strings
On Thu, Apr 08, 2021 at 10:55:51PM +0200, Wolfram Sang wrote:
>
> > +const char *i2c_freq_mode_string(u32 bus_freq_hz)
> > +{
> > + switch (bus_freq_hz) {
> > + case I2C_MAX_STANDARD_MODE_FREQ:
> > + return "Standard Mode (100 kHz)";
>
> Sorry, I just noticed just now. Shouldn't we also support lower
> frequencies than the maximum one? I.e.
>
> if (bus_freq_hz <= I2C_MAX_STANDARD_MODE_FREQ)
> return "Standard Mode (max 100 kHz)";
> else if (bus_freq_hz <= ... )
>
> ?

Can we add this later if needed?
Because in such case additionally printing bus_freq_hz will be fine, no?

But putting max to each frequency representation in the list of strings sounds
good to me.


--
With Best Regards,
Andy Shevchenko


\
 
 \ /
  Last update: 2021-04-09 12:37    [W:0.093 / U:0.184 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site