Lines Matching +full:wake +full:- +full:up

1 // SPDX-License-Identifier: GPL-2.0
7 #include "intel-thc-dev.h"
8 #include "intel-thc-wot.h"
11 * thc_wot_config - Query and configure wake-on-touch feature
16 * _DSD to map this GPIO resource, so this function first registers wake GPIO
17 * mapping manually, then queries wake-on-touch GPIO resource from ACPI,
18 * if it exists and is wake-able, configure driver to enable it, otherwise,
31 adev = ACPI_COMPANION(thc_dev->dev); in thc_wot_config()
35 wot = &thc_dev->wot; in thc_wot_config()
39 dev_warn(thc_dev->dev, "Can't add wake GPIO resource, ret = %d\n", ret); in thc_wot_config()
43 wot->gpio_irq = acpi_dev_gpio_irq_wake_get_by(adev, "wake-on-touch", 0, in thc_wot_config()
44 &wot->gpio_irq_wakeable); in thc_wot_config()
45 if (wot->gpio_irq <= 0) { in thc_wot_config()
46 dev_warn(thc_dev->dev, "Can't find wake GPIO resource\n"); in thc_wot_config()
50 if (!wot->gpio_irq_wakeable) { in thc_wot_config()
51 dev_warn(thc_dev->dev, "GPIO resource isn't wakeable\n"); in thc_wot_config()
55 ret = device_init_wakeup(thc_dev->dev, true); in thc_wot_config()
57 dev_warn(thc_dev->dev, "Failed to init wake up.\n"); in thc_wot_config()
61 ret = dev_pm_set_dedicated_wake_irq(thc_dev->dev, wot->gpio_irq); in thc_wot_config()
63 dev_warn(thc_dev->dev, "Failed to set wake up IRQ.\n"); in thc_wot_config()
64 device_init_wakeup(thc_dev->dev, false); in thc_wot_config()
70 * thc_wot_unconfig - Unconfig wake-on-touch feature
73 * Configure driver to disable wake-on-touch and release ACPI resource.
82 adev = ACPI_COMPANION(thc_dev->dev); in thc_wot_unconfig()
86 if (thc_dev->wot.gpio_irq_wakeable) in thc_wot_unconfig()
87 device_init_wakeup(thc_dev->dev, false); in thc_wot_unconfig()
89 if (thc_dev->wot.gpio_irq > 0) { in thc_wot_unconfig()
90 dev_pm_clear_wake_irq(thc_dev->dev); in thc_wot_unconfig()