the max17042 fuel gauge wakes the system up from suspend
after "a few minutes" the system would resume (most probably) because of the max17042 driver. (all wakeup sources are in debugfs' wakeup_sources
)
what can go wrong when doing the following? How should resume() compensate for this? It's definitely not "necessary" from a users point of view to wake up as often as we do now here. It might be when the battery is low? Can we even detect that?
--- a/drivers/power/supply/max17042_battery.c
+++ b/drivers/power/supply/max17042_battery.c
@@ -1211,7 +1211,6 @@ static int max17042_suspend(struct device *dev)
*/
if (chip->client->irq) {
disable_irq(chip->client->irq);
- enable_irq_wake(chip->client->irq);
}
return 0;
@@ -1222,7 +1221,6 @@ static int max17042_resume(struct device *dev)
struct max17042_chip *chip = dev_get_drvdata(dev);
if (chip->client->irq) {
- disable_irq_wake(chip->client->irq);
enable_irq(chip->client->irq);
/* re-program the SOC thresholds to 1% change */
max17042_set_soc_threshold(chip, 1);