summaryrefslogtreecommitdiffstats
path: root/drivers/i2c
diff options
context:
space:
mode:
authorJun Gao <jun.gao@mediatek.com>2017-12-19 14:51:03 +0800
committerWolfram Sang <wsa@the-dreams.de>2018-01-04 00:54:02 +0100
commitf6762cedbef91ad1da338538efa811856a717d57 (patch)
treeecbeae62f6862dd2b6f25fe7b3972df484ef265d /drivers/i2c
parent5a10e7d7aafd01dd4310185b2de3c3a7e2fcf06e (diff)
downloadtalos-obmc-linux-f6762cedbef91ad1da338538efa811856a717d57.tar.gz
talos-obmc-linux-f6762cedbef91ad1da338538efa811856a717d57.zip
i2c: mediatek: Enable i2c module clock before i2c registers access.
Make sure i2c module clock has been enabled before i2c registers access. Signed-off-by: Jun Gao <jun.gao@mediatek.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/busses/i2c-mt65xx.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/i2c/busses/i2c-mt65xx.c b/drivers/i2c/busses/i2c-mt65xx.c
index 58d6401871a9..cf23a746cc17 100644
--- a/drivers/i2c/busses/i2c-mt65xx.c
+++ b/drivers/i2c/busses/i2c-mt65xx.c
@@ -861,10 +861,19 @@ static int mtk_i2c_remove(struct platform_device *pdev)
#ifdef CONFIG_PM_SLEEP
static int mtk_i2c_resume(struct device *dev)
{
+ int ret;
struct mtk_i2c *i2c = dev_get_drvdata(dev);
+ ret = mtk_i2c_clock_enable(i2c);
+ if (ret) {
+ dev_err(dev, "clock enable failed!\n");
+ return ret;
+ }
+
mtk_i2c_init_hw(i2c);
+ mtk_i2c_clock_disable(i2c);
+
return 0;
}
#endif
OpenPOWER on IntegriCloud