Angel Pons | 58c0d32 | 2020-04-05 13:20:46 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Matt DeVillier | 1b25f1b | 2018-09-14 21:39:00 -0500 | [diff] [blame] | 2 | |
| 3 | Scope (\_SB.PCI0.I2C0) |
| 4 | { |
| 5 | Device (RTEK) |
| 6 | { |
| 7 | Name (_HID, "10EC5650") |
Matt DeVillier | ea58add | 2018-12-30 20:23:43 -0600 | [diff] [blame] | 8 | Name (_CID, "INTCCFFD") |
Matt DeVillier | 1b25f1b | 2018-09-14 21:39:00 -0500 | [diff] [blame] | 9 | Name (_DDN, "RTEK Codec Controller ") |
| 10 | Name (_UID, 1) |
| 11 | |
| 12 | Name (_CRS, ResourceTemplate() |
| 13 | { |
| 14 | I2cSerialBus ( |
| 15 | 0x1A, // SlaveAddress |
| 16 | ControllerInitiated, // SlaveMode |
| 17 | 400000, // ConnectionSpeed |
| 18 | AddressingMode7Bit, // AddressingMode |
| 19 | "\\_SB.PCI0.I2C0", // ResourceSource |
| 20 | ) |
| 21 | |
| 22 | Interrupt (ResourceConsumer, Edge, ActiveLow){ 37 } |
| 23 | }) |
| 24 | |
| 25 | Method (_STA) |
| 26 | { |
Elyes HAOUAS | 9c19a4f | 2020-10-08 09:30:03 +0200 | [diff] [blame^] | 27 | If (\S1EN == 1) { |
Matt DeVillier | 1b25f1b | 2018-09-14 21:39:00 -0500 | [diff] [blame] | 28 | Return (0xF) |
| 29 | } Else { |
| 30 | Return (0x0) |
| 31 | } |
| 32 | } |
| 33 | } |
| 34 | } |
| 35 | |
| 36 | Scope (\_SB.PCI0.I2C1) |
| 37 | { |
| 38 | Device (ETSA) |
| 39 | { |
| 40 | Name (_HID, "ELAN0001") |
| 41 | Name (_DDN, "Elan Touchscreen") |
| 42 | Name (_UID, 6) |
| 43 | Name (ISTP, 0) /* Touchscreen */ |
| 44 | |
| 45 | Name (_CRS, ResourceTemplate() |
| 46 | { |
| 47 | I2cSerialBus ( |
| 48 | 0x10, // SlaveAddress |
| 49 | ControllerInitiated, // SlaveMode |
| 50 | 400000, // ConnectionSpeed |
| 51 | AddressingMode7Bit, // AddressingMode |
| 52 | "\\_SB.PCI0.I2C1", // ResourceSource |
| 53 | ) |
| 54 | Interrupt (ResourceConsumer, Level, ActiveLow) |
| 55 | { |
| 56 | BOARD_TOUCHSCREEN_IRQ |
| 57 | } |
| 58 | }) |
| 59 | |
| 60 | Method (_STA) |
| 61 | { |
Elyes HAOUAS | 9c19a4f | 2020-10-08 09:30:03 +0200 | [diff] [blame^] | 62 | If (\S2EN == 1) { |
Matt DeVillier | 1b25f1b | 2018-09-14 21:39:00 -0500 | [diff] [blame] | 63 | Return (0xF) |
| 64 | } Else { |
| 65 | Return (0x0) |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | Name (_PRW, Package() { BOARD_TOUCHSCREEN_WAKE_GPIO, 0x3 }) |
| 70 | |
| 71 | Method (_DSW, 3, NotSerialized) |
| 72 | { |
Elyes HAOUAS | 9c19a4f | 2020-10-08 09:30:03 +0200 | [diff] [blame^] | 73 | Local0 = BOARD_TOUCHSCREEN_WAKE_GPIO |
| 74 | If (Arg0 == 1) { |
Matt DeVillier | 1b25f1b | 2018-09-14 21:39:00 -0500 | [diff] [blame] | 75 | // Enable GPIO as wake source |
| 76 | \_SB.PCI0.LPCB.GPIO.GWAK (Local0) |
| 77 | } |
| 78 | } |
| 79 | |
| 80 | /* Allow device to power off in S0 */ |
| 81 | Name (_S0W, 4) |
| 82 | } |
| 83 | } |
| 84 | |
| 85 | /* |
| 86 | * LAN connected to Root Port 3, becomes Root Port 1 after coalesce |
| 87 | */ |
| 88 | Scope (\_SB.PCI0.RP01) |
| 89 | { |
| 90 | Device (ETH0) |
| 91 | { |
| 92 | Name (_ADR, 0x00000000) |
| 93 | Name (_PRW, Package() { BUDDY_NIC_WAKE_GPIO, 3 }) |
| 94 | |
| 95 | Method (_DSW, 3, NotSerialized) |
| 96 | { |
| 97 | Store (BUDDY_NIC_WAKE_GPIO, Local0) |
| 98 | |
Elyes HAOUAS | 9c19a4f | 2020-10-08 09:30:03 +0200 | [diff] [blame^] | 99 | If (Arg0 == 1) { |
Matt DeVillier | 1b25f1b | 2018-09-14 21:39:00 -0500 | [diff] [blame] | 100 | // Enable GPIO as wake source |
| 101 | \_SB.PCI0.LPCB.GPIO.GWAK (Local0) |
| 102 | } |
| 103 | } |
| 104 | } |
| 105 | } |