summaryrefslogtreecommitdiffstats
path: root/0006-Input-axp20x-pek-Add-wakeup-support.patch
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2017-06-14 17:30:36 +0200
committerHans de Goede <hdegoede@redhat.com>2017-06-23 10:59:39 +0200
commit88f3771491aa5e04aeb32607a30aaa632158e961 (patch)
tree6cd01958277a7f55962a826fd7a6d72d1c5454f7 /0006-Input-axp20x-pek-Add-wakeup-support.patch
parent6b98e5e530e3b2c55e00df68c9537ac767058da5 (diff)
downloadkernel-88f3771491aa5e04aeb32607a30aaa632158e961.tar.gz
kernel-88f3771491aa5e04aeb32607a30aaa632158e961.tar.xz
kernel-88f3771491aa5e04aeb32607a30aaa632158e961.zip
Improve Bay and Cherry Trail device support
- Enable AXP288 PMIC support on x86_64 for battery charging and monitoring support on Bay and Cherry Trail tablets and laptops - Enable various drivers for peripherals found on Bay and Cherry Trail tablets - Add some small patches fixing suspend/resume touchscreen and accelerometer issues on various Bay and Cherry Trail tablets
Diffstat (limited to '0006-Input-axp20x-pek-Add-wakeup-support.patch')
-rw-r--r--0006-Input-axp20x-pek-Add-wakeup-support.patch67
1 files changed, 67 insertions, 0 deletions
diff --git a/0006-Input-axp20x-pek-Add-wakeup-support.patch b/0006-Input-axp20x-pek-Add-wakeup-support.patch
new file mode 100644
index 000000000..1ec9659bd
--- /dev/null
+++ b/0006-Input-axp20x-pek-Add-wakeup-support.patch
@@ -0,0 +1,67 @@
+From fbac4c05ec1d7c2d949f50baf1e934cbfbb6a494 Mon Sep 17 00:00:00 2001
+From: Hans de Goede <hdegoede@redhat.com>
+Date: Mon, 17 Apr 2017 22:06:25 +0200
+Subject: [PATCH 06/16] Input: axp20x-pek - Add wakeup support
+
+At least on devices with the AXP288 PMIC the device is expected to
+wakeup from suspend when the power-button gets pressed, add support
+for this.
+
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+---
+ drivers/input/misc/axp20x-pek.c | 28 ++++++++++++++++++++++++++++
+ 1 file changed, 28 insertions(+)
+
+diff --git a/drivers/input/misc/axp20x-pek.c b/drivers/input/misc/axp20x-pek.c
+index 400869e61a06..5f16fceaae83 100644
+--- a/drivers/input/misc/axp20x-pek.c
++++ b/drivers/input/misc/axp20x-pek.c
+@@ -253,6 +253,9 @@ static int axp20x_pek_probe_input_device(struct axp20x_pek *axp20x_pek,
+ return error;
+ }
+
++ if (axp20x_pek->axp20x->variant == AXP288_ID)
++ enable_irq_wake(axp20x_pek->irq_dbr);
++
+ return 0;
+ }
+
+@@ -331,10 +334,35 @@ static int axp20x_pek_probe(struct platform_device *pdev)
+ return 0;
+ }
+
++static int __maybe_unused axp20x_pek_resume_noirq(struct device *dev)
++{
++ struct axp20x_pek *axp20x_pek = dev_get_drvdata(dev);
++
++ if (axp20x_pek->axp20x->variant != AXP288_ID)
++ return 0;
++
++ /*
++ * Clear interrupts from button presses during suspend, to avoid
++ * a wakeup power-button press getting reported to userspace.
++ */
++ regmap_write(axp20x_pek->axp20x->regmap,
++ AXP20X_IRQ1_STATE + AXP288_IRQ_POKN / 8,
++ BIT(AXP288_IRQ_POKN % 8));
++
++ return 0;
++}
++
++const struct dev_pm_ops axp20x_pek_pm_ops = {
++#ifdef CONFIG_PM_SLEEP
++ .resume_noirq = axp20x_pek_resume_noirq,
++#endif
++};
++
+ static struct platform_driver axp20x_pek_driver = {
+ .probe = axp20x_pek_probe,
+ .driver = {
+ .name = "axp20x-pek",
++ .pm = &axp20x_pek_pm_ops,
+ },
+ };
+ module_platform_driver(axp20x_pek_driver);
+--
+2.13.0
+