Skip to content

Commit 60c9fca

Browse files
EvenxfJiri Kosina
authored andcommitted
HID: Intel-thc-hid: Intel-quickspi: Enable Wake-on-Touch feature
This patch call THC helper functions to enable Wake-on-Touch (WoT) during driver initialization and disable it when driver is removed. Signed-off-by: Even Xu <[email protected]> Tested-by: Chong Han <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent dcb2ccb commit 60c9fca

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

drivers/hid/intel-thc-hid/intel-quickspi/pci-quickspi.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,11 @@
1111
#include <linux/pci.h>
1212
#include <linux/pm_runtime.h>
1313

14+
#include <linux/gpio/consumer.h>
15+
1416
#include "intel-thc-dev.h"
1517
#include "intel-thc-hw.h"
18+
#include "intel-thc-wot.h"
1619

1720
#include "quickspi-dev.h"
1821
#include "quickspi-hid.h"
@@ -46,6 +49,15 @@ static guid_t thc_platform_guid =
4649
GUID_INIT(0x84005682, 0x5b71, 0x41a4, 0x8d, 0x66, 0x81, 0x30,
4750
0xf7, 0x87, 0xa1, 0x38);
4851

52+
53+
/* QuickSPI Wake-on-Touch GPIO resource */
54+
static const struct acpi_gpio_params wake_gpio = { 0, 0, true };
55+
56+
static const struct acpi_gpio_mapping quickspi_gpios[] = {
57+
{ "wake-on-touch", &wake_gpio, 1 },
58+
{ }
59+
};
60+
4961
/**
5062
* thc_acpi_get_property - Query device ACPI parameter
5163
*
@@ -426,6 +438,8 @@ static struct quickspi_device *quickspi_dev_init(struct pci_dev *pdev, void __io
426438

427439
thc_interrupt_enable(qsdev->thc_hw, true);
428440

441+
thc_wot_config(qsdev->thc_hw, &quickspi_gpios[0]);
442+
429443
qsdev->state = QUICKSPI_INITIATED;
430444

431445
return qsdev;
@@ -442,6 +456,7 @@ static void quickspi_dev_deinit(struct quickspi_device *qsdev)
442456
{
443457
thc_interrupt_enable(qsdev->thc_hw, false);
444458
thc_ltr_unconfig(qsdev->thc_hw);
459+
thc_wot_unconfig(qsdev->thc_hw);
445460

446461
qsdev->state = QUICKSPI_DISABLED;
447462
}

0 commit comments

Comments
 (0)