summaryrefslogtreecommitdiff
path: root/src/ec/google/chromeec/acpi
diff options
context:
space:
mode:
authorPatrick Georgi <pgeorgi@google.com>2017-08-24 23:12:55 +0200
committerPatrick Georgi <pgeorgi@google.com>2017-08-30 07:27:16 +0000
commitf9267f9bcdcc98f4c1689de3c573feaee511f13d (patch)
tree2a6a8a13d2ffa65eea394a5e1563026818ecb20c /src/ec/google/chromeec/acpi
parent5934be25fd26a2bef4cb34097a09447b68ef3bc7 (diff)
downloadcoreboot-f9267f9bcdcc98f4c1689de3c573feaee511f13d.tar.xz
ec/google: Use feature flag layout that matches the EC host command
The EC side of the feature bits in ACPI EC space isn't stable yet, and we're now going for matching them up with the EC host command of the same purpose. Change-Id: I9c1f0e5390e840ea0c32315a3da8eea6f3e12f54 Signed-off-by: Patrick Georgi <pgeorgi@google.com> Reviewed-on: https://review.coreboot.org/21193 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src/ec/google/chromeec/acpi')
-rw-r--r--src/ec/google/chromeec/acpi/ec.asl38
-rw-r--r--src/ec/google/chromeec/acpi/keyboard_backlight.asl14
2 files changed, 48 insertions, 4 deletions
diff --git a/src/ec/google/chromeec/acpi/ec.asl b/src/ec/google/chromeec/acpi/ec.asl
index 422abe1881..0d05110262 100644
--- a/src/ec/google/chromeec/acpi/ec.asl
+++ b/src/ec/google/chromeec/acpi/ec.asl
@@ -47,15 +47,49 @@ Device (EC0)
RAMV, 8, // EC RAM Version
TSTB, 8, // Test Byte
TSTC, 8, // Complement of Test Byte
- KBLV, 8, // Keyboard Backlight
+ KBLV, 8, // Keyboard Backlight value
FAND, 8, // Set Fan Duty Cycle
PATI, 8, // Programmable Auxiliary Trip Sensor ID
PATT, 8, // Programmable Auxiliary Trip Threshold
PATC, 8, // Programmable Auxiliary Trip Commit
CHGL, 8, // Charger Current Limit
TBMD, 1, // Tablet mode
+ // DFUD must be 0 for the other 31 values to be valid
Offset (0x0a),
- KBLE, 1, // Keyboard Backlight exists
+ DFUD, 1, // Device Features Undefined
+ FLSH, 1, // Flash commands present
+ PFAN, 1, // PWM Fan control present
+ KBLE, 1, // Keyboard Backlight present
+ LTBR, 1, // Lightbar present
+ LEDC, 1, // LED control
+ MTNS, 1, // Motion sensors present
+ KEYB, 1, // EC is keyboard controller
+ PSTR, 1, // Persistent storage
+ P80P, 1, // EC serves I/O Port 80h
+ THRM, 1, // EC supports thermal management
+ SBKL, 1, // Screen backlight switch present
+ WIFI, 1, // WIFI switch present
+ HOST, 1, // EC monitors host events (eg SCI, SMI)
+ GPIO, 1, // EC provides GPIO commands
+ I2CB, 1, // EC provides I2C controller access
+ CHRG, 1, // EC provides commands for charger control
+ BATT, 1, // Simply Battery support
+ SBAT, 1, // Smart Battery support
+ HANG, 1, // EC can detect host hang
+ PMUI, 1, // Power Information
+ DSEC, 1, // another EC exists downstream
+ UPDC, 1, // supports USB Power Delivery
+ UMUX, 1, // supports USB Mux
+ MSFF, 1, // Motion Sense has FIFO
+ TVST, 1, // supports temporary secure vstore
+ TCMV, 1, // USB Type C Muxing is virtual (host assisted)
+ RTCD, 1, // EC provides an RTC device
+ FPRD, 1, // EC provides a fingerprint reader device
+ TPAD, 1, // EC provides a touchpad device
+ RWSG, 1, // EC has RWSIG task enabled
+ DEVE, 1, // EC supports device events
+ // make sure we're within our space envelope
+ Offset (0x0e),
}
#if IS_ENABLED(CONFIG_EC_GOOGLE_CHROMEEC_ACPI_MEMMAP)
diff --git a/src/ec/google/chromeec/acpi/keyboard_backlight.asl b/src/ec/google/chromeec/acpi/keyboard_backlight.asl
index d76bed87ea..1edce819d1 100644
--- a/src/ec/google/chromeec/acpi/keyboard_backlight.asl
+++ b/src/ec/google/chromeec/acpi/keyboard_backlight.asl
@@ -33,8 +33,18 @@ Scope (\_SB)
*/
Method (_STA, 0, NotSerialized)
{
- Multiply (0xf, \_SB.PCI0.LPCB.EC0.KBLE, Local0)
- Return (Local0)
+ /* If query is unsupported, but this code is compiled
+ * in, assume the backlight exists physically.
+ */
+ If (LEqual (1, \_SB.PCI0.LPCB.EC0.DFUD)) {
+ Return (0xf)
+ }
+ /* If EC reports that backlight exists, trust it */
+ If (LEqual (1, \_SB.PCI0.LPCB.EC0.KBLE)) {
+ Return (0xf)
+ }
+ /* Otherwise: no device -> disable */
+ Return (0)
}
/* Read current backlight value */