linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Fix some definitions for bus frequency
@ 2020-09-17 11:55 Qii Wang
  2020-09-17 11:55 ` [PATCH 1/2] i2c: mediatek: Fix generic " Qii Wang
  2020-09-17 11:55 ` [PATCH 2/2] i2c: mediatek: Send i2c master code at more than 1MHz Qii Wang
  0 siblings, 2 replies; 5+ messages in thread
From: Qii Wang @ 2020-09-17 11:55 UTC (permalink / raw)
  To: wsa
  Cc: qii.wang, srv_heupstream, leilk.liu, linux-kernel,
	linux-mediatek, linux-i2c, matthias.bgg, linux-arm-kernel

This series are based on 5.9-rc1 and we provide two i2c patches
to fix some definitions for bus frequency.

Qii Wang (2):
  i2c: mediatek: Fix generic definitions for bus frequency
  i2c: mediatek: Send i2c master code at more than 1MHz

 drivers/i2c/busses/i2c-mt65xx.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

-- 
1.9.1

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/2] i2c: mediatek: Fix generic definitions for bus frequency
  2020-09-17 11:55 [PATCH 0/2] Fix some definitions for bus frequency Qii Wang
@ 2020-09-17 11:55 ` Qii Wang
  2020-09-18 20:52   ` wsa
  2020-09-17 11:55 ` [PATCH 2/2] i2c: mediatek: Send i2c master code at more than 1MHz Qii Wang
  1 sibling, 1 reply; 5+ messages in thread
From: Qii Wang @ 2020-09-17 11:55 UTC (permalink / raw)
  To: wsa
  Cc: qii.wang, srv_heupstream, leilk.liu, linux-kernel,
	linux-mediatek, linux-i2c, matthias.bgg, linux-arm-kernel

The max frequency of mediatek i2c controller driver is
I2C_MAX_HIGH_SPEED_MODE_FREQ, not I2C_MAX_FAST_MODE_PLUS_FREQ.
Fix it.

Fixes: 90224e6468e1 ("i2c: drivers: Use generic definitions
for bus frequencies")
Reviewed-by: Yingjoe Chen <yingjoe.chen@mediatek.com>
Signed-off-by: Qii Wang <qii.wang@mediatek.com>
---
 drivers/i2c/busses/i2c-mt65xx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-mt65xx.c b/drivers/i2c/busses/i2c-mt65xx.c
index efc1404..a1978eb 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;
-- 
1.9.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] i2c: mediatek: Send i2c master code at more than 1MHz
  2020-09-17 11:55 [PATCH 0/2] Fix some definitions for bus frequency Qii Wang
  2020-09-17 11:55 ` [PATCH 1/2] i2c: mediatek: Fix generic " Qii Wang
@ 2020-09-17 11:55 ` Qii Wang
  2020-09-18 20:52   ` wsa
  1 sibling, 1 reply; 5+ messages in thread
From: Qii Wang @ 2020-09-17 11:55 UTC (permalink / raw)
  To: wsa
  Cc: qii.wang, srv_heupstream, leilk.liu, linux-kernel,
	linux-mediatek, linux-i2c, matthias.bgg, linux-arm-kernel

The master code needs to being sent when the speed is more than
I2C_MAX_FAST_MODE_PLUS_FREQ, not I2C_MAX_FAST_MODE_FREQ in the
latest I2C-bus specification and user manual.

Signed-off-by: Qii Wang <qii.wang@mediatek.com>
---
 drivers/i2c/busses/i2c-mt65xx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-mt65xx.c b/drivers/i2c/busses/i2c-mt65xx.c
index a1978eb..0cbdfbe 100644
--- a/drivers/i2c/busses/i2c-mt65xx.c
+++ b/drivers/i2c/busses/i2c-mt65xx.c
@@ -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,
-- 
1.9.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] i2c: mediatek: Fix generic definitions for bus frequency
  2020-09-17 11:55 ` [PATCH 1/2] i2c: mediatek: Fix generic " Qii Wang
@ 2020-09-18 20:52   ` wsa
  0 siblings, 0 replies; 5+ messages in thread
From: wsa @ 2020-09-18 20:52 UTC (permalink / raw)
  To: Qii Wang
  Cc: srv_heupstream, leilk.liu, linux-kernel, linux-mediatek,
	linux-i2c, matthias.bgg, linux-arm-kernel


[-- Attachment #1.1: Type: text/plain, Size: 431 bytes --]

On Thu, Sep 17, 2020 at 07:55:41PM +0800, Qii Wang wrote:
> The max frequency of mediatek i2c controller driver is
> I2C_MAX_HIGH_SPEED_MODE_FREQ, not I2C_MAX_FAST_MODE_PLUS_FREQ.
> Fix it.
> 
> Fixes: 90224e6468e1 ("i2c: drivers: Use generic definitions
> for bus frequencies")
> Reviewed-by: Yingjoe Chen <yingjoe.chen@mediatek.com>
> Signed-off-by: Qii Wang <qii.wang@mediatek.com>

Applied to for-current, thanks!


[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] i2c: mediatek: Send i2c master code at more than 1MHz
  2020-09-17 11:55 ` [PATCH 2/2] i2c: mediatek: Send i2c master code at more than 1MHz Qii Wang
@ 2020-09-18 20:52   ` wsa
  0 siblings, 0 replies; 5+ messages in thread
From: wsa @ 2020-09-18 20:52 UTC (permalink / raw)
  To: Qii Wang
  Cc: srv_heupstream, leilk.liu, linux-kernel, linux-mediatek,
	linux-i2c, matthias.bgg, linux-arm-kernel


[-- Attachment #1.1: Type: text/plain, Size: 333 bytes --]

On Thu, Sep 17, 2020 at 07:55:42PM +0800, Qii Wang wrote:
> The master code needs to being sent when the speed is more than
> I2C_MAX_FAST_MODE_PLUS_FREQ, not I2C_MAX_FAST_MODE_FREQ in the
> latest I2C-bus specification and user manual.
> 
> Signed-off-by: Qii Wang <qii.wang@mediatek.com>

Applied to for-current, thanks!


[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-09-18 20:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-17 11:55 [PATCH 0/2] Fix some definitions for bus frequency Qii Wang
2020-09-17 11:55 ` [PATCH 1/2] i2c: mediatek: Fix generic " Qii Wang
2020-09-18 20:52   ` wsa
2020-09-17 11:55 ` [PATCH 2/2] i2c: mediatek: Send i2c master code at more than 1MHz Qii Wang
2020-09-18 20:52   ` wsa

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).