summaryrefslogtreecommitdiff
path: root/src/mainboard/google/link/acpi/mainboard.asl
blob: 28d6d34c76ae7c375dd47743f77acd8ef1bba65c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
/* SPDX-License-Identifier: GPL-2.0-only */

#include <mainboard/google/link/onboard.h>

Scope (\_SB) {
	Device (TPAD)
	{
		Name (_UID, 1)

		// Report as a Sleep Button device so Linux will
		// automatically enable it as a wake source
		Name(_HID, EisaId("PNP0C0E"))

		Name(_CRS, ResourceTemplate()
		{
			// PIRQE -> GSI20
			Interrupt (ResourceConsumer, Edge, ActiveLow)
			{
				BOARD_TRACKPAD_IRQ
			}

			// SMBUS Address 0x4b
			VendorShort (ADDR) { BOARD_TRACKPAD_I2C_ADDR }
		})
	}

	Device (TSCR)
	{
		Name (_UID, 2)

		// Report as a Sleep Button device so Linux will
		// automatically enable it as a wake source
		Name(_HID, EisaId("PNP0C0E"))

		Name(_CRS, ResourceTemplate()
		{
			// PIRQG -> GSI22
			Interrupt (ResourceConsumer, Edge, ActiveLow) {22}

			// SMBUS Address 0x4a
			VendorShort (ADDR) {0x4a}
		})
	}
}


Scope (\_SB.PCI0.GFX0)
{
	Device (GMBS){
		Name (_HID, "BOOT0001")
		Method (_STA, 0, NotSerialized)  // _STA: Status
		{
			Return (0x0F)
		}

		Method (MMIO, 0, Serialized)
		{
			Local0 = BAR0 & 0xFFFFFFFFFFFFFFF0
			Return (Local0)
		}

		Device (LVGA) {
			Name (_HID, "BOOT0002")
			Name (_UID, 0)
			Name (_DSD, Package () {
				ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
				Package () {
					Package (2) {"coolstar,bus-number", GMBUS_PIN_VGADDC}
				}
			})

			Method (_STA)
			{
				Return (0xF)
			}

			Device (ATPD)
			{
				Name (_HID, "ATML0000")
				Name (_DDN, "Atmel Touchpad")
				Name (_UID, 0)

				Name (_CRS, ResourceTemplate()
				{
					I2cSerialBus (
						BOARD_TRACKPAD_I2C_ADDR,        // SlaveAddress
						ControllerInitiated,            // SlaveMode
						100000,                         // ConnectionSpeed
						AddressingMode7Bit,             // AddressingMode
						"\\_SB.PCI0.GFX0.GMBS.LVGA",    // ResourceSource
					)

					Interrupt (ResourceConsumer, Level, ActiveLow) { BOARD_TRACKPAD_IRQ }
				})

				// Trackpad Wake is GPIO12
				Name(_PRW, Package() { BOARD_TRACKPAD_WAKE_GPIO, 0x03 } )

				Method (_STA)
				{
					Return (0xF)
				}
			}
		}

		Device (LPNL) {
			Name (_HID, "BOOT0002")
			Name (_UID, 1)
			Name (_DSD, Package () {
				ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
				Package () {
					Package (2) {"coolstar,bus-number", GMBUS_PIN_PANEL}
				}
			})

			Method (_STA)
			{
				Return (0xF)
			}

			Device (ATSA)
			{
				Name (_HID, "ATML0001")
				Name (_DDN, "Atmel TouchScreen")
				Name (_UID, 0)

				Name (_CRS, ResourceTemplate()
				{
					I2cSerialBus (
						BOARD_TOUCHSCREEN_I2C_ADDR,     // SlaveAddress
						ControllerInitiated,            // SlaveMode
						100000,                         // ConnectionSpeed
						AddressingMode7Bit,             // AddressingMode
						"\\_SB.PCI0.GFX0.GMBS.LPNL",    // ResourceSource
					)

					Interrupt (ResourceConsumer, Level, ActiveLow) { BOARD_TOUCHSCREEN_IRQ }
				})

				// Touchscreen Wake is GPIO14
				Name(_PRW, Package() { BOARD_TOUCHSCREEN_WAKE_GPIO, 0x03 } )

				Method (_STA)
				{
					Return (0xF)
				}
			}
		}
	}
}