提交 09027e08 编写于 作者: L Liguo Zhang 提交者: Wolfram Sang

i2c: mediatek: add i2c resume support

mt65xx i2c controller initial setting will be cleared after system suspend,
so we should init mt65xx i2c controller again when system resume.
Signed-off-by: NLiguo Zhang <liguo.zhang@mediatek.com>
Signed-off-by: NEddie Huang <eddie.huang@mediatek.com>
Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
上级 1c4b6c3b
......@@ -728,11 +728,27 @@ static int mtk_i2c_remove(struct platform_device *pdev)
return 0;
}
#ifdef CONFIG_PM_SLEEP
static int mtk_i2c_resume(struct device *dev)
{
struct mtk_i2c *i2c = dev_get_drvdata(dev);
mtk_i2c_init_hw(i2c);
return 0;
}
#endif
static const struct dev_pm_ops mtk_i2c_pm = {
SET_SYSTEM_SLEEP_PM_OPS(NULL, mtk_i2c_resume)
};
static struct platform_driver mtk_i2c_driver = {
.probe = mtk_i2c_probe,
.remove = mtk_i2c_remove,
.driver = {
.name = I2C_DRV_NAME,
.pm = &mtk_i2c_pm,
.of_match_table = of_match_ptr(mtk_i2c_of_match),
},
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册