diff options
author | Furquan Shaikh <furquan@google.com> | 2018-11-01 14:43:07 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-11-15 02:16:03 -0800 |
commit | f02c6f83fae3cdce2933da60a0de44206295489f (patch) | |
tree | 02a9b58552041a7fec830ad74f41c4c47ed16e1a | |
parent | c495141798b6766ac13e73a018f736d9c4289aba (diff) | |
download | chrome-ec-f02c6f83fae3cdce2933da60a0de44206295489f.tar.gz |
eve: Enable support for multi-profile DPTF
This change enables support for multi-profile DPTF on eve, which uses
a hall sensor. Thus the following changes are made:
1. Select config CONFIG_DPTF_MULTI_PROFILE
2. Set profile number based on the TABLET_MODE_L GPIO state (input
from the hall sensor indicating completely flipped mode).
This change is being done only as a reference for future boards with
hall sensors to enable multi-profile DPTF. DO NOT cherry-pick this to
any eve branch.
CQ-DEPEND=CL:1295851,CL:1295852
BUG=b:117844490
BRANCH=None (Do not cherry-pick to any eve branch)
TEST=make -j buildall
Change-Id: I71e2078d8f63cc4d5939b76ffca962f041a48e42
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://chromium-review.googlesource.com/1313471
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Duncan Laurie <dlaurie@google.com>
-rw-r--r-- | board/eve/board.c | 11 | ||||
-rw-r--r-- | board/eve/board.h | 1 |
2 files changed, 11 insertions, 1 deletions
diff --git a/board/eve/board.c b/board/eve/board.c index a204851d96..a8288d5d9d 100644 --- a/board/eve/board.c +++ b/board/eve/board.c @@ -5,6 +5,7 @@ /* Eve board-specific configuration */ +#include "acpi.h" #include "adc_chip.h" #include "bd99992gw.h" #include "board_config.h" @@ -440,7 +441,15 @@ DECLARE_HOOK(HOOK_INIT, board_pmic_init, HOOK_PRIO_DEFAULT); static void board_set_tablet_mode(void) { - tablet_set_mode(!gpio_get_level(GPIO_TABLET_MODE_L)); + int flipped_360_mode = !gpio_get_level(GPIO_TABLET_MODE_L); + + tablet_set_mode(flipped_360_mode); + + /* Update DPTF profile based on mode */ + if (flipped_360_mode) + acpi_dptf_set_profile_num(DPTF_PROFILE_FLIPPED_360_MODE); + else + acpi_dptf_set_profile_num(DPTF_PROFILE_CLAMSHELL); } int board_has_working_reset_flags(void) diff --git a/board/eve/board.h b/board/eve/board.h index 0f521bdccb..ea276e5873 100644 --- a/board/eve/board.h +++ b/board/eve/board.h @@ -29,6 +29,7 @@ #define CONFIG_BOARD_FORCE_RESET_PIN #define CONFIG_DEVICE_EVENT #define CONFIG_DPTF +#define CONFIG_DPTF_MULTI_PROFILE #define CONFIG_FLASH_SIZE 0x80000 #define CONFIG_FPU #define CONFIG_I2C |