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 (STPA) |
| 6 | { |
| 7 | Name (_HID, "SYNA0000") |
| 8 | Name (_CID, "ACPI0C50") |
| 9 | Name (_DDN, "Synaptics Touchpad") |
| 10 | Name (_UID, 1) |
| 11 | Name (ISTP, 1) /* Touchpad */ |
| 12 | |
| 13 | Method(_CRS, 0x0, Serialized) |
| 14 | { |
| 15 | Name (RBUF, ResourceTemplate() |
| 16 | { |
| 17 | I2cSerialBus ( |
| 18 | BOARD_TRACKPAD_I2C_ADDR, // SlaveAddress |
| 19 | ControllerInitiated, // SlaveMode |
| 20 | 400000, // ConnectionSpeed |
| 21 | AddressingMode7Bit, // AddressingMode |
| 22 | "\\_SB.PCI0.I2C0", // ResourceSource |
| 23 | ) |
| 24 | Interrupt (ResourceConsumer, Level, ActiveLow) |
| 25 | { |
| 26 | BOARD_TRACKPAD_IRQ |
| 27 | } |
| 28 | }) |
| 29 | Return(RBUF) |
| 30 | } |
| 31 | |
| 32 | Method(_DSM, 0x4, NotSerialized) |
| 33 | { |
Elyes HAOUAS | 9c19a4f | 2020-10-08 09:30:03 +0200 | [diff] [blame^] | 34 | If (Arg0 == ToUUID("3CDFF6F7-4267-4555-AD05-B30A3D8938DE")) /* I2C-HID UUID */ |
Matt DeVillier | 45e11aa | 2016-12-18 11:59:58 -0600 | [diff] [blame] | 35 | { |
Elyes HAOUAS | 9c19a4f | 2020-10-08 09:30:03 +0200 | [diff] [blame^] | 36 | If (Arg2 == 0) /* DSM Function */ |
Matt DeVillier | 45e11aa | 2016-12-18 11:59:58 -0600 | [diff] [blame] | 37 | { |
| 38 | /* Function 0: Query function, return based on revision */ |
Elyes HAOUAS | 9c19a4f | 2020-10-08 09:30:03 +0200 | [diff] [blame^] | 39 | If (Arg1 == 1) /* Arg1 DSM Revision */ |
Matt DeVillier | 45e11aa | 2016-12-18 11:59:58 -0600 | [diff] [blame] | 40 | { |
| 41 | /* Revision 1: Function 0 supported */ |
| 42 | Return(Buffer(One) { 0x03 }) |
| 43 | } |
Elyes HAOUAS | 9c19a4f | 2020-10-08 09:30:03 +0200 | [diff] [blame^] | 44 | } ElseIf (Arg2 == 1) /* Function 1 : HID Function */ |
Matt DeVillier | 45e11aa | 2016-12-18 11:59:58 -0600 | [diff] [blame] | 45 | { |
| 46 | Return(0x0020) /* HID Descriptor Address */ |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | Return(Buffer(One) { 0x00 }) /* Not supported */ |
| 51 | } |
| 52 | |
| 53 | Method (_STA) |
| 54 | { |
Elyes HAOUAS | 9c19a4f | 2020-10-08 09:30:03 +0200 | [diff] [blame^] | 55 | If (\S1EN == 1) { |
Matt DeVillier | 45e11aa | 2016-12-18 11:59:58 -0600 | [diff] [blame] | 56 | Return (0xF) |
| 57 | } Else { |
| 58 | Return (0x0) |
| 59 | } |
| 60 | } |
| 61 | |
| 62 | Name (_PRW, Package() { BOARD_TRACKPAD_WAKE_GPIO, 0x3 }) |
| 63 | |
| 64 | Method (_DSW, 3, NotSerialized) |
| 65 | { |
Elyes HAOUAS | 9c19a4f | 2020-10-08 09:30:03 +0200 | [diff] [blame^] | 66 | Local0 = BOARD_TRACKPAD_WAKE_GPIO |
| 67 | If (Arg0 == 1) { |
Matt DeVillier | 45e11aa | 2016-12-18 11:59:58 -0600 | [diff] [blame] | 68 | // Enable GPIO as wake source |
| 69 | \_SB.PCI0.LPCB.GPIO.GWAK (Local0) |
| 70 | } |
| 71 | } |
| 72 | |
| 73 | /* Allow device to power off in S0 */ |
| 74 | Name (_S0W, 4) |
| 75 | } |
| 76 | } |
| 77 | Scope (\_SB.PCI0.I2C1) |
| 78 | { |
| 79 | Device (ETSA) |
| 80 | { |
| 81 | Name (_HID, "ELAN0001") |
| 82 | Name (_DDN, "Elan Touchscreen") |
| 83 | Name (_UID, 6) |
| 84 | Name (ISTP, 0) /* Touchscreen */ |
| 85 | |
| 86 | Name (_CRS, ResourceTemplate() |
| 87 | { |
| 88 | I2cSerialBus ( |
| 89 | BOARD_TOUCHSCREEN_I2C_ADDR, // SlaveAddress |
| 90 | ControllerInitiated, // SlaveMode |
| 91 | 400000, // ConnectionSpeed |
| 92 | AddressingMode7Bit, // AddressingMode |
| 93 | "\\_SB.PCI0.I2C1", // ResourceSource |
| 94 | ) |
| 95 | Interrupt (ResourceConsumer, Level, ActiveLow) |
| 96 | { |
| 97 | BOARD_TOUCHSCREEN_IRQ |
| 98 | } |
| 99 | }) |
| 100 | |
| 101 | Method (_STA) |
| 102 | { |
Elyes HAOUAS | 9c19a4f | 2020-10-08 09:30:03 +0200 | [diff] [blame^] | 103 | If (\S2EN == 1) { |
Matt DeVillier | 45e11aa | 2016-12-18 11:59:58 -0600 | [diff] [blame] | 104 | Return (0xF) |
| 105 | } Else { |
| 106 | Return (0x0) |
| 107 | } |
| 108 | } |
| 109 | |
| 110 | Name (_PRW, Package() { BOARD_TOUCHSCREEN_WAKE_GPIO, 0x3 }) |
| 111 | |
| 112 | Method (_DSW, 3, NotSerialized) |
| 113 | { |
Elyes HAOUAS | 9c19a4f | 2020-10-08 09:30:03 +0200 | [diff] [blame^] | 114 | Local0 = BOARD_TOUCHSCREEN_WAKE_GPIO |
| 115 | If (Arg0 == 1) { |
Matt DeVillier | 45e11aa | 2016-12-18 11:59:58 -0600 | [diff] [blame] | 116 | // Enable GPIO as wake source |
| 117 | \_SB.PCI0.LPCB.GPIO.GWAK (Local0) |
| 118 | } |
| 119 | } |
| 120 | |
| 121 | /* Allow device to power off in S0 */ |
| 122 | Name (_S0W, 4) |
| 123 | } |
| 124 | } |