Let's move SYS_I2C_CFG register save/restore during s2r into i2c driver.
This will help in removing static iodesc based mapping from exynos.c.
Also will help in removing SoC specific checks in pm.c making it
more independent of such macros.
CC: Wolfram Sang <wsa@xxxxxxxxxxxxx>
CC: Russell King <linux@xxxxxxxxxxxxxxxx>
CC: linux-i2c@xxxxxxxxxxxxxxx
Signed-off-by: Pankaj Dubey <pankaj.dubey@xxxxxxxxxxx>
---
arch/arm/mach-exynos/exynos.c | 12 +-----------
arch/arm/mach-exynos/include/mach/map.h | 3 ---
arch/arm/mach-exynos/pm.c | 10 ----------
arch/arm/mach-exynos/regs-sys.h | 22 ----------------------
drivers/i2c/busses/i2c-s3c2410.c | 8 ++++++++
5 files changed, 9 insertions(+), 46 deletions(-)
delete mode 100644 arch/arm/mach-exynos/regs-sys.h
diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
index 0420150..2095a01 100644
--- a/drivers/i2c/busses/i2c-s3c2410.c
+++ b/drivers/i2c/busses/i2c-s3c2410.c
@@ -133,6 +133,7 @@ struct s3c24xx_i2c {
struct notifier_block freq_transition;
#endif
struct regmap *sysreg;
+ unsigned int syc_cfg;
};
static struct platform_device_id s3c24xx_driver_ids[] = {
@@ -1293,6 +1294,9 @@ static int s3c24xx_i2c_suspend_noirq(struct device *dev)
struct platform_device *pdev = to_platform_device(dev);
struct s3c24xx_i2c *i2c = platform_get_drvdata(pdev);
+ if (i2c->sysreg)
+ regmap_read(i2c->sysreg, EXYNOS5_SYS_I2C_CFG, &i2c->syc_cfg);
+
i2c->suspended = 1;
return 0;
@@ -1304,6 +1308,10 @@ static int s3c24xx_i2c_resume(struct device *dev)
struct s3c24xx_i2c *i2c = platform_get_drvdata(pdev);
i2c->suspended = 0;
+
+ if (i2c->sysreg)
+ regmap_write(i2c->sysreg, i2c->syc_cfg, EXYNOS5_SYS_I2C_CFG);
+