Skip to contentSkip to conversation

platform/chrome: chromeos_tbmc : Report wake events.

PATCH In review Ravi Chandra Sadineni 2 participants 3 messages Aug 30, 2019 – Sep 19, 2019 Chrome hardware platform support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 platform/chrome: chromeos_tbmc : Report wake events.

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 chroemos_tbmc is the wake source.

---
 drivers/platform/chrome/chromeos_tbmc.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/platform/chrome/chromeos_tbmc.c +2 -0
index ce259ec9f990..d1cf8f3463ce 100644
@@ -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;
 }
 
Signature · 1 line
2.21.0
#1 lore raw

Hi Ravi,

Many thanks for this patch.

Quoted 6 lines · Ravi Chandra Sadineni

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 chroemos_tbmc is the wake source.

The patch looks good to me, I'll wait a bit before pick the patch for I can get a Tested-by from someone as I don't think I have the hardware to test this (no x86/tablet devices on my hand)

For my own reference:

Thanks,
Enric

Quoted 25 lines
---
 drivers/platform/chrome/chromeos_tbmc.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/platform/chrome/chromeos_tbmc.c +2 -0
index ce259ec9f990..d1cf8f3463ce 100644
@@ -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;
 }
 
#2 lore raw
In reply to Ravi Chandra Sadineni

Hi,

Quoted 6 lines · Ravi Chandra Sadineni

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 chroemos_tbmc is the wake source.

Applied for 5.4, the patches went to linux-next some time ago but sorry for late reply.

Thanks,
Enric

Quoted 25 lines
---
 drivers/platform/chrome/chromeos_tbmc.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/platform/chrome/chromeos_tbmc.c +2 -0
index ce259ec9f990..d1cf8f3463ce 100644
@@ -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;
 }