Skip to contentSkip to conversation

Fix some definitions for bus frequency

PATCH Applied Qii Wang 2 participants 5 messages Sep 17, 2020 – Sep 18, 2020

Subsystems (3)
lore
Share & tools
lore

Qii Wang

author maintainer
#0 lore raw

cover Fix some definitions for bus frequency

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(-)
Signature · 1 line
1.9.1
author maintainer
#1 lore raw

PATCH 1/2 i2c: mediatek: Fix generic definitions for bus frequency

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

---
 drivers/i2c/busses/i2c-mt65xx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/i2c/busses/i2c-mt65xx.c +2 -2
index efc1404..a1978eb 100644
@@ -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;
Signature · 1 line
1.9.1
#2 lore raw

Re: [PATCH 1/2] i2c: mediatek: Fix generic definitions for bus frequency

Quoted 8 lines · Qii Wang

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

Applied to for-current, thanks!

author maintainer
#3 lore raw

PATCH 2/2 i2c: mediatek: Send i2c master code at more than 1MHz

In reply to Qii Wang

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.

---
 drivers/i2c/busses/i2c-mt65xx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/busses/i2c-mt65xx.c +1 -1
index a1978eb..0cbdfbe 100644
@@ -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,
Signature · 1 line
1.9.1
#4 lore raw

Re: [PATCH 2/2] i2c: mediatek: Send i2c master code at more than 1MHz

Quoted 5 lines · Qii Wang

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.

Applied to for-current, thanks!