mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-08 16:41:55 +00:00
poppy: Enable tablet mode
BUG=b:35775100 BRANCH=None TEST=Verified that tablet mode switch events can be seen in evtest. Event: time 1489093184.754803, -------------- SYN_REPORT ------------ Event: time 1489093196.842930, type 5 (EV_SW), code 1 (SW_TABLET_MODE), value 0 Event: time 1489093196.842930, -------------- SYN_REPORT ------------ Event: time 1489093198.839809, type 5 (EV_SW), code 1 (SW_TABLET_MODE), value 1 Event: time 1489093198.839809, -------------- SYN_REPORT ------------ Change-Id: Id47e817ba12294cc07281df3e04a9d68dec40ee7 Signed-off-by: Furquan Shaikh <furquan@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/451582 Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
committed by
chrome-bot
parent
593f9f9a57
commit
061a0fe237
@@ -40,6 +40,7 @@
|
||||
#include "spi.h"
|
||||
#include "switch.h"
|
||||
#include "system.h"
|
||||
#include "tablet_mode.h"
|
||||
#include "task.h"
|
||||
#include "temp_sensor.h"
|
||||
#include "timer.h"
|
||||
@@ -148,6 +149,9 @@ enum base_status {
|
||||
* status. Actions taken include:
|
||||
* 1. Change in power to base
|
||||
* 2. Indicate mode change to host.
|
||||
* 3. Indicate tablet mode to host. Current assumption is that if base is
|
||||
* disconnected then the system is in tablet mode, else if the base is
|
||||
* connected, then the system is not in tablet mode.
|
||||
*/
|
||||
static void base_detect_change(enum base_status connected)
|
||||
{
|
||||
@@ -155,6 +159,7 @@ static void base_detect_change(enum base_status connected)
|
||||
"not " : "");
|
||||
gpio_set_level(GPIO_PP3300_DX_BASE, connected);
|
||||
host_set_single_event(EC_HOST_EVENT_MODE_CHANGE);
|
||||
tablet_set_mode(!connected);
|
||||
}
|
||||
|
||||
static void base_detect_deferred(void)
|
||||
|
||||
@@ -110,6 +110,9 @@
|
||||
/* Depends on how fast the AP boots and typical ODRs */
|
||||
#define CONFIG_ACCEL_FIFO_THRES (CONFIG_ACCEL_FIFO / 3)
|
||||
|
||||
#define CONFIG_TABLET_MODE
|
||||
#define CONFIG_TABLET_MODE_SWITCH
|
||||
|
||||
/* USB */
|
||||
#define CONFIG_USB_CHARGER
|
||||
#define CONFIG_USB_PD_ALT_MODE
|
||||
|
||||
Reference in New Issue
Block a user