Skip to content

Commit

Permalink
i2c: mediatek: Enable i2c module clock before i2c registers access.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jun Gao authored and Wolfram Sang committed Jan 3, 2018
1 parent 5a10e7d commit f6762ce
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions drivers/i2c/busses/i2c-mt65xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f6762ce

Please sign in to comment.