Skip to content

Commit 3fdfa1e

Browse files
EvenxfJiri Kosina
authored andcommitted
HID: Intel-thc-hid: Intel-quicki2c: 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 60c9fca commit 3fdfa1e

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,11 @@
1111
#include <linux/sizes.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 "quicki2c-dev.h"
1821
#include "quicki2c-hid.h"
@@ -31,6 +34,14 @@ static guid_t i2c_hid_guid =
3134
static guid_t thc_platform_guid =
3235
GUID_INIT(0x84005682, 0x5b71, 0x41a4, 0x8d, 0x66, 0x81, 0x30, 0xf7, 0x87, 0xa1, 0x38);
3336

37+
/* QuickI2C Wake-on-Touch GPIO resource */
38+
static const struct acpi_gpio_params wake_gpio = { 0, 0, true };
39+
40+
static const struct acpi_gpio_mapping quicki2c_gpios[] = {
41+
{ "wake-on-touch", &wake_gpio, 1 },
42+
{ }
43+
};
44+
3445
/**
3546
* quicki2c_acpi_get_dsm_property - Query device ACPI DSM parameter
3647
* @adev: Point to ACPI device
@@ -393,6 +404,8 @@ static struct quicki2c_device *quicki2c_dev_init(struct pci_dev *pdev, void __io
393404

394405
thc_interrupt_enable(qcdev->thc_hw, true);
395406

407+
thc_wot_config(qcdev->thc_hw, &quicki2c_gpios[0]);
408+
396409
qcdev->state = QUICKI2C_INITED;
397410

398411
return qcdev;
@@ -408,6 +421,7 @@ static void quicki2c_dev_deinit(struct quicki2c_device *qcdev)
408421
{
409422
thc_interrupt_enable(qcdev->thc_hw, false);
410423
thc_ltr_unconfig(qcdev->thc_hw);
424+
thc_wot_unconfig(qcdev->thc_hw);
411425

412426
qcdev->state = QUICKI2C_DISABLED;
413427
}

0 commit comments

Comments
 (0)