blob: 3f2e43c8f24970cf52f85a1de3229b6b2fb09262 [file] [log] [blame]
Angel Pons96d93d12020-04-05 13:22:23 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Stefan Reinauera7198b32012-12-11 16:00:47 -08002
Kyösti Mälkkib9cd5ec2015-04-24 16:05:58 +03003#include <mainboard/google/parrot/onboard.h>
4
Stefan Reinauera7198b32012-12-11 16:00:47 -08005Scope (\_GPE) {
6 Method(_L1F, 0x0, NotSerialized)
7 {
Andrew Litt955ca5d2014-09-09 10:49:19 -05008 /*
9 * Invert the interrupt level bit for the lid GPIO
10 * so we don't get another _SB.LID0 until the state
11 * changes again. GIV1 is the interrupt level control
12 * register for GPIO bits 15:8
13 */
Felix Singerf3649f02022-12-16 04:07:23 +010014 GIV1 ^= 0x80
Stefan Reinauera7198b32012-12-11 16:00:47 -080015 Notify(\_SB.LID0,0x80)
16 }
17}
18
19Scope (\_SB) {
20 Device (LID0)
21 {
22 Name(_HID, EisaId("PNP0C0D"))
23 Method(_LID, 0)
24 {
Elyes HAOUAS316466b2020-10-08 09:33:36 +020025 \LIDS = GP15
Stefan Reinauera7198b32012-12-11 16:00:47 -080026 Return (\LIDS)
27 }
28 }
29
Stefan Reinauera7198b32012-12-11 16:00:47 -080030 Device (TPAD)
31 {
Stefan Reinauera7198b32012-12-11 16:00:47 -080032
ReddestDream525154d2017-04-13 14:25:34 -040033 Name(_HID, "CYSM0000")
34 Name(_UID, 1)
35 Name(_HRV, 2)
Stefan Reinauera7198b32012-12-11 16:00:47 -080036
37 // Trackpad Wake is GPIO12, wake from S3
Kyösti Mälkkib9cd5ec2015-04-24 16:05:58 +030038 Name(_PRW, Package() { BOARD_TRACKPAD_WAKE_GPIO, 0x03 })
Stefan Reinauera7198b32012-12-11 16:00:47 -080039
Matt DeVillierd3b15c72017-06-07 13:06:23 -050040 Name (DCRS, ResourceTemplate ()
Stefan Reinauera7198b32012-12-11 16:00:47 -080041 {
Stefan Reinauera7198b32012-12-11 16:00:47 -080042 // PIRQA -> GSI16
Matt DeVillierd3b15c72017-06-07 13:06:23 -050043 Interrupt (ResourceConsumer, Level, ActiveLow, Exclusive, ,, )
Kyösti Mälkkib9cd5ec2015-04-24 16:05:58 +030044 {
Matt DeVillierd3b15c72017-06-07 13:06:23 -050045 BOARD_TRACKPAD_IRQ_DVT,
Kyösti Mälkkib9cd5ec2015-04-24 16:05:58 +030046 }
Stefan Reinauera7198b32012-12-11 16:00:47 -080047 // SMBUS Address 0x67
Kyösti Mälkkib9cd5ec2015-04-24 16:05:58 +030048 VendorShort (ADDR) { BOARD_TRACKPAD_I2C_ADDR }
Stefan Reinauera7198b32012-12-11 16:00:47 -080049 })
Matt DeVillierd3b15c72017-06-07 13:06:23 -050050
51 Name (PCRS, ResourceTemplate ()
52 {
53 // PIRQE -> GSI20
54 Interrupt (ResourceConsumer, Level, ActiveLow, Exclusive, ,, )
55 {
56 BOARD_TRACKPAD_IRQ_PVT,
57 }
58 // SMBUS Address 0x67
59 VendorShort (ADDR) { BOARD_TRACKPAD_I2C_ADDR }
60 })
61
62 Method (_CRS, 0, NotSerialized)
63 {
64 If (\TPIQ == BOARD_TRACKPAD_IRQ_DVT){
65 Return (DCRS)
66 } Else {
67 Return (PCRS)
68 }
69 }
Stefan Reinauera7198b32012-12-11 16:00:47 -080070 }
71
Alexandru Gagniucfa840672014-04-09 21:07:43 -050072 Device (MB) {
Martin Roth9a4cbc92015-06-25 20:13:12 -060073 Name(_HID, EisaId("PNP0C01")) // System Board
74
Alexandru Gagniucfa840672014-04-09 21:07:43 -050075 /* Lid open */
76 Method (LIDO) { /* Not needed on this board */ }
77 /* Lid closed */
78 Method (LIDC) { /* Not needed on this board */ }
79 /* Increase brightness */
80 Method (BRTU) { /* Not needed on this board */ }
81 /* Decrease brightness */
82 Method (BRTD) { /* Not needed on this board */ }
83 /* Switch display */
84 Method (DSPS) { /* Not needed on this board */ }
85 /* Toggle wireless */
86 Method (WLTG) { /* Not needed on this board */ }
87 /* Return lid state */
88 Method (LIDS)
89 {
90 Return (GP15)
91 }
92 }
93
Stefan Reinauera7198b32012-12-11 16:00:47 -080094}
Matt DeVillierc5bd8b32017-04-17 18:11:08 -050095
96/* USB port entries */
97#include "acpi/usb.asl"