From 036ccd73a34777908132e6ec2f59adce6ae607f7 Mon Sep 17 00:00:00 2001 From: Karthikeyan Ramasubramanian Date: Tue, 23 Oct 2018 22:16:36 -0600 Subject: google/chromeec/acpi/ec: Add support for Device DPTF Profile Number In order to support Multi-DPTF profile, Device DPTF Profile Number is introduced into EC_ACPI_MEM_DEVICE_ORIENTATION ACPI Space at offset 0x09. This bit field stays along with Tablet Mode Device flag. BUG=b:118149364 BRANCH=None TEST=Ensured that the expected DPTF table are loaded in different modes(base attached/detached and clamshell/360-flipped) on Soraka and Nautilus. Change-Id: Ie14916ac16c50cbe0990021e2eb03d5121cd0e07 Signed-off-by: Karthikeyan Ramasubramanian Reviewed-on: https://review.coreboot.org/29248 Tested-by: build bot (Jenkins) Reviewed-by: Furquan Shaikh Reviewed-by: Sumeet R Pawnikar --- src/ec/google/chromeec/acpi/ec.asl | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/ec/google/chromeec') diff --git a/src/ec/google/chromeec/acpi/ec.asl b/src/ec/google/chromeec/acpi/ec.asl index 7fb2f2449d..b2e65d0e31 100644 --- a/src/ec/google/chromeec/acpi/ec.asl +++ b/src/ec/google/chromeec/acpi/ec.asl @@ -52,6 +52,7 @@ Device (EC0) PATC, 8, // Programmable Auxiliary Trip Commit CHGL, 8, // Charger Current Limit TBMD, 1, // Tablet mode + DDPN, 3, // Device DPTF Profile Number // DFUD must be 0 for the other 31 values to be valid Offset (0x0a), DFUD, 1, // Device Features Undefined @@ -509,6 +510,21 @@ Device (EC0) Return (^TBMD) } + /* Read current Device DPTF Profile Number */ + Method (RCDP, 0, NotSerialized) + { + /* + * DDPN = 0 is reserved for backwards compatibility. + * If DDPN == 0 use TBMD to load appropriate DPTF table. + */ + If (LEqual (^DDPN, 0)) { + Return (^TBMD) + } Else { + Subtract (^DDPN, 1, Local0) + Return (Local0) + } + } + #if IS_ENABLED(CONFIG_EC_GOOGLE_CHROMEEC_ACPI_USB_PORT_POWER) /* * Enable USB Port Power -- cgit v1.2.3