Lines Matching refs:thc_dev
22 void thc_wot_config(struct thc_device *thc_dev, const struct acpi_gpio_mapping *gpio_map) in thc_wot_config() argument
28 if (!thc_dev) in thc_wot_config()
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()
46 dev_warn(thc_dev->dev, "Can't find wake GPIO resource\n"); 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()
75 void thc_wot_unconfig(struct thc_device *thc_dev) in thc_wot_unconfig() argument
79 if (!thc_dev) in thc_wot_unconfig()
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()