diff options
author | Nicolas Boichat <drinkcat@chromium.org> | 2018-05-30 15:55:57 +0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-06-06 05:00:49 -0700 |
commit | 65d87bf9f0ef9b084d91ed44eda58b7463c82b48 (patch) | |
tree | 64bcafd6797a3a60bc9c5a7e2164688ad9bb7a38 /common/tablet_mode.c | |
parent | 8290d879dab1fbba805cfcdb4f2409bdee803dc6 (diff) | |
download | chrome-ec-65d87bf9f0ef9b084d91ed44eda58b7463c82b48.tar.gz |
whiskers: Expose a switch for tablet mode
With this, whiskers exposes a tablet mode switch to inform the
lid when the base is flipped around.
We take this opportunity to clean up a bit whiskers/keyboard
code:
- Use tablet mode switch instead of lid switch
- Refactor usb_hid_keyboard.c to accept either assistant key
or tablet mode switch, or both.
- Remove bit-field usage in HID report struct, and instead,
generalize with an "extra" field that can be used for
additional key/switches.
BRANCH=none
BUG=b:73133611
TEST=Flash whiskers, see that tablet mode events are sent when
a magnet approaches the hall sensor.
Change-Id: Ibf43bb04fdc867d18d9f318388d1ebd17b49d47f
Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1077915
Reviewed-by: Wei-Han Chen <stimim@chromium.org>
Diffstat (limited to 'common/tablet_mode.c')
-rw-r--r-- | common/tablet_mode.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/common/tablet_mode.c b/common/tablet_mode.c index 5e73dd4c93..edda95085f 100644 --- a/common/tablet_mode.c +++ b/common/tablet_mode.c @@ -41,6 +41,7 @@ static void tablet_mode_debounce(void) /* We won't reach here on boards without a dedicated tablet switch */ tablet_set_mode(!gpio_get_level(TABLET_MODE_GPIO_L)); +#ifdef CONFIG_LID_ANGLE_UPDATE /* Then, we disable peripherals only when the lid reaches 360 position. * (It's probably already disabled by motion_sense_task.) * We deliberately do not enable peripherals when the lid is leaving @@ -48,6 +49,7 @@ static void tablet_mode_debounce(void) * reaches laptop zone (180 or less). */ if (tablet_mode) lid_angle_peripheral_enable(0); +#endif /* CONFIG_LID_ANGLE_UPDATE */ } DECLARE_DEFERRED(tablet_mode_debounce); |