diff options
author | Philip Chen <philipchen@google.com> | 2019-08-09 14:49:38 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-08-16 01:44:02 +0000 |
commit | 623b89a51152d59bdf82dfdfcfcfb4c76c52a884 (patch) | |
tree | 5e5b6c1b2b529a219d6578b0176ba344bea6c2a9 /common | |
parent | 127d89622a133e6b29e0f07b899cb7987b07c31c (diff) | |
download | chrome-ec-623b89a51152d59bdf82dfdfcfcfb4c76c52a884.tar.gz |
acpi: Notify AP when setting DPTF profile number
Assuming a device without hall sensor is switched from clamshell mode
all the way to 360-degree-flipped mode, the event sequence is like:
(a) When the device hits 200-degree, it switches to tablet mode.
(b) We notify AP to re-read DPTF profile from ACPI.
(c) When the device hits 300-degree, it switches to 360-degree
flipped mode and updates DPTF profile in EC space.
Since the DPTF profile is switched in (c) while AP re-reads
the DPTF profile in (b), AP wouldn't update DPTF profile for
360-degree-flipped mode.
To fix this issue, let's notify AP when updating DPTF profile.
BUG=b:139168228
BRANCH=none
TEST=manually test on Nautilus/Hatch and confirm trip temperature
is updated in flipped-360-degree mode
Change-Id: I3bc61fb3d7808bf17f7da7ebc606307fbbf026fc
Signed-off-by: Philip Chen <philipchen@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1747166
Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Commit-Queue: Philip Chen <philipchen@chromium.org>
Tested-by: Philip Chen <philipchen@chromium.org>
Diffstat (limited to 'common')
-rw-r--r-- | common/acpi.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/common/acpi.c b/common/acpi.c index e741fc2abc..68134a86e0 100644 --- a/common/acpi.c +++ b/common/acpi.c @@ -111,9 +111,14 @@ int acpi_dptf_set_profile_num(int n) { int ret = acpi_dptf_is_profile_valid(n); - if (ret == EC_SUCCESS) + if (ret == EC_SUCCESS) { current_dptf_profile = n; - + if (IS_ENABLED(CONFIG_DPTF_MULTI_PROFILE) && + IS_ENABLED(CONFIG_HOSTCMD_EVENTS)) { + /* Notify kernel to update DPTF profile */ + host_set_single_event(EC_HOST_EVENT_MODE_CHANGE); + } + } return ret; } |