Angel Pons | 58c0d32 | 2020-04-05 13:20:46 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Matt DeVillier | 45e11aa | 2016-12-18 11:59:58 -0600 | [diff] [blame] | 2 | |
| 3 | Scope (\_SB.PCI0.I2C0) |
| 4 | { |
| 5 | Device (ETPA) |
| 6 | { |
| 7 | Name (_HID, "ELAN0000") |
| 8 | Name (_DDN, "Elan Touchpad") |
| 9 | Name (_UID, 1) |
| 10 | Name (ISTP, 1) /* Touchpad */ |
| 11 | |
| 12 | Name (_CRS, ResourceTemplate() |
| 13 | { |
| 14 | I2cSerialBus ( |
| 15 | BOARD_TRACKPAD_I2C_ADDR, // SlaveAddress |
| 16 | ControllerInitiated, // SlaveMode |
| 17 | 400000, // ConnectionSpeed |
| 18 | AddressingMode7Bit, // AddressingMode |
| 19 | "\\_SB.PCI0.I2C0", // ResourceSource |
| 20 | ) |
| 21 | Interrupt (ResourceConsumer, Level, ActiveLow) |
| 22 | { |
| 23 | BOARD_TRACKPAD_IRQ |
| 24 | } |
| 25 | }) |
| 26 | |
| 27 | Method (_STA) |
| 28 | { |
Elyes HAOUAS | 9c19a4f | 2020-10-08 09:30:03 +0200 | [diff] [blame^] | 29 | If (\S1EN == 1) { |
Matt DeVillier | 45e11aa | 2016-12-18 11:59:58 -0600 | [diff] [blame] | 30 | Return (0xF) |
| 31 | } Else { |
| 32 | Return (0x0) |
| 33 | } |
| 34 | } |
| 35 | |
| 36 | Name (_PRW, Package() { BOARD_TRACKPAD_WAKE_GPIO, 0x3 }) |
| 37 | |
| 38 | Method (_DSW, 3, NotSerialized) |
| 39 | { |
Elyes HAOUAS | 9c19a4f | 2020-10-08 09:30:03 +0200 | [diff] [blame^] | 40 | Local0 = BOARD_TRACKPAD_WAKE_GPIO |
| 41 | If (Arg0 == 1) { |
Matt DeVillier | 45e11aa | 2016-12-18 11:59:58 -0600 | [diff] [blame] | 42 | // Enable GPIO as wake source |
| 43 | \_SB.PCI0.LPCB.GPIO.GWAK (Local0) |
| 44 | } |
| 45 | } |
| 46 | |
| 47 | /* Allow device to power off in S0 */ |
| 48 | Name (_S0W, 4) |
| 49 | } |
| 50 | } |