Skip to content

Commit c6e2bd9

Browse files
tmlindWolfram Sang
authored andcommitted
i2c: omap: Use noirq system sleep pm ops to idle device for suspend
We currently get the following error with pixcir_ts driver during a suspend resume cycle: omap_i2c 4802a000.i2c: controller timed out pixcir_ts 1-005c: pixcir_int_enable: can't read reg 0x34 : -110 pixcir_ts 1-005c: Failed to disable interrupt generation: -110 pixcir_ts 1-005c: Failed to stop dpm_run_callback(): pixcir_i2c_ts_resume+0x0/0x98 [pixcir_i2c_ts] returns -110 PM: Device 1-005c failed to resume: error -110 And at least am437x based devices with pixcir_ts will fail to resume to a touchscreen that is configured as the wakeup-source in device tree for these devices. This is because pixcir_ts tries to reconfigure it's registers for noirq suspend which fails. This also leaves i2c-omap in enabled state for suspend. Let's fix the pixcir_ts issue and make sure i2c-omap is suspended by adding SET_NOIRQ_SYSTEM_SLEEP_PM_OPS. Let's also get rid of some ifdefs while at it and replace them with __maybe_unused as SET_RUNTIME_PM_OPS and SET_NOIRQ_SYSTEM_SLEEP_PM_OPS already deal with the various PM Kconfig options. Reported-by: Keerthy <j-keerthy@ti.com> Signed-off-by: Tony Lindgren <tony@atomide.com> Acked-by: Vignesh R <vigneshr@ti.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
1 parent 8834f56 commit c6e2bd9

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

drivers/i2c/busses/i2c-omap.c

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1500,8 +1500,7 @@ static int omap_i2c_remove(struct platform_device *pdev)
15001500
return 0;
15011501
}
15021502

1503-
#ifdef CONFIG_PM
1504-
static int omap_i2c_runtime_suspend(struct device *dev)
1503+
static int __maybe_unused omap_i2c_runtime_suspend(struct device *dev)
15051504
{
15061505
struct omap_i2c_dev *omap = dev_get_drvdata(dev);
15071506

@@ -1527,7 +1526,7 @@ static int omap_i2c_runtime_suspend(struct device *dev)
15271526
return 0;
15281527
}
15291528

1530-
static int omap_i2c_runtime_resume(struct device *dev)
1529+
static int __maybe_unused omap_i2c_runtime_resume(struct device *dev)
15311530
{
15321531
struct omap_i2c_dev *omap = dev_get_drvdata(dev);
15331532

@@ -1542,20 +1541,18 @@ static int omap_i2c_runtime_resume(struct device *dev)
15421541
}
15431542

15441543
static const struct dev_pm_ops omap_i2c_pm_ops = {
1544+
SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
1545+
pm_runtime_force_resume)
15451546
SET_RUNTIME_PM_OPS(omap_i2c_runtime_suspend,
15461547
omap_i2c_runtime_resume, NULL)
15471548
};
1548-
#define OMAP_I2C_PM_OPS (&omap_i2c_pm_ops)
1549-
#else
1550-
#define OMAP_I2C_PM_OPS NULL
1551-
#endif /* CONFIG_PM */
15521549

15531550
static struct platform_driver omap_i2c_driver = {
15541551
.probe = omap_i2c_probe,
15551552
.remove = omap_i2c_remove,
15561553
.driver = {
15571554
.name = "omap_i2c",
1558-
.pm = OMAP_I2C_PM_OPS,
1555+
.pm = &omap_i2c_pm_ops,
15591556
.of_match_table = of_match_ptr(omap_i2c_of_match),
15601557
},
15611558
};

0 commit comments

Comments
 (0)