diff --git a/board/poppy/board.c b/board/poppy/board.c index 6c4bde140f..9776cbcf6b 100644 --- a/board/poppy/board.c +++ b/board/poppy/board.c @@ -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) diff --git a/board/poppy/board.h b/board/poppy/board.h index a0f6c7f6da..ebd2e9b58b 100644 --- a/board/poppy/board.h +++ b/board/poppy/board.h @@ -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