diff options
Diffstat (limited to 'common/mkbp_input_devices.c')
-rw-r--r-- | common/mkbp_input_devices.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/common/mkbp_input_devices.c b/common/mkbp_input_devices.c index 7cba670eb1..6cc277ab98 100644 --- a/common/mkbp_input_devices.c +++ b/common/mkbp_input_devices.c @@ -1,4 +1,4 @@ -/* Copyright 2021 The Chromium OS Authors. All rights reserved. +/* Copyright 2021 The ChromiumOS Authors * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ @@ -20,7 +20,7 @@ #include "tablet_mode.h" #include "util.h" -#define CPRINTS(format, args...) cprints(CC_KEYBOARD, format, ## args) +#define CPRINTS(format, args...) cprints(CC_KEYBOARD, format, ##args) /* Buttons and switch state. */ static uint32_t mkbp_button_state; @@ -69,7 +69,7 @@ void mkbp_button_update(enum keyboard_button_type button, int is_pressed) CPRINTS("mkbp buttons: %x", mkbp_button_state); mkbp_fifo_add(EC_MKBP_EVENT_BUTTON, - (const uint8_t *)&mkbp_button_state); + (const uint8_t *)&mkbp_button_state); }; void mkbp_update_switches(uint32_t sw, int state) @@ -86,10 +86,9 @@ void mkbp_update_switches(uint32_t sw, int state) */ if (mkbp_init_done) mkbp_fifo_add(EC_MKBP_EVENT_SWITCH, - (const uint8_t *)&mkbp_switch_state); + (const uint8_t *)&mkbp_switch_state); } - /*****************************************************************************/ /* Hooks */ @@ -99,8 +98,7 @@ void mkbp_update_switches(uint32_t sw, int state) */ static void keyboard_power_button(void) { - mkbp_button_update(KEYBOARD_BUTTON_POWER, - power_button_is_pressed()); + mkbp_button_update(KEYBOARD_BUTTON_POWER, power_button_is_pressed()); } DECLARE_HOOK(HOOK_POWER_BUTTON_CHANGE, keyboard_power_button, HOOK_PRIO_DEFAULT); @@ -142,7 +140,7 @@ static void mkbp_report_switch_on_init(void) /* All switches initialized, report switch state to AP */ mkbp_init_done = true; mkbp_fifo_add(EC_MKBP_EVENT_SWITCH, - (const uint8_t *)&mkbp_switch_state); + (const uint8_t *)&mkbp_switch_state); } DECLARE_HOOK(HOOK_INIT, mkbp_report_switch_on_init, HOOK_PRIO_LAST); @@ -188,7 +186,7 @@ uint8_t keyboard_cols = KEYBOARD_COLS_MAX; static void simulate_key(int row, int col, int pressed) { if ((simulated_key[col] & BIT(row)) == ((pressed ? 1 : 0) << row)) - return; /* No change */ + return; /* No change */ simulated_key[col] &= ~BIT(row); if (pressed) @@ -197,7 +195,7 @@ static void simulate_key(int row, int col, int pressed) mkbp_fifo_add((uint8_t)EC_MKBP_EVENT_KEY_MATRIX, simulated_key); } -static int command_mkbp_keyboard_press(int argc, char **argv) +static int command_mkbp_keyboard_press(int argc, const char **argv) { if (argc == 1) { int i, j; @@ -239,7 +237,6 @@ static int command_mkbp_keyboard_press(int argc, char **argv) return EC_SUCCESS; } DECLARE_CONSOLE_COMMAND(kbpress, command_mkbp_keyboard_press, - "[col row [0 | 1]]", - "Simulate keypress"); + "[col row [0 | 1]]", "Simulate keypress"); #endif /* !defined(HAS_TASK_KEYSCAN) */ |