All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: "Song Bao Hua (Barry Song)" <song.bao.hua@hisilicon.com>
Cc: yangyicong <yangyicong@huawei.com>,
	"wsa@kernel.org" <wsa@kernel.org>,
	"linux-i2c@vger.kernel.org" <linux-i2c@vger.kernel.org>,
	"Sergey.Semin@baikalelectronics.ru" 
	<Sergey.Semin@baikalelectronics.ru>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"digetx@gmail.com" <digetx@gmail.com>,
	"treding@nvidia.com" <treding@nvidia.com>,
	"jarkko.nikula@linux.intel.com" <jarkko.nikula@linux.intel.com>,
	"rmk+kernel@armlinux.org.uk" <rmk+kernel@armlinux.org.uk>,
	John Garry <john.garry@huawei.com>,
	"mika.westerberg@linux.intel.com"
	<mika.westerberg@linux.intel.com>,
	"Zengtao (B)" <prime.zeng@hisilicon.com>,
	Linuxarm <linuxarm@huawei.com>
Subject: Re: [PATCH 5/5] i2c: designware: Switch over to i2c_freq_mode_string()
Date: Wed, 31 Mar 2021 13:19:24 +0300	[thread overview]
Message-ID: <YGRMrMI2ADSV9RBa@smile.fi.intel.com> (raw)
In-Reply-To: <793f587a5bc744b393cf677258bce50e@hisilicon.com>

On Wed, Mar 31, 2021 at 08:53:02AM +0000, Song Bao Hua (Barry Song) wrote:
> 
> > No, please read the code carefully.
> > We can duplicate conditional, but it brings a bit of inconsistency to how the counters are printed.
> 
> Thanks for clarification, I am still confused as the original
> code print the real mode based on dev->master_cfg, the new
> code is printing mode based on frequency.
> 
> My understanding is the original code could fall back to a lower
> speed when higher speed modes were not set successfully. For
> example, high speed mode falls back to fast mode:

This is a good catch! I should be fixed by a separate patch I assume.

> if ((dev->master_cfg & DW_IC_CON_SPEED_MASK) ==
> 		DW_IC_CON_SPEED_HIGH) {
> 		if ((comp_param1 & DW_IC_COMP_PARAM_1_SPEED_MODE_MASK)
> 			!= DW_IC_COMP_PARAM_1_SPEED_MODE_HIGH) {
> 			dev_err(dev->dev, "High Speed not supported!\n");
> 			dev->master_cfg &= ~DW_IC_CON_SPEED_MASK;
> 			dev->master_cfg |= DW_IC_CON_SPEED_FAST;

Basically we have to adjust timings here to reflect this change.

> 			dev->hs_hcnt = 0;
> 			dev->hs_lcnt = 0;
> 		}


-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2021-03-31 10:20 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-30 14:19 [PATCH v5 0/5] Add support for HiSilicon I2C controller Yicong Yang
2021-03-30 14:19 ` [PATCH v5 1/5] i2c: core: add managed function for adding i2c adapters Yicong Yang
2021-03-30 16:28   ` Dmitry Osipenko
2021-03-30 14:19 ` [PATCH v5 2/5] i2c: core: add api to provide frequency mode strings Yicong Yang
2021-03-31  8:35   ` Jarkko Nikula
2021-03-31 13:03     ` Yicong Yang
2021-03-30 14:19 ` [PATCH v5 3/5] i2c: add support for HiSilicon I2C controller Yicong Yang
2021-03-30 16:24   ` Dmitry Osipenko
2021-03-30 16:32     ` Dmitry Osipenko
2021-03-30 16:33   ` Dmitry Osipenko
2021-03-30 14:19 ` [PATCH v5 4/5] MAINTAINERS: Add maintainer for HiSilicon I2C driver Yicong Yang
2021-03-30 14:19 ` [PATCH 5/5] i2c: designware: Switch over to i2c_freq_mode_string() Yicong Yang
2021-03-30 21:36   ` Song Bao Hua (Barry Song)
     [not found]     ` <CAHp75VdY58Tm0FDcoVDWuw0LBKUFWC_hBCb5t=4WX_MPzsLvZw@mail.gmail.com>
2021-03-30 22:01       ` Song Bao Hua (Barry Song)
2021-03-30 22:06       ` Song Bao Hua (Barry Song)
     [not found]         ` <CAHp75VeTj-wk3WP2-Unoti0+Cajx33b8NOUbBiSBQLmJHn=YAg@mail.gmail.com>
2021-03-31  8:53           ` Song Bao Hua (Barry Song)
2021-03-31 10:19             ` Andy Shevchenko [this message]
2021-03-31 10:37   ` Andy Shevchenko
2021-03-31 13:02     ` 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=YGRMrMI2ADSV9RBa@smile.fi.intel.com \
    --to=andy.shevchenko@gmail.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@hisilicon.com \
    --cc=rmk+kernel@armlinux.org.uk \
    --cc=song.bao.hua@hisilicon.com \
    --cc=treding@nvidia.com \
    --cc=wsa@kernel.org \
    --cc=yangyicong@huawei.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.