Skip to content
Snippets Groups Projects
Commit 83d745dd authored by Piotr Wilczek's avatar Piotr Wilczek Committed by Tom Rini
Browse files

exynos:clock: Add i2c clock


This patch adds i2c clock for Exynos4

Signed-off-by: default avatarPiotr Wilczek <p.wilczek@samsung.com>
Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
CC: Minkyu Kang <mk7.kang@samsung.com>
parent 66839773
No related branches found
No related tags found
No related merge requests found
......@@ -732,6 +732,21 @@ static unsigned long exynos5_get_i2c_clk(void)
return aclk_66;
}
static unsigned long exynos4_get_i2c_clk(void)
{
struct exynos4_clock *clk =
(struct exynos4_clock *)samsung_get_base_clock();
unsigned long sclk, aclk_100;
unsigned int ratio;
sclk = get_pll_clk(APLL);
ratio = (readl(&clk->div_top)) >> 4;
ratio &= 0xf;
aclk_100 = sclk / (ratio + 1);
return aclk_100;
}
unsigned long get_pll_clk(int pllreg)
{
if (cpu_is_exynos5())
......@@ -752,6 +767,8 @@ unsigned long get_i2c_clk(void)
{
if (cpu_is_exynos5()) {
return exynos5_get_i2c_clk();
} else if (cpu_is_exynos4()) {
return exynos4_get_i2c_clk();
} else {
debug("I2C clock is not set for this CPU\n");
return 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment