Files
OpenCellular/common/tablet_mode.c
Gwendal Grignou 1523e8b3ef motion: Disable tablet mode if one accel is broken
We need 2 accelerometer for tablet mode. If one of them is not working,
disable tablet mode. We will stay in clamshell mode, lid angle will be
always unreliable.

BUG=chrome-os-partner:61141
TEST=On kevin with a single sensor. Check we are in clamshell mode
when rebooting the EC.
BRANCH=kevin

Change-Id: I7bf6cdc9d85370fce20e5183622b4bc18f4f5f99
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/424184
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2017-01-04 18:07:12 -08:00

24 lines
449 B
C

/* Copyright 2016 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "hooks.h"
/* Return 1 if in tablet mode, 0 otherwise */
static int tablet_mode = 1;
int tablet_get_mode(void)
{
return tablet_mode;
}
void tablet_set_mode(int mode)
{
if (tablet_mode != mode) {
tablet_mode = mode;
hook_notify(HOOK_TABLET_MODE_CHANGE);
}
}