i2c: s3c2410: set 24Mhz to NCLK for fimc_is_i2c
authorHyunki Koo <hyunki00.koo@samsung.com>
Tue, 22 Jul 2014 13:37:21 +0000 (22:37 +0900)
committermyung-su.cha <myung-su.cha@samsung.com>
Thu, 10 May 2018 04:40:49 +0000 (13:40 +0900)
Change-Id: I18b8cbcec5a6c8ac8a37235805323755210db6e2
Signed-off-by: Hyunki Koo <hyunki00.koo@samsung.com>
drivers/i2c/busses/i2c-s3c2410.c

index 4e2821e1b429069f249fff07fa0a4d86aac896eb..e3bfbea0e97f8529084961a30eeaf8093f0884db 100644 (file)
@@ -934,12 +934,17 @@ static int s3c24xx_i2c_calcdivisor(struct s3c24xx_i2c *i2c,
 static int s3c24xx_i2c_clockrate(struct s3c24xx_i2c *i2c, unsigned int *got)
 {
        struct s3c2410_platform_i2c *pdata = i2c->pdata;
-       unsigned long clkin = clk_get_rate(i2c->rate_clk);
+       unsigned long clkin;
        unsigned int divs, div1;
        unsigned long target_frequency;
        u32 iiccon;
        int freq;
 
+       if (i2c->quirks & QUIRK_FIMC_I2C)
+               clkin = 24000000;/* NCLK is fixed 24Mhz */
+       else
+               clkin = clk_get_rate(i2c->rate_clk);
+
        i2c->clkrate = clkin;
        clkin /= 1000;          /* clkin now in KHz */