mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-29 23:53:32 +00:00
i2c: mediatek: Move suspend and resume handling to NOIRQ phase
[ Upstream commit de96c3943f
]
Some i2c device driver indirectly uses I2C driver when it is now
being suspended. The i2c devices driver is suspended during the
NOIRQ phase and this cannot be changed due to other dependencies.
Therefore, we also need to move the suspend handling for the I2C
controller driver to the NOIRQ phase as well.
Signed-off-by: Qii Wang <qii.wang@mediatek.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
618b65dbde
commit
d1eb418334
1 changed files with 16 additions and 3 deletions
|
@ -1008,7 +1008,8 @@ static int mtk_i2c_probe(struct platform_device *pdev)
|
|||
mtk_i2c_clock_disable(i2c);
|
||||
|
||||
ret = devm_request_irq(&pdev->dev, irq, mtk_i2c_irq,
|
||||
IRQF_TRIGGER_NONE, I2C_DRV_NAME, i2c);
|
||||
IRQF_NO_SUSPEND | IRQF_TRIGGER_NONE,
|
||||
I2C_DRV_NAME, i2c);
|
||||
if (ret < 0) {
|
||||
dev_err(&pdev->dev,
|
||||
"Request I2C IRQ %d fail\n", irq);
|
||||
|
@ -1035,7 +1036,16 @@ static int mtk_i2c_remove(struct platform_device *pdev)
|
|||
}
|
||||
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
static int mtk_i2c_resume(struct device *dev)
|
||||
static int mtk_i2c_suspend_noirq(struct device *dev)
|
||||
{
|
||||
struct mtk_i2c *i2c = dev_get_drvdata(dev);
|
||||
|
||||
i2c_mark_adapter_suspended(&i2c->adap);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int mtk_i2c_resume_noirq(struct device *dev)
|
||||
{
|
||||
int ret;
|
||||
struct mtk_i2c *i2c = dev_get_drvdata(dev);
|
||||
|
@ -1050,12 +1060,15 @@ static int mtk_i2c_resume(struct device *dev)
|
|||
|
||||
mtk_i2c_clock_disable(i2c);
|
||||
|
||||
i2c_mark_adapter_resumed(&i2c->adap);
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
static const struct dev_pm_ops mtk_i2c_pm = {
|
||||
SET_SYSTEM_SLEEP_PM_OPS(NULL, mtk_i2c_resume)
|
||||
SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(mtk_i2c_suspend_noirq,
|
||||
mtk_i2c_resume_noirq)
|
||||
};
|
||||
|
||||
static struct platform_driver mtk_i2c_driver = {
|
||||
|
|
Loading…
Reference in a new issue