linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yingjoe Chen <yingjoe.chen@mediatek.com>
To: <qii.wang@mediatek.com>
Cc: <wsa@the-dreams.de>, <devicetree@vger.kernel.org>,
	<srv_heupstream@mediatek.com>, <leilk.liu@mediatek.com>,
	<linux-kernel@vger.kernel.org>,
	<linux-mediatek@lists.infradead.org>, <linux-i2c@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	"Andy Shevchenko" <andriy.shevchenko@linux.intel.com>
Subject: Re: [PATCH] i2c: mediatek: Fix generic definitions for bus frequencies
Date: Sun, 13 Sep 2020 23:15:56 +0800	[thread overview]
Message-ID: <1600010156.3039.5.camel@mtksdaap41> (raw)
In-Reply-To: <1599890246-21191-1-git-send-email-qii.wang@mediatek.com>

On Sat, 2020-09-12 at 13:57 +0800, qii.wang@mediatek.com wrote:
> From: Qii Wang <qii.wang@mediatek.com>
> 
> The master code needs to being sent when the speed is more than
> I2C_MAX_FAST_MODE_PLUS_FREQ instead of
> I2C_MAX_HIGH_SPEED_MODE_FREQ. Fix it.

This was introduced by "i2c: drivers: Use generic definitions for bus
frequencies". You should have
Fixes: 90224e6468e1 ("i2c: drivers: Use generic definitions for bus
frequencies")

You can have my reviewed by after you add fixes.
Reviewed-by: Yingjoe Chen <yingjoe.chen@mediatek.com>

Joe.C

> 
> Signed-off-by: Qii Wang <qii.wang@mediatek.com>
> ---
>  drivers/i2c/busses/i2c-mt65xx.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-mt65xx.c b/drivers/i2c/busses/i2c-mt65xx.c
> index efc1404..0cbdfbe 100644
> --- a/drivers/i2c/busses/i2c-mt65xx.c
> +++ b/drivers/i2c/busses/i2c-mt65xx.c
> @@ -681,8 +681,8 @@ static int mtk_i2c_calculate_speed(struct mtk_i2c *i2c, unsigned int clk_src,
>  	unsigned int cnt_mul;
>  	int ret = -EINVAL;
>  
> -	if (target_speed > I2C_MAX_FAST_MODE_PLUS_FREQ)
> -		target_speed = I2C_MAX_FAST_MODE_PLUS_FREQ;
> +	if (target_speed > I2C_MAX_HIGH_SPEED_MODE_FREQ)
> +		target_speed = I2C_MAX_HIGH_SPEED_MODE_FREQ;
>  
>  	max_step_cnt = mtk_i2c_max_step_cnt(target_speed);
>  	base_step_cnt = max_step_cnt;
> @@ -759,7 +759,7 @@ static int mtk_i2c_set_speed(struct mtk_i2c *i2c, unsigned int parent_clk)
>  	for (clk_div = 1; clk_div <= max_clk_div; clk_div++) {
>  		clk_src = parent_clk / clk_div;
>  
> -		if (target_speed > I2C_MAX_FAST_MODE_FREQ) {
> +		if (target_speed > I2C_MAX_FAST_MODE_PLUS_FREQ) {
>  			/* Set master code speed register */
>  			ret = mtk_i2c_calculate_speed(i2c, clk_src,
>  						      I2C_MAX_FAST_MODE_FREQ,


  reply	other threads:[~2020-09-13 15:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-12  5:57 [PATCH] i2c: mediatek: Fix generic definitions for bus frequencies qii.wang
2020-09-13 15:15 ` Yingjoe Chen [this message]
2020-09-14 12:48 ` Andy Shevchenko
2020-09-15  1:24   ` Qii Wang
2020-09-18 20:45   ` Wolfram Sang

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=1600010156.3039.5.camel@mtksdaap41 \
    --to=yingjoe.chen@mediatek.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=devicetree@vger.kernel.org \
    --cc=leilk.liu@mediatek.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=qii.wang@mediatek.com \
    --cc=srv_heupstream@mediatek.com \
    --cc=wsa@the-dreams.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).