summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--board/kukui/board.c6
-rw-r--r--board/kukui/board.h1
-rw-r--r--board/rainier/board.c6
-rw-r--r--board/rainier/board.h1
-rw-r--r--board/scarlet/board.c6
-rw-r--r--board/scarlet/board.h1
-rw-r--r--common/acpi.c4
-rw-r--r--include/tablet_mode.h4
8 files changed, 7 insertions, 22 deletions
diff --git a/board/kukui/board.c b/board/kukui/board.c
index 1812de5ec3..c2b866bd0a 100644
--- a/board/kukui/board.c
+++ b/board/kukui/board.c
@@ -425,12 +425,6 @@ int board_allow_i2c_passthru(int port)
return (port == I2C_PORT_VIRTUAL_BATTERY);
}
-int tablet_get_mode(void)
-{
- /* Always in tablet mode */
- return 1;
-}
-
void usb_charger_set_switches(int port, enum usb_switch setting)
{
}
diff --git a/board/kukui/board.h b/board/kukui/board.h
index 276bb0f1ea..784d8fa83e 100644
--- a/board/kukui/board.h
+++ b/board/kukui/board.h
@@ -105,6 +105,7 @@
#endif /* SECTION_IS_RW */
/* To be able to indicate the device is in tablet mode. */
+#define CONFIG_TABLET_MODE
#define CONFIG_TABLET_MODE_SWITCH
/* FIFO size is in power of 2. */
diff --git a/board/rainier/board.c b/board/rainier/board.c
index 4be0e9e3f9..a8211560d7 100644
--- a/board/rainier/board.c
+++ b/board/rainier/board.c
@@ -433,12 +433,6 @@ int board_allow_i2c_passthru(int port)
return 0;
}
-int tablet_get_mode(void)
-{
- /* Always in tablet mode */
- return 1;
-}
-
int charge_want_shutdown(void)
{
/*
diff --git a/board/rainier/board.h b/board/rainier/board.h
index 1c5e9b6a03..e6f99c51ce 100644
--- a/board/rainier/board.h
+++ b/board/rainier/board.h
@@ -73,6 +73,7 @@
#define CONFIG_BARO_BMP280
/* To be able to indicate the device is in tablet mode. */
+#define CONFIG_TABLET_MODE
#define CONFIG_TABLET_MODE_SWITCH
/* FIFO size is in power of 2. */
diff --git a/board/scarlet/board.c b/board/scarlet/board.c
index 9d8b1269ff..7f217bcd80 100644
--- a/board/scarlet/board.c
+++ b/board/scarlet/board.c
@@ -439,12 +439,6 @@ int board_allow_i2c_passthru(int port)
return (port == I2C_PORT_VIRTUAL_BATTERY);
}
-int tablet_get_mode(void)
-{
- /* Always in tablet mode */
- return 1;
-}
-
void usb_charger_set_switches(int port, enum usb_switch setting)
{
/*
diff --git a/board/scarlet/board.h b/board/scarlet/board.h
index d6110c5ba3..1fd0080ca5 100644
--- a/board/scarlet/board.h
+++ b/board/scarlet/board.h
@@ -94,6 +94,7 @@
#define CONFIG_SYNC_INT_EVENT TASK_EVENT_CUSTOM(5)
/* To be able to indicate the device is in tablet mode. */
+#define CONFIG_TABLET_MODE
#define CONFIG_TABLET_MODE_SWITCH
/* FIFO size is in power of 2. */
diff --git a/common/acpi.c b/common/acpi.c
index da6795acd9..924a180cb8 100644
--- a/common/acpi.c
+++ b/common/acpi.c
@@ -221,7 +221,11 @@ int acpi_ap_to_ec(int is_cmd, uint8_t value, uint8_t *resultptr)
#endif
case EC_ACPI_MEM_DEVICE_ORIENTATION:
+ result = 0;
+
+#ifdef CONFIG_TABLET_MODE
result = tablet_get_mode() << EC_ACPI_MEM_TBMD_SHIFT;
+#endif
#ifdef CONFIG_DPTF
result |= (acpi_dptf_get_profile_num() &
diff --git a/include/tablet_mode.h b/include/tablet_mode.h
index df42356e3f..5edfb52f20 100644
--- a/include/tablet_mode.h
+++ b/include/tablet_mode.h
@@ -28,8 +28,4 @@ void hall_sensor_isr(enum gpio_signal signal);
*/
void hall_sensor_disable(void);
-#else
-
-static inline int tablet_get_mode(void) { return 0; }
-
#endif