@@ -9,9 +9,11 @@
#include <common.h>
#include <console.h>
+#include <dm.h>
#include <errno.h>
#include <stdio_dev.h>
#include <input.h>
+#include <keyboard.h>
#include <linux/input.h>
enum {
@@ -236,6 +238,8 @@ int input_getc(struct input_config *config)
static struct input_key_xlate *process_modifier(struct input_config *config,
int key, int release)
{
+ struct udevice *dev = config->dev;
+ struct keyboard_ops *ops = keyboard_get_ops(dev);
struct input_key_xlate *table;
int i;
@@ -277,6 +281,11 @@ static struct input_key_xlate *process_modifier(struct input_config *config,
leds |= INPUT_LED_SCROLL;
config->leds = leds;
config->leds_changed = flip;
+
+ if (ops->update_leds) {
+ if (ops->update_leds(dev, config->leds))
+ debug("Update keyboard's LED failed\n");
+ }
}
}
We should request keyboard to turn on/off its LED when detecting any changes on the LEDs. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> --- drivers/input/input.c | 9 +++++++++ 1 file changed, 9 insertions(+)