All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Wolfram Sang <wsa@kernel.org>,
	Yicong Yang <yangyicong@hisilicon.com>,
	linux-i2c@vger.kernel.org, Sergey.Semin@baikalelectronics.ru,
	linux-kernel@vger.kernel.org, digetx@gmail.com,
	treding@nvidia.com, jarkko.nikula@linux.intel.com,
	rmk+kernel@armlinux.org.uk, song.bao.hua@hisilicon.com,
	john.garry@huawei.com, mika.westerberg@linux.intel.com,
	prime.zeng@huawei.com, linuxarm@huawei.com
Subject: Re: [PATCH v7 2/5] i2c: core: add api to provide frequency mode strings
Date: Fri, 9 Apr 2021 13:36:17 +0300	[thread overview]
Message-ID: <YHAuIdwKMjZuDmXU@smile.fi.intel.com> (raw)
In-Reply-To: <20210408205551.GD1900@kunai>

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



  reply	other threads:[~2021-04-09 10:36 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-08 11:17 [PATCH v7 0/5] Add support for HiSilicon I2C controller Yicong Yang
2021-04-08 11:17 ` [PATCH v7 1/5] i2c: core: add managed function for adding i2c adapters Yicong Yang
2021-04-08 11:17 ` [PATCH v7 2/5] i2c: core: add api to provide frequency mode strings Yicong Yang
2021-04-08 20:55   ` Wolfram Sang
2021-04-09 10:36     ` Andy Shevchenko [this message]
2021-04-09 11:37       ` Wolfram Sang
2021-04-09 11:40         ` Andy Shevchenko
2021-04-09 13:49           ` Yicong Yang
2021-04-08 11:17 ` [PATCH v7 3/5] i2c: add support for HiSilicon I2C controller Yicong Yang
2021-04-08 11:17 ` [PATCH v7 4/5] MAINTAINERS: Add maintainer for HiSilicon I2C driver Yicong Yang
2021-04-08 20:57   ` Wolfram Sang
2021-04-08 11:17 ` [PATCH v7 5/5] i2c: designware: Switch over to i2c_freq_mode_string() Yicong Yang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YHAuIdwKMjZuDmXU@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=Sergey.Semin@baikalelectronics.ru \
    --cc=digetx@gmail.com \
    --cc=jarkko.nikula@linux.intel.com \
    --cc=john.garry@huawei.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=mika.westerberg@linux.intel.com \
    --cc=prime.zeng@huawei.com \
    --cc=rmk+kernel@armlinux.org.uk \
    --cc=song.bao.hua@hisilicon.com \
    --cc=treding@nvidia.com \
    --cc=wsa@kernel.org \
    --cc=yangyicong@hisilicon.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.