diff options
author | Nicolas Boichat <drinkcat@chromium.org> | 2018-11-30 16:25:07 +0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-12-01 01:08:43 -0800 |
commit | 5c82e0336ba3dd6f93fdc4dd9c553cfb69c5caa3 (patch) | |
tree | e211c547835e47505ed7e88ef6ffcd5d8e6ea7f2 /board | |
parent | 6d6378b8d0f9a08eee75dfb794b5697cdcd4b821 (diff) | |
download | chrome-ec-5c82e0336ba3dd6f93fdc4dd9c553cfb69c5caa3.tar.gz |
tablet_mode: Fix tablet mode for tablet devices
Tablet devices would normally only define CONFIG_TABLET_MODE_SWITCH,
and not CONFIG_TABLET_MODE, and define a tablet_get_mode function
which always returns 1.
Since 09a5e0a9398 "dptf: Get rid of CONFIG_DPTF_DEVICE_ORIENTATION",
tablet_mode.h, when CONFIG_TABLET_MODE is not set, would define an
_inline_ tablet_get_mode function which would always return 0,
causing tablets to always be in laptop mode.
Fix this by:
- Removing the inline in tablet_mode.h.
- Add CONFIG_TABLET_MODE to all our tablets (after removing the
inline, compilation fails if CONFIG_TABLET_MODE_SWITCH is set,
but not CONFIG_TABLET_MODE).
- Remove tablet_get_mode from board/*/board.c, as the default
mode is tablet, anyway.
BRANCH=none
BUG=b:120252451
TEST=Boot kukui, onscreen keyboard works
TEST=No code size increase:
build/kukui/RW/space_free_flash shrank by 36 bytes: (23968 to 23932)
build/kukui/RW/space_free_ram shrank by 4 bytes: (10356 to 10352)
build/rainier/RW/space_free_flash shrank by 36 bytes: (44296 to 44260)
build/rainier/RW/space_free_ram shrank by 4 bytes: (12948 to 12944)
build/scarlet/RW/space_free_flash shrank by 36 bytes: (28128 to 28092)
build/scarlet/RW/space_free_ram shrank by 4 bytes: (10532 to 10528)
Change-Id: Ifea0412bb32f1d701ad2040ad62a5c812705b14a
Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1355645
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
Diffstat (limited to 'board')
-rw-r--r-- | board/kukui/board.c | 6 | ||||
-rw-r--r-- | board/kukui/board.h | 1 | ||||
-rw-r--r-- | board/rainier/board.c | 6 | ||||
-rw-r--r-- | board/rainier/board.h | 1 | ||||
-rw-r--r-- | board/scarlet/board.c | 6 | ||||
-rw-r--r-- | board/scarlet/board.h | 1 |
6 files changed, 3 insertions, 18 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. */ |