Skip to content

Commit

Permalink
i2c: i2c-stm32f7: improve loopback in timing algorithm
Browse files Browse the repository at this point in the history
This avoids useless loops inside the I2C timing algorithm.
Actually, we support only one possible solution per prescaler value.
So after finding a solution with a prescaler, the algorithm can
switch directly to the next prescaler value.

Signed-off-by: Nicolas Le Bayon <nicolas.le.bayon@st.com>
Signed-off-by: Bich Hemon <bich.hemon@st.com>
Reviewed-by: Pierre-Yves MORDRET <pierre-yves.mordret@st.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
  • Loading branch information
Nicolas Le Bayon authored and Wolfram Sang committed Mar 20, 2019
1 parent c62ebb3 commit 0d73503
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/i2c/busses/i2c-stm32f7.c
Original file line number Diff line number Diff line change
Expand Up @@ -476,8 +476,12 @@ static int stm32f7_i2c_compute_timing(struct stm32f7_i2c_dev *i2c_dev,

list_add_tail(&v->node,
&solutions);
break;
}
}

if (p_prev == p)
break;
}
}

Expand Down

0 comments on commit 0d73503

Please sign in to comment.