david | ad038c1 | 2015-10-23 20:22:22 +0800 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2014 Google Inc. |
| 5 | * Copyright (C) 2015 Intel Corporation. |
| 6 | * |
| 7 | * This program is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License as published by |
| 9 | * the Free Software Foundation; version 2 of the License. |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU General Public License for more details. |
david | ad038c1 | 2015-10-23 20:22:22 +0800 | [diff] [blame] | 15 | */ |
| 16 | |
| 17 | #include "../gpio.h" |
| 18 | |
| 19 | #define BOARD_TOUCHPAD_I2C_ADDR 0x15 |
| 20 | #define BOARD_TOUCHPAD_IRQ TOUCHPAD_INT_L |
| 21 | |
| 22 | #define BOARD_TOUCHSCREEN_I2C_ADDR 0x10 |
| 23 | #define BOARD_TOUCHSCREEN_IRQ TOUCHSCREEN_INT_L |
| 24 | |
| 25 | #define BOARD_HP_MIC_CODEC_I2C_ADDR 0x1a |
| 26 | #define BOARD_HP_MIC_CODEC_IRQ MIC_INT_L |
| 27 | #define BOARD_LEFT_SPEAKER_AMP_I2C_ADDR 0x34 |
| 28 | #define BOARD_RIGHT_SPEAKER_AMP_I2C_ADDR 0x35 |
| 29 | |
| 30 | Scope (\_SB) |
| 31 | { |
| 32 | Device (LID0) |
| 33 | { |
| 34 | Name (_HID, EisaId ("PNP0C0D")) |
| 35 | Method (_LID, 0) |
| 36 | { |
| 37 | Return (\_SB.PCI0.LPCB.EC0.LIDS) |
| 38 | } |
| 39 | |
| 40 | Name (_PRW, Package () { GPE_EC_WAKE, 5 }) |
| 41 | } |
| 42 | |
| 43 | Device (PWRB) |
| 44 | { |
| 45 | Name (_HID, EisaId ("PNP0C0C")) |
| 46 | } |
| 47 | } |
| 48 | |
| 49 | /* |
| 50 | * LPC Trusted Platform Module |
| 51 | */ |
| 52 | Scope (\_SB.PCI0.LPCB) |
| 53 | { |
| 54 | #include <drivers/pc80/tpm/acpi/tpm.asl> |
| 55 | } |
| 56 | |
| 57 | /* |
| 58 | * WLAN connected to Root Port 1 |
| 59 | */ |
| 60 | Scope (\_SB.PCI0.RP01) |
| 61 | { |
| 62 | Device (WLAN) |
| 63 | { |
| 64 | Name (_ADR, 0x00000000) |
| 65 | Name (_DDN, "Wireless LAN") |
| 66 | Name (_PRW, Package () { GPE_WLAN_WAKE, 3 }) |
| 67 | } |
| 68 | } |
| 69 | |
| 70 | Scope (\_SB.PCI0.I2C0) |
| 71 | { |
| 72 | /* Touchscreen */ |
| 73 | Device (ELTS) |
| 74 | { |
| 75 | Name (_HID, "ELAN0001") |
| 76 | Name (_DDN, "Elan Touchscreen") |
| 77 | Name (_UID, 1) |
| 78 | Name (_S0W, 4) |
| 79 | |
| 80 | Name (_CRS, ResourceTemplate () |
| 81 | { |
| 82 | I2cSerialBus ( |
| 83 | BOARD_TOUCHSCREEN_I2C_ADDR, |
| 84 | ControllerInitiated, |
| 85 | 400000, |
| 86 | AddressingMode7Bit, |
| 87 | "\\_SB.PCI0.I2C0", |
| 88 | ) |
| 89 | Interrupt (ResourceConsumer, Edge, ActiveLow) |
| 90 | { |
| 91 | BOARD_TOUCHSCREEN_IRQ |
| 92 | } |
| 93 | }) |
| 94 | |
| 95 | Method (_STA) |
| 96 | { |
| 97 | Return (0xF) |
| 98 | } |
| 99 | } |
| 100 | } |
| 101 | |
| 102 | Scope (\_SB.PCI0.I2C1) |
| 103 | { |
| 104 | /* Touchpad */ |
| 105 | Device (ELTP) |
| 106 | { |
| 107 | Name (_HID, "ELAN0000") |
| 108 | Name (_DDN, "Elan Touchpad") |
| 109 | Name (_UID, 1) |
| 110 | Name (_S0W, 4) |
| 111 | |
| 112 | Name (_CRS, ResourceTemplate () |
| 113 | { |
| 114 | I2cSerialBus ( |
| 115 | BOARD_TOUCHPAD_I2C_ADDR, |
| 116 | ControllerInitiated, |
| 117 | 400000, |
| 118 | AddressingMode7Bit, |
| 119 | "\\_SB.PCI0.I2C1", |
| 120 | ) |
| 121 | Interrupt (ResourceConsumer, Edge, ActiveLow) |
| 122 | { |
| 123 | BOARD_TOUCHPAD_IRQ |
| 124 | } |
| 125 | }) |
| 126 | |
david | 2b7103c | 2015-11-10 15:00:18 +0800 | [diff] [blame^] | 127 | Name (_PRW, Package() { GPE_TOUCHPAD_WAKE, 0x3 }) |
| 128 | |
david | ad038c1 | 2015-10-23 20:22:22 +0800 | [diff] [blame] | 129 | Method (_STA) |
| 130 | { |
| 131 | Return (0xF) |
| 132 | } |
| 133 | } |
| 134 | } |
| 135 | |
| 136 | Scope (\_SB.PCI0.I2C4) |
| 137 | { |
| 138 | /* Headphone Codec */ |
| 139 | Device (HPMC) |
| 140 | { |
| 141 | Name (_HID, "10508825") |
| 142 | Name (_DDN, "NAU88L25 Codec") |
| 143 | Name (_UID, 1) |
| 144 | Name (_DSD, Package () { |
| 145 | ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), |
| 146 | Package () { |
| 147 | /* Enable jack detection via JKDET pin */ |
| 148 | Package () { "nuvoton,jkdet-enable", 1 }, |
| 149 | /* |
| 150 | * JKDET pin is pulled up by R389 on board. |
| 151 | * JKDET pin polarity = active low |
| 152 | */ |
| 153 | Package () { "nuvoton,jkdet-pull-enable", 1 }, |
| 154 | Package () { "nuvoton,jkdet-pull-up", 1 }, |
| 155 | Package () { "nuvoton,jkdet-polarity", 1 }, |
| 156 | /* VDDA(1.8) * 1.53 = 2.754 */ |
| 157 | Package () { "nuvoton,micbias-voltage", 6 }, |
| 158 | /* VREF Impedance = 125 kOhm */ |
| 159 | Package () { "nuvoton,vref-impedance", 2 }, |
| 160 | /* |
| 161 | * Setup 4 buttons impedance according to |
| 162 | * Android specification |
| 163 | */ |
| 164 | Package () { "nuvoton,sar-threshold-num", 4 }, |
| 165 | Package () { "nuvoton,sar-threshold", |
| 166 | Package() { 0x0a, 0x14, 0x26, 0x73 } }, |
| 167 | /* |
| 168 | * Coeff 0-15 used to adjust threshold level |
| 169 | * 0 for low resist range |
| 170 | */ |
| 171 | Package () { "nuvoton,sar-hysteresis", 0 }, |
| 172 | /* SAR tracking gain based on 2.754 micbias-voltage */ |
| 173 | Package () { "nuvoton,sar-voltage", 6 }, |
| 174 | /* 100ms short key press debounce */ |
| 175 | Package () { "nuvoton,short-key-debounce", 3 }, |
| 176 | /* 2^(7+2) = 512 ms insert/eject debounce */ |
| 177 | Package () { "nuvoton,jack-insert-debounce", 7 }, |
| 178 | /* debounce not needed for eject normally */ |
| 179 | Package () { "nuvoton,jack-eject-debounce", 0 }, |
| 180 | } |
| 181 | }) |
| 182 | |
| 183 | Name (_CRS, ResourceTemplate() |
| 184 | { |
| 185 | I2cSerialBus ( |
| 186 | BOARD_HP_MIC_CODEC_I2C_ADDR, |
| 187 | ControllerInitiated, |
| 188 | 400000, |
| 189 | AddressingMode7Bit, |
| 190 | "\\_SB.PCI0.I2C4", |
| 191 | ) |
| 192 | Interrupt (ResourceConsumer, Level, ActiveLow) |
| 193 | { |
| 194 | BOARD_HP_MIC_CODEC_IRQ |
| 195 | } |
| 196 | }) |
| 197 | |
| 198 | Method (_STA) |
| 199 | { |
| 200 | Return (0xF) |
| 201 | } |
| 202 | } |
| 203 | |
| 204 | /* Left Speaker Amp */ |
| 205 | Device (SPKL) |
| 206 | { |
| 207 | Name (_HID, "INT343B") |
| 208 | Name (_DDN, "SSM4567 Speaker Amp") |
| 209 | Name (_UID, 0) |
| 210 | |
| 211 | Name (_CRS, ResourceTemplate() |
| 212 | { |
| 213 | I2cSerialBus ( |
| 214 | BOARD_LEFT_SPEAKER_AMP_I2C_ADDR, |
| 215 | ControllerInitiated, |
| 216 | 400000, |
| 217 | AddressingMode7Bit, |
| 218 | "\\_SB.PCI0.I2C4", |
| 219 | ) |
| 220 | }) |
| 221 | |
| 222 | Method (_STA) |
| 223 | { |
| 224 | Return (0xF) |
| 225 | } |
| 226 | } |
| 227 | |
| 228 | /* Right Speaker Amp */ |
| 229 | Device (SPKR) |
| 230 | { |
| 231 | Name (_HID, "INT343B") |
| 232 | Name (_DDN, "SSM4567 Speaker Amp") |
| 233 | Name (_UID, 1) |
| 234 | |
| 235 | Name (_CRS, ResourceTemplate() |
| 236 | { |
| 237 | I2cSerialBus ( |
| 238 | BOARD_RIGHT_SPEAKER_AMP_I2C_ADDR, |
| 239 | ControllerInitiated, |
| 240 | 400000, |
| 241 | AddressingMode7Bit, |
| 242 | "\\_SB.PCI0.I2C4", |
| 243 | ) |
| 244 | }) |
| 245 | |
| 246 | Method (_STA) |
| 247 | { |
| 248 | Return (0xF) |
| 249 | } |
| 250 | } |
| 251 | } |