Commit 991e7ecf authored by Guennadi Liakhovetski's avatar Guennadi Liakhovetski Committed by Wolfram Sang

i2c: rcar: use per-device clock

Using the same clock for all device instances is non-portable and obtaining
clock references by an ID without using a device pointer is discouraged.
This is also not needed, because on platforms, where this driver is used,
suitable clocks are available for the I2C controllers, that are children of
the peripheral clock and just pass its rate 1-to-1 to controllers. This
patch switches the driver to obtain references to correct clocks.
Signed-off-by: default avatarGuennadi Liakhovetski <g.liakhovetski+renesas@gmail.com>
Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
parent 330c824a
...@@ -227,7 +227,7 @@ static int rcar_i2c_clock_calculate(struct rcar_i2c_priv *priv, ...@@ -227,7 +227,7 @@ static int rcar_i2c_clock_calculate(struct rcar_i2c_priv *priv,
u32 bus_speed, u32 bus_speed,
struct device *dev) struct device *dev)
{ {
struct clk *clkp = clk_get(NULL, "peripheral_clk"); struct clk *clkp = clk_get(dev, NULL);
u32 scgd, cdf; u32 scgd, cdf;
u32 round, ick; u32 round, ick;
u32 scl; u32 scl;
......
Markdown is supported
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