Thread (17 messages) 17 messages, 3 authors, 2021-07-17

Re: [PATCH 8/8] i2c: mediatek: modify bus speed calculation formula

From: Tzung-Bi Shih <hidden>
Date: 2021-07-15 07:09:39
Also in: linux-arm-kernel, linux-devicetree, linux-i2c, lkml

On Thu, Jul 15, 2021 at 10:32 AM Kewei Xu [off-list ref] wrote:
When clock-div is 0 or greater than 1, the bus speed
calculated by the old speed calculation formula will be
larger than the target speed. So we update the formula.
The patch sounds like a fix up.  Need a "Fixes" tag.
        for (clk_div = 1; clk_div <= max_clk_div; clk_div++) {
                clk_src = parent_clk / clk_div;
+               i2c->ac_timing.inter_clk_div = clk_div - 1;
Using the way to pass the parameter "inter_clk_div" to
mtk_i2c_calculate_speed() looks like a hack.  inter_clk_div is set
again[1] next to the for loop.

[1]: https://elixir.bootlin.com/linux/v5.14-rc1/source/drivers/i2c/busses/i2c-mt65xx.c#L831



I have no domain knowledge of what/how the patch fixes.  But if this
is a standalone fixup patch, suggest separating to an independent
patch.

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help