platform/chrome: chromeos_tbmc: Report wake events
authorRavi Chandra Sadineni <ravisadineni@chromium.org>
Fri, 30 Aug 2019 23:14:04 +0000 (16:14 -0700)
committerEnric Balletbo i Serra <enric.balletbo@collabora.com>
Thu, 12 Sep 2019 14:01:35 +0000 (16:01 +0200)
Mark chromeos_tbmc as wake capable and report wake events. This helps to
abort suspend on seeing a tablet mode switch event when kernel is
suspending. This also helps identifying if chromeos_tbmc is the wake
source.

Signed-off-by: Ravi Chandra Sadineni <ravisadineni@chromium.org>
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
drivers/platform/chrome/chromeos_tbmc.c

index ce259ec..d1cf8f3 100644 (file)
@@ -47,6 +47,7 @@ static __maybe_unused int chromeos_tbmc_resume(struct device *dev)
 
 static void chromeos_tbmc_notify(struct acpi_device *adev, u32 event)
 {
+       acpi_pm_wakeup_event(&adev->dev);
        switch (event) {
        case 0x80:
                chromeos_tbmc_query_switch(adev, adev->driver_data);
@@ -90,6 +91,7 @@ static int chromeos_tbmc_add(struct acpi_device *adev)
                dev_err(dev, "cannot register input device\n");
                return ret;
        }
+       device_init_wakeup(dev, true);
        return 0;
 }