diff options
-rw-r--r-- | common/hooks.c | 1 | ||||
-rw-r--r-- | core/cortex-m/ec.lds.S | 4 | ||||
-rw-r--r-- | core/cortex-m0/ec.lds.S | 4 | ||||
-rw-r--r-- | core/host/host_exe.lds | 4 | ||||
-rw-r--r-- | core/minute-ia/ec.lds.S | 6 | ||||
-rw-r--r-- | core/nds32/ec.lds.S | 4 | ||||
-rw-r--r-- | include/ec_commands.h | 1 | ||||
-rw-r--r-- | include/hooks.h | 7 | ||||
-rw-r--r-- | include/link_defs.h | 2 |
9 files changed, 32 insertions, 1 deletions
diff --git a/common/hooks.c b/common/hooks.c index 6a655b7d3c..c054804cb7 100644 --- a/common/hooks.c +++ b/common/hooks.c @@ -44,6 +44,7 @@ static const struct hook_ptrs hook_list[] = { {__hooks_chipset_reset, __hooks_chipset_reset_end}, {__hooks_ac_change, __hooks_ac_change_end}, {__hooks_lid_change, __hooks_lid_change_end}, + {__hooks_tablet_mode_change, __hooks_tablet_mode_change_end}, {__hooks_pwrbtn_change, __hooks_pwrbtn_change_end}, {__hooks_charge_state_change, __hooks_charge_state_change_end}, {__hooks_battery_soc_change, __hooks_battery_soc_change_end}, diff --git a/core/cortex-m/ec.lds.S b/core/cortex-m/ec.lds.S index bdaf382a55..97458f8a13 100644 --- a/core/cortex-m/ec.lds.S +++ b/core/cortex-m/ec.lds.S @@ -175,6 +175,10 @@ SECTIONS KEEP(*(.rodata.HOOK_LID_CHANGE)) __hooks_lid_change_end = .; + __hooks_tablet_mode_change = .; + KEEP(*(.rodata.HOOK_TABLET_MODE_CHANGE)) + __hooks_tablet_mode_change_end = .; + __hooks_pwrbtn_change = .; KEEP(*(.rodata.HOOK_POWER_BUTTON_CHANGE)) __hooks_pwrbtn_change_end = .; diff --git a/core/cortex-m0/ec.lds.S b/core/cortex-m0/ec.lds.S index 429c52ae34..d2bee481a9 100644 --- a/core/cortex-m0/ec.lds.S +++ b/core/cortex-m0/ec.lds.S @@ -127,6 +127,10 @@ SECTIONS KEEP(*(.rodata.HOOK_LID_CHANGE)) __hooks_lid_change_end = .; + __hooks_tablet_mode_change = .; + KEEP(*(.rodata.HOOK_TABLET_MODE_CHANGE)) + __hooks_tablet_mode_change_end = .; + __hooks_pwrbtn_change = .; KEEP(*(.rodata.HOOK_POWER_BUTTON_CHANGE)) __hooks_pwrbtn_change_end = .; diff --git a/core/host/host_exe.lds b/core/host/host_exe.lds index 6cdb172045..0763002945 100644 --- a/core/host/host_exe.lds +++ b/core/host/host_exe.lds @@ -73,6 +73,10 @@ SECTIONS { *(.rodata.HOOK_LID_CHANGE) __hooks_lid_change_end = .; + __hooks_tablet_mode_change = .; + KEEP(*(.rodata.HOOK_TABLET_MODE_CHANGE)) + __hooks_tablet_mode_change_end = .; + __hooks_pwrbtn_change = .; *(.rodata.HOOK_POWER_BUTTON_CHANGE) __hooks_pwrbtn_change_end = .; diff --git a/core/minute-ia/ec.lds.S b/core/minute-ia/ec.lds.S index 7490c9c854..2bdcc91e25 100644 --- a/core/minute-ia/ec.lds.S +++ b/core/minute-ia/ec.lds.S @@ -1,4 +1,4 @@ -/* Copyright (c) 2016 The Chromium OS Authors. All rights reserved. +/* Copyright 2016 The Chromium OS Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ @@ -98,6 +98,10 @@ SECTIONS KEEP(*(.rodata.HOOK_LID_CHANGE)) __hooks_lid_change_end = .; + __hooks_tablet_mode_change = .; + KEEP(*(.rodata.HOOK_TABLET_MODE_CHANGE)) + __hooks_tablet_mode_change_end = .; + __hooks_pwrbtn_change = .; KEEP(*(.rodata.HOOK_POWER_BUTTON_CHANGE)) __hooks_pwrbtn_change_end = .; diff --git a/core/nds32/ec.lds.S b/core/nds32/ec.lds.S index adff240325..43b905c899 100644 --- a/core/nds32/ec.lds.S +++ b/core/nds32/ec.lds.S @@ -117,6 +117,10 @@ SECTIONS KEEP(*(.rodata.HOOK_LID_CHANGE)) __hooks_lid_change_end = .; + __hooks_tablet_mode_change = .; + KEEP(*(.rodata.HOOK_TABLET_MODE_CHANGE)) + __hooks_tablet_mode_change_end = .; + __hooks_pwrbtn_change = .; KEEP(*(.rodata.HOOK_POWER_BUTTON_CHANGE)) __hooks_pwrbtn_change_end = .; diff --git a/include/ec_commands.h b/include/ec_commands.h index c1abb72b6b..74604dcfd7 100644 --- a/include/ec_commands.h +++ b/include/ec_commands.h @@ -2630,6 +2630,7 @@ struct ec_response_get_next_event { /* Switches */ #define EC_MKBP_LID_OPEN 0 +#define EC_MKBP_TABLET_MODE 1 /* Run keyboard factory test scanning */ #define EC_CMD_KEYBOARD_FACTORY_TEST 0x68 diff --git a/include/hooks.h b/include/hooks.h index ae4bfd9732..1c6f5fe274 100644 --- a/include/hooks.h +++ b/include/hooks.h @@ -139,6 +139,13 @@ enum hook_type { HOOK_LID_CHANGE, /* + * Device in tablet mode (base behind lid). + * + * Hook routines are called from the TICK task. + */ + HOOK_TABLET_MODE_CHANGE, + + /* * Power button pressed or released. Based on debounced power button * state, not raw GPIO input. * diff --git a/include/link_defs.h b/include/link_defs.h index 91950811d2..69b964d1d8 100644 --- a/include/link_defs.h +++ b/include/link_defs.h @@ -48,6 +48,8 @@ extern const struct hook_data __hooks_ac_change[]; extern const struct hook_data __hooks_ac_change_end[]; extern const struct hook_data __hooks_lid_change[]; extern const struct hook_data __hooks_lid_change_end[]; +extern const struct hook_data __hooks_tablet_mode_change[]; +extern const struct hook_data __hooks_tablet_mode_change_end[]; extern const struct hook_data __hooks_pwrbtn_change[]; extern const struct hook_data __hooks_pwrbtn_change_end[]; extern const struct hook_data __hooks_charge_state_change[]; |