[COMMON] i2c: exynos5: add runtime pm callback status flag
authorYoungmin Nam <youngmin.nam@samsung.com>
Mon, 6 Feb 2017 03:27:13 +0000 (12:27 +0900)
committermyung-su.cha <myung-su.cha@samsung.com>
Wed, 9 May 2018 12:14:45 +0000 (21:14 +0900)
Adds runtime pm suspend / resume callback status flag to check
whether runtime pm callback was called or not.

Change-Id: I603d33f730b8b778fbfeb17e827f602416f66524
Signed-off-by: Youngmin Nam <youngmin.nam@samsung.com>
drivers/i2c/busses/i2c-exynos5.c
drivers/i2c/busses/i2c-exynos5.h

index 65e6e781c7cf57c152051520b2efb65d57d1b5bd..7e297cea3e42b8eb22cbec1aa772b938e8472f65 100644 (file)
@@ -1129,6 +1129,7 @@ static int exynos5_i2c_runtime_suspend(struct device *dev)
 
        clk_disable(i2c->clk);
        exynos_update_ip_idle_status(i2c->idle_ip_index, 1);
+       i2c->runtime_resumed = 0;
 
        return 0;
 }
@@ -1141,6 +1142,7 @@ static int exynos5_i2c_runtime_resume(struct device *dev)
 
        exynos_update_ip_idle_status(i2c->idle_ip_index, 0);
        ret = clk_enable(i2c->clk);
+       i2c->runtime_resumed = 1;
        if (ret) {
                exynos_update_ip_idle_status(i2c->idle_ip_index, 1);
                return ret;
index cf299da1838fe7e4b1efd519b3cfa91d756856a3..be94eef105a0e1a285f0a5713a3e45fc5964f985 100644 (file)
@@ -55,5 +55,6 @@ struct exynos5_i2c {
 
        int                     idle_ip_index;
        int                     reset_before_trans;
+       unsigned int            runtime_resumed;
 };
 #endif /*__I2C_EXYNOS5_H */