summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFurquan Shaikh <furquan@google.com>2018-10-19 15:34:33 -0700
committerchrome-bot <chrome-bot@chromium.org>2018-10-30 01:04:57 -0700
commit09a5e0a9398a1ca9e953969d5c10d3b60cda8eac (patch)
tree609fd9dfbc271cf71513e52df5d4473749e87e70
parent23a82485cfd2e893fa147dd0fd877ff783316c8f (diff)
downloadchrome-ec-09a5e0a9398a1ca9e953969d5c10d3b60cda8eac.tar.gz
dptf: Get rid of CONFIG_DPTF_DEVICE_ORIENTATION
CONFIG_DPTF_DEVICE_ORIENTATION was added to indicate mode change to the host to allow it to read the tablet mode flag from shared EC memory and select the right DPTF table to load (if supported). However, this config seems unnecessary because of the following reasons: 1. Host sets SCI mask to indicate to the EC which events it wants to process. Thus, even if the EC sets mode change flag, it will not be notified to the host unless it supports mode change event. 2. Additionally, if host supports mode change event, but does not support multiple DPTF tables, then EC ACPI code takes care of ensuring that there is a thermal event handler present to reload tables. 3. CONFIG_DPTF_DEVICE_ORIENTATION was defined for almost all new x86 boards. BUG=b:117844490 BRANCH=None TEST=make -j buildall Change-Id: Ic4097ae047e2d559673a321da4df86514f902993 Signed-off-by: Furquan Shaikh <furquan@google.com> Reviewed-on: https://chromium-review.googlesource.com/1292359 Commit-Ready: Furquan Shaikh <furquan@chromium.org> Tested-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
-rw-r--r--baseboard/octopus/baseboard.h1
-rw-r--r--board/coral/board.h1
-rw-r--r--board/eve/board.h1
-rw-r--r--board/nami/board.h1
-rw-r--r--board/nautilus/board.h1
-rw-r--r--board/poppy/board.h1
-rw-r--r--board/rammus/board.h1
-rw-r--r--board/reef/board.h1
-rw-r--r--board/reef_it8320/board.h1
-rw-r--r--board/reef_mchp/board.h1
-rw-r--r--common/acpi.c4
-rw-r--r--common/dptf.c2
-rw-r--r--include/config.h3
-rw-r--r--include/tablet_mode.h8
14 files changed, 9 insertions, 18 deletions
diff --git a/baseboard/octopus/baseboard.h b/baseboard/octopus/baseboard.h
index 8c4ef9c961..12f0dbb689 100644
--- a/baseboard/octopus/baseboard.h
+++ b/baseboard/octopus/baseboard.h
@@ -79,7 +79,6 @@
#define CONFIG_LOW_POWER_IDLE
#define CONFIG_PWM
#define CONFIG_DPTF
-#define CONFIG_DPTF_DEVICE_ORIENTATION
/* Port80 -- allow larger buffer for port80 messages */
#undef CONFIG_PORT80_HISTORY_LEN
diff --git a/board/coral/board.h b/board/coral/board.h
index 09f9dca66a..5a60c51aea 100644
--- a/board/coral/board.h
+++ b/board/coral/board.h
@@ -140,7 +140,6 @@
#define CONFIG_STEINHART_HART_3V3_13K7_47K_4050B
#define CONFIG_STEINHART_HART_3V3_51K1_47K_4050B
#define CONFIG_DPTF
-#define CONFIG_DPTF_DEVICE_ORIENTATION
#define CONFIG_SCI_GPIO GPIO_PCH_SCI_L
#define CONFIG_VBOOT_HASH
#define CONFIG_VOLUME_BUTTONS
diff --git a/board/eve/board.h b/board/eve/board.h
index df9541e5c3..0f521bdccb 100644
--- a/board/eve/board.h
+++ b/board/eve/board.h
@@ -29,7 +29,6 @@
#define CONFIG_BOARD_FORCE_RESET_PIN
#define CONFIG_DEVICE_EVENT
#define CONFIG_DPTF
-#define CONFIG_DPTF_DEVICE_ORIENTATION
#define CONFIG_FLASH_SIZE 0x80000
#define CONFIG_FPU
#define CONFIG_I2C
diff --git a/board/nami/board.h b/board/nami/board.h
index 4af9b5e787..4d9d88dd80 100644
--- a/board/nami/board.h
+++ b/board/nami/board.h
@@ -24,7 +24,6 @@
#define CONFIG_CROS_BOARD_INFO
#define CONFIG_CASE_CLOSED_DEBUG_EXTERNAL
#define CONFIG_DPTF
-#define CONFIG_DPTF_DEVICE_ORIENTATION
#define CONFIG_FLASH_SIZE 0x80000
#define CONFIG_FPU
#define CONFIG_I2C
diff --git a/board/nautilus/board.h b/board/nautilus/board.h
index e37bc29196..f3c88a9540 100644
--- a/board/nautilus/board.h
+++ b/board/nautilus/board.h
@@ -21,7 +21,6 @@
#define CONFIG_BOARD_FORCE_RESET_PIN
#define CONFIG_CASE_CLOSED_DEBUG_EXTERNAL
#define CONFIG_DPTF
-#define CONFIG_DPTF_DEVICE_ORIENTATION
#define CONFIG_FLASH_SIZE 0x80000
#define CONFIG_FPU
#define CONFIG_I2C
diff --git a/board/poppy/board.h b/board/poppy/board.h
index 358b83aaa1..8b0a0f5944 100644
--- a/board/poppy/board.h
+++ b/board/poppy/board.h
@@ -22,7 +22,6 @@
#define CONFIG_BUTTON_TRIGGERED_RECOVERY
#define CONFIG_DETACHABLE_BASE
#define CONFIG_DPTF
-#define CONFIG_DPTF_DEVICE_ORIENTATION
#define CONFIG_EMULATED_SYSRQ
#define CONFIG_FLASH_SIZE 0x80000
#define CONFIG_FPU
diff --git a/board/rammus/board.h b/board/rammus/board.h
index 883de5e665..3dfd3e703a 100644
--- a/board/rammus/board.h
+++ b/board/rammus/board.h
@@ -22,7 +22,6 @@
#define CONFIG_CRC8
#define CONFIG_CROS_BOARD_INFO
#define CONFIG_DPTF
-#define CONFIG_DPTF_DEVICE_ORIENTATION
#define CONFIG_FLASH_SIZE 0x80000
#define CONFIG_FPU
#define CONFIG_I2C
diff --git a/board/reef/board.h b/board/reef/board.h
index b8ceea0544..3c4577ef2b 100644
--- a/board/reef/board.h
+++ b/board/reef/board.h
@@ -135,7 +135,6 @@
#define CONFIG_STEINHART_HART_3V3_13K7_47K_4050B
#define CONFIG_STEINHART_HART_3V3_51K1_47K_4050B
#define CONFIG_DPTF
-#define CONFIG_DPTF_DEVICE_ORIENTATION
#define CONFIG_SCI_GPIO GPIO_PCH_SCI_L
#define CONFIG_VOLUME_BUTTONS
#define GPIO_VOLUME_DOWN_L GPIO_EC_VOLDN_BTN_ODL
diff --git a/board/reef_it8320/board.h b/board/reef_it8320/board.h
index 9469481f8b..85399a3cc5 100644
--- a/board/reef_it8320/board.h
+++ b/board/reef_it8320/board.h
@@ -118,7 +118,6 @@
#define CONFIG_STEINHART_HART_3V3_13K7_47K_4050B
#define CONFIG_STEINHART_HART_3V3_51K1_47K_4050B
#define CONFIG_DPTF
-#define CONFIG_DPTF_DEVICE_ORIENTATION
#define CONFIG_SCI_GPIO GPIO_PCH_SCI_L
#define CONFIG_VBOOT_HASH
#define CONFIG_VOLUME_BUTTONS
diff --git a/board/reef_mchp/board.h b/board/reef_mchp/board.h
index 2fe60fe066..1177268f20 100644
--- a/board/reef_mchp/board.h
+++ b/board/reef_mchp/board.h
@@ -133,7 +133,6 @@
#define CONFIG_TEMP_SENSOR
#define CONFIG_THERMISTOR_NCP15WB
#define CONFIG_DPTF
-#define CONFIG_DPTF_DEVICE_ORIENTATION
#define CONFIG_SCI_GPIO GPIO_PCH_SCI_L
#define CONFIG_VOLUME_BUTTONS
#define GPIO_VOLUME_DOWN_L GPIO_EC_VOLDN_BTN_ODL
diff --git a/common/acpi.c b/common/acpi.c
index de6b927747..3baad4dc4d 100644
--- a/common/acpi.c
+++ b/common/acpi.c
@@ -178,11 +178,7 @@ int acpi_ap_to_ec(int is_cmd, uint8_t value, uint8_t *resultptr)
#endif
case EC_ACPI_MEM_DEVICE_ORIENTATION:
-#ifdef CONFIG_DPTF_DEVICE_ORIENTATION
result = tablet_get_mode();
-#else
- result = 0;
-#endif
break;
case EC_ACPI_MEM_DEVICE_FEATURES0:
diff --git a/common/dptf.c b/common/dptf.c
index 6833356dec..a391732905 100644
--- a/common/dptf.c
+++ b/common/dptf.c
@@ -103,7 +103,7 @@ void dptf_set_temp_threshold(int sensor_id, int temp, int idx, int enable)
}
}
-#ifdef CONFIG_DPTF_DEVICE_ORIENTATION
+#ifdef CONFIG_TABLET_MODE
/*
* When tablet mode changes, send an event to ACPI to retrieve
* tablet mode value and send an event to the kernel.
diff --git a/include/config.h b/include/config.h
index 53be906a07..b175375dae 100644
--- a/include/config.h
+++ b/include/config.h
@@ -1378,9 +1378,6 @@
*/
#undef CONFIG_FAN_UPDATE_PERIOD
-/* Send event when mode change, host read acpi memory and select DPTF table */
-#undef CONFIG_DPTF_DEVICE_ORIENTATION
-
/*****************************************************************************/
/* Flash configuration */
diff --git a/include/tablet_mode.h b/include/tablet_mode.h
index 2568ba2e86..34616a74a3 100644
--- a/include/tablet_mode.h
+++ b/include/tablet_mode.h
@@ -5,6 +5,8 @@
/* Header for tablet_mode.c */
+#ifdef CONFIG_TABLET_MODE
+
/* Return 1 if in tablet mode, 0 otherwise */
int tablet_get_mode(void);
void tablet_set_mode(int mode);
@@ -23,3 +25,9 @@ void tablet_mode_isr(enum gpio_signal signal);
* useful for clamshell devices.
*/
void tablet_disable_switch(void);
+
+#else
+
+static inline int tablet_get_mode(void) { return 0; }
+
+#endif