From 6081defc19a17da1cc3db6df84f7d72cad21f2e6 Mon Sep 17 00:00:00 2001 From: Youngmin Nam Date: Wed, 22 Apr 2015 02:13:02 +0900 Subject: [PATCH] i2c: s3c2410: Enable idle ip status Change-Id: I754fd76eb9dd8c3a223f9e720cee527a265234f0 Signed-off-by: Youngmin Nam --- drivers/i2c/busses/i2c-s3c2410.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c index da853a1d094e..f0a9b0d81567 100644 --- a/drivers/i2c/busses/i2c-s3c2410.c +++ b/drivers/i2c/busses/i2c-s3c2410.c @@ -38,6 +38,7 @@ #include #include +#include #ifdef CONFIG_CPU_IDLE #include @@ -139,6 +140,7 @@ struct s3c24xx_i2c { struct s3c2410_platform_i2c *pdata; int gpios[2]; struct pinctrl *pctrl; + int idle_ip_index; }; static const struct platform_device_id s3c24xx_driver_ids[] = { @@ -844,6 +846,7 @@ static int s3c24xx_i2c_xfer(struct i2c_adapter *adap, int ret; pm_runtime_get_sync(&adap->dev); + exynos_update_ip_idle_status(i2c->idle_ip_index, 0); ret = clk_enable(i2c->clk); if (ret) return ret; @@ -858,6 +861,7 @@ static int s3c24xx_i2c_xfer(struct i2c_adapter *adap, if (ret != -EAGAIN) { clk_disable(i2c->clk); + exynos_update_ip_idle_status(i2c->idle_ip_index, 1); pm_runtime_put(&adap->dev); return ret; } @@ -868,6 +872,7 @@ static int s3c24xx_i2c_xfer(struct i2c_adapter *adap, } clk_disable(i2c->clk); + exynos_update_ip_idle_status(i2c->idle_ip_index, 1); pm_runtime_put(&adap->dev); return -EREMOTEIO; } @@ -1187,6 +1192,8 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev) i2c->adap.class = I2C_CLASS_DEPRECATED; i2c->tx_setup = 50; + i2c->idle_ip_index = exynos_get_idle_ip_index(dev_name(&pdev->dev)); + init_waitqueue_head(&i2c->wait); /* find the clock and enable it */ -- 2.20.1