Skip to content
Commit 249051f4 authored by Max Schwarz's avatar Max Schwarz Committed by Wolfram Sang
Browse files

i2c: rk3x: handle dynamic clock rate changes correctly



The i2c input clock can change dynamically, e.g. on the RK3066 where
pclk_i2c0 and pclk_i2c1 are connected to the armclk, which changes
rate on cpu frequency scaling.

Until now, we incorrectly called clk_get_rate() while holding the
i2c->lock in rk3x_i2c_xfer() to adapt to clock rate changes.
Thanks to Huang Tao for reporting this issue.

Do it properly now using the clk notifier framework. The callback
logic was taken from i2c-cadence.c.

Also rename all misleading "i2c_rate" variables to "clk_rate", as they
describe the *input* clk rate.

Signed-off-by: default avatarMax Schwarz <max.schwarz@online.de>
Tested-by: Doug Anderson <dianders@chromium.org> on RK3288
Reviewed-by: default avatarDoug Anderson <dianders@chromium.org>
Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
parent 727f9c2d
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment