i2c: fix clk get rate erro [1/2]

PD#SWPL-141317

Problem:
get erro clk rate

Solution:
move clk api frontally

Verify:
A5 av400

Change-Id: I78ade63d323796ec6fa1a6e1c697ba3be07a736e
Signed-off-by: junyi.zhao <junyi.zhao@amlogic.com>
This commit is contained in:
junyi.zhao
2023-09-27 15:54:01 +08:00
committed by Luan Yuan
parent 7fc88a650e
commit 104f74eeeb
+5 -1
View File
@@ -636,6 +636,11 @@ static int meson_i2c_probe(struct platform_device *pdev)
ret = meson_i2c_speed_debug(&pdev->dev);
if (ret)
dev_err(&pdev->dev, "Creat i2c speed debug sysfs failed\n");
i2c->clk_rate = clk_get_rate(i2c->clk);
if (i2c->clk_rate == 0) {
dev_err(&pdev->dev, "failed to get clk rate\n");
return -EINVAL;
}
#endif
/*
* A transfer is triggered when START bit changes from 0 to 1.
@@ -650,7 +655,6 @@ static int meson_i2c_probe(struct platform_device *pdev)
}
#ifdef CONFIG_AMLOGIC_MODIFY
i2c->clk_rate = clk_get_rate(i2c->clk);
meson_i2c_set_clk_div(i2c);
pm_runtime_mark_last_busy(i2c->dev);
pm_runtime_put_autosuspend(i2c->dev);