From: Bin Meng Date: Thu, 12 Nov 2015 05:33:02 -0800 Subject: [U-Boot] [PATCH 2/6] input: Call keyboard's update_leds() method when the LEDs change In-Reply-To: <1447335186-27731-1-git-send-email-bmeng.cn@gmail.com> References: <1447335186-27731-1-git-send-email-bmeng.cn@gmail.com> Message-ID: <1447335186-27731-2-git-send-email-bmeng.cn@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de We should request keyboard to turn on/off its LED when detecting any changes on the LEDs. Signed-off-by: Bin Meng --- drivers/input/input.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/input/input.c b/drivers/input/input.c index 79edda5..0926de5 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c @@ -9,9 +9,11 @@ #include #include +#include #include #include #include +#include #include 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"); + } } } -- 1.8.2.1