summaryrefslogtreecommitdiff
path: root/include/input.h
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2015-11-11 10:05:40 -0700
committerSimon Glass <sjg@chromium.org>2015-11-19 20:13:41 -0700
commit3b5f6f5001d0f3dfde98ccc6b9350fe74dac41f8 (patch)
tree114c3fda09983d90591ee629923a934a390d196a /include/input.h
parentba42034267050d1a41479ba133d1c5b8679397f7 (diff)
downloadu-boot-3b5f6f5001d0f3dfde98ccc6b9350fe74dac41f8.tar.gz
u-boot-3b5f6f5001d0f3dfde98ccc6b9350fe74dac41f8.tar.bz2
u-boot-3b5f6f5001d0f3dfde98ccc6b9350fe74dac41f8.zip
input: Allow updating of keyboard LEDs
Add a function which returns a new keyboard LED value when the LEDs need updating. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'include/input.h')
-rw-r--r--include/input.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/include/input.h b/include/input.h
index c1af259e26..ad120e47f5 100644
--- a/include/input.h
+++ b/include/input.h
@@ -43,7 +43,8 @@ struct input_config {
/* Which modifiers are active (1 bit for each MOD_... value) */
uchar modifiers;
uchar flags; /* active state keys (FLAGS_...) */
- uchar leds; /* active LEDS (INPUT_LED_...) */
+ uchar leds; /* active LEDs (INPUT_LED_...) */
+ uchar leds_changed; /* LEDs that just changed */
uchar num_tables; /* number of modifier tables */
int prev_keycodes[INPUT_BUFFER_LEN]; /* keys held last time */
int num_prev_keycodes; /* number of prev keys */
@@ -162,6 +163,17 @@ void input_set_delays(struct input_config *config, int repeat_delay_ms,
void input_allow_repeats(struct input_config *config, bool allow_repeats);
/**
+ * Check if keyboard LEDs need to be updated
+ *
+ * This can be called after input_tstc() to see if keyboard LEDs need
+ * updating.
+ *
+ * @param config Input state
+ * @return -1 if no LEDs need updating, other value if they do
+ */
+int input_leds_changed(struct input_config *config);
+
+/**
* Set up the key map tables
*
* This must be called after input_init() or keycode decoding will not work.