Angel Pons | 96d93d1 | 2020-04-05 13:22:23 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Stefan Reinauer | a7198b3 | 2012-12-11 16:00:47 -0800 | [diff] [blame] | 2 | |
Kyösti Mälkki | b9cd5ec | 2015-04-24 16:05:58 +0300 | [diff] [blame] | 3 | #include <mainboard/google/parrot/onboard.h> |
| 4 | |
Stefan Reinauer | a7198b3 | 2012-12-11 16:00:47 -0800 | [diff] [blame] | 5 | Scope (\_GPE) { |
| 6 | Method(_L1F, 0x0, NotSerialized) |
| 7 | { |
Andrew Litt | 955ca5d | 2014-09-09 10:49:19 -0500 | [diff] [blame] | 8 | /* |
| 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 Singer | f3649f0 | 2022-12-16 04:07:23 +0100 | [diff] [blame] | 14 | GIV1 ^= 0x80 |
Stefan Reinauer | a7198b3 | 2012-12-11 16:00:47 -0800 | [diff] [blame] | 15 | Notify(\_SB.LID0,0x80) |
| 16 | } |
| 17 | } |
| 18 | |
| 19 | Scope (\_SB) { |
| 20 | Device (LID0) |
| 21 | { |
| 22 | Name(_HID, EisaId("PNP0C0D")) |
| 23 | Method(_LID, 0) |
| 24 | { |
Elyes HAOUAS | 316466b | 2020-10-08 09:33:36 +0200 | [diff] [blame] | 25 | \LIDS = GP15 |
Stefan Reinauer | a7198b3 | 2012-12-11 16:00:47 -0800 | [diff] [blame] | 26 | Return (\LIDS) |
| 27 | } |
| 28 | } |
| 29 | |
Stefan Reinauer | a7198b3 | 2012-12-11 16:00:47 -0800 | [diff] [blame] | 30 | Device (TPAD) |
| 31 | { |
Stefan Reinauer | a7198b3 | 2012-12-11 16:00:47 -0800 | [diff] [blame] | 32 | |
ReddestDream | 525154d | 2017-04-13 14:25:34 -0400 | [diff] [blame^] | 33 | Name(_HID, "CYSM0000") |
| 34 | Name(_UID, 1) |
| 35 | Name(_HRV, 2) |
Stefan Reinauer | a7198b3 | 2012-12-11 16:00:47 -0800 | [diff] [blame] | 36 | |
| 37 | // Trackpad Wake is GPIO12, wake from S3 |
Kyösti Mälkki | b9cd5ec | 2015-04-24 16:05:58 +0300 | [diff] [blame] | 38 | Name(_PRW, Package() { BOARD_TRACKPAD_WAKE_GPIO, 0x03 }) |
Stefan Reinauer | a7198b3 | 2012-12-11 16:00:47 -0800 | [diff] [blame] | 39 | |
Matt DeVillier | d3b15c7 | 2017-06-07 13:06:23 -0500 | [diff] [blame] | 40 | Name (DCRS, ResourceTemplate () |
Stefan Reinauer | a7198b3 | 2012-12-11 16:00:47 -0800 | [diff] [blame] | 41 | { |
Stefan Reinauer | a7198b3 | 2012-12-11 16:00:47 -0800 | [diff] [blame] | 42 | // PIRQA -> GSI16 |
Matt DeVillier | d3b15c7 | 2017-06-07 13:06:23 -0500 | [diff] [blame] | 43 | Interrupt (ResourceConsumer, Level, ActiveLow, Exclusive, ,, ) |
Kyösti Mälkki | b9cd5ec | 2015-04-24 16:05:58 +0300 | [diff] [blame] | 44 | { |
Matt DeVillier | d3b15c7 | 2017-06-07 13:06:23 -0500 | [diff] [blame] | 45 | BOARD_TRACKPAD_IRQ_DVT, |
Kyösti Mälkki | b9cd5ec | 2015-04-24 16:05:58 +0300 | [diff] [blame] | 46 | } |
Stefan Reinauer | a7198b3 | 2012-12-11 16:00:47 -0800 | [diff] [blame] | 47 | // SMBUS Address 0x67 |
Kyösti Mälkki | b9cd5ec | 2015-04-24 16:05:58 +0300 | [diff] [blame] | 48 | VendorShort (ADDR) { BOARD_TRACKPAD_I2C_ADDR } |
Stefan Reinauer | a7198b3 | 2012-12-11 16:00:47 -0800 | [diff] [blame] | 49 | }) |
Matt DeVillier | d3b15c7 | 2017-06-07 13:06:23 -0500 | [diff] [blame] | 50 | |
| 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 Reinauer | a7198b3 | 2012-12-11 16:00:47 -0800 | [diff] [blame] | 70 | } |
| 71 | |
Alexandru Gagniuc | fa84067 | 2014-04-09 21:07:43 -0500 | [diff] [blame] | 72 | Device (MB) { |
Martin Roth | 9a4cbc9 | 2015-06-25 20:13:12 -0600 | [diff] [blame] | 73 | Name(_HID, EisaId("PNP0C01")) // System Board |
| 74 | |
Alexandru Gagniuc | fa84067 | 2014-04-09 21:07:43 -0500 | [diff] [blame] | 75 | /* 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 Reinauer | a7198b3 | 2012-12-11 16:00:47 -0800 | [diff] [blame] | 94 | } |
Matt DeVillier | c5bd8b3 | 2017-04-17 18:11:08 -0500 | [diff] [blame] | 95 | |
| 96 | /* USB port entries */ |
| 97 | #include "acpi/usb.asl" |