power: max17048: set wakeup capability
Venkat Reddy Talla [Thu, 22 Aug 2013 08:51:34 +0000 (13:51 +0530)]
 set the device as wakeup capable and let the user space enable
 to wakeup the system from LP0/Suspend state.

 Bug 1342974

Change-Id: I00946d40a45837a64d2d4b59e3852e2213736cfa
Signed-off-by: Venkat Reddy Talla <vreddytalla@nvidia.com>
Reviewed-on: http://git-master/r/264782
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>

drivers/power/max17048_battery.c

index 1b4ce2a..2feb3f3 100644 (file)
@@ -770,6 +770,7 @@ static int __devinit max17048_probe(struct i2c_client *client,
                        goto irq_reg_error;
                }
        }
+       device_set_wakeup_capable(&client->dev, 1);
 
        return 0;
 irq_clear_error:
@@ -817,7 +818,7 @@ static int max17048_suspend(struct i2c_client *client,
        struct max17048_chip *chip = i2c_get_clientdata(client);
        int ret;
 
-       if (client->irq) {
+       if (device_may_wakeup(&client->dev)) {
                enable_irq_wake(chip->client->irq);
        }
        cancel_delayed_work_sync(&chip->work);
@@ -843,7 +844,7 @@ static int max17048_resume(struct i2c_client *client)
        }
 
        schedule_delayed_work(&chip->work, MAX17048_DELAY);
-       if (client->irq) {
+       if (device_may_wakeup(&client->dev)) {
                disable_irq_wake(client->irq);
        }