Skip to content

Commit

Permalink
i2c: fix index 1~4.
Browse files Browse the repository at this point in the history
fix update for index 1~4

Signed-off-by: Ryan Chen <ryan_chen@aspeedtech.com>
Change-Id: I01c5111ae2c4832319595fcd03d180b9ede9fcd8
  • Loading branch information
aspeedtech committed Dec 13, 2023
1 parent 4e63f18 commit 476bb03
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/i2c/busses/i2c-ast2600.c
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ static u32 ast2600_select_i2c_clock(struct ast2600_i2c_bus *i2c_bus)
for (int i = 0; i < 16; i++) {
if (i == 0)
base_clk[i] = i2c_bus->apb_clk;
else if ((i > 0) || (i < 5))
else if ((i > 0) && (i < 5))
base_clk[i] = (i2c_bus->apb_clk * 2) /
(((clk_div_reg >> ((i - 1) * 8)) & GENMASK(7, 0)) + 2);
else
Expand Down

0 comments on commit 476bb03

Please sign in to comment.