All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bin Meng <bmeng.cn@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 04/12] input: Allow updating of keyboard LEDs
Date: Thu, 12 Nov 2015 21:50:46 +0800	[thread overview]
Message-ID: <CAEUhbmWJoSiP2_5NVJPZjyhRhT_kvJG0qprN85ucE_k-UbfKgA@mail.gmail.com> (raw)
In-Reply-To: <1447261548-14304-5-git-send-email-sjg@chromium.org>

On Thu, Nov 12, 2015 at 1:05 AM, Simon Glass <sjg@chromium.org> wrote:
> Add a function which returns a new keyboard LED value when the LEDs need
> updating.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>
> Changes in v3: None
> Changes in v2: None
>
>  drivers/input/input.c |  9 +++++++++
>  include/input.h       | 14 +++++++++++++-
>  2 files changed, 22 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/input/input.c b/drivers/input/input.c
> index a8a15c9..bf1acdc 100644
> --- a/drivers/input/input.c
> +++ b/drivers/input/input.c
> @@ -276,6 +276,7 @@ static struct input_key_xlate *process_modifier(struct input_config *config,
>                         if (config->flags & FLAG_SCROLL_LOCK)
>                                 leds |= INPUT_LED_SCROLL;
>                         config->leds = leds;
> +                       config->leds_changed = flip;
>                 }
>         }
>
> @@ -587,6 +588,14 @@ void input_allow_repeats(struct input_config *config, bool allow_repeats)
>         config->allow_repeats = allow_repeats;
>  }
>
> +int input_leds_changed(struct input_config *config)
> +{
> +       if (config->leds_changed)
> +               return config->leds;
> +
> +       return -1;
> +}
> +
>  int input_add_tables(struct input_config *config, bool german)
>  {
>         struct kbd_entry *entry;
> diff --git a/include/input.h b/include/input.h
> index c1af259..ad120e4 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.
> --

Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

  reply	other threads:[~2015-11-12 13:50 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-11 17:05 [U-Boot] [PATCH v3 00/12] dm: input: Move keyboard drivers to driver model Simon Glass
2015-11-11 17:05 ` [U-Boot] [PATCH v3 01/12] input: Support the German keymap Simon Glass
2015-11-12  3:51   ` Bin Meng
2015-11-14  2:04     ` Simon Glass
2015-11-11 17:05 ` [U-Boot] [PATCH v3 02/12] input: Adjust structure of code in process_modifier() Simon Glass
2015-11-12 13:39   ` Bin Meng
2015-11-14  2:04     ` Simon Glass
2015-11-11 17:05 ` [U-Boot] [PATCH v3 03/12] input: Handle caps lock Simon Glass
2015-11-12 13:50   ` Bin Meng
2015-11-14  2:04     ` Simon Glass
2015-11-11 17:05 ` [U-Boot] [PATCH v3 04/12] input: Allow updating of keyboard LEDs Simon Glass
2015-11-12 13:50   ` Bin Meng [this message]
2015-11-14  2:04     ` Simon Glass
2015-11-11 17:05 ` [U-Boot] [PATCH v3 05/12] input: i8042: Convert to use the input library Simon Glass
2015-11-12 13:50   ` Bin Meng
2015-11-14  2:04     ` Simon Glass
2015-11-11 17:05 ` [U-Boot] [PATCH v3 06/12] input: Add a Kconfig option for the i8042 keyboard Simon Glass
2015-11-14  2:04   ` Simon Glass
2015-11-11 17:05 ` [U-Boot] [PATCH v3 07/12] x86: Add an i8042 device for boards that have it Simon Glass
2015-11-14  2:04   ` Simon Glass
2015-11-11 17:05 ` [U-Boot] [PATCH v3 08/12] Drop CONFIG_ISA_KEYBOARD Simon Glass
2015-11-14  2:04   ` Simon Glass
2015-11-11 17:05 ` [U-Boot] [PATCH v3 09/12] input: Convert i8042 to driver model Simon Glass
2015-11-12 13:50   ` Bin Meng
2015-11-14  2:04     ` Simon Glass
2015-11-11 17:05 ` [U-Boot] [PATCH v3 10/12] i8042: Handle a duplicate power-on-reset response Simon Glass
2015-11-14  2:04   ` Simon Glass
2015-11-11 17:05 ` [U-Boot] [PATCH v3 11/12] video: input: Clean up after i8042 conversion Simon Glass
2015-11-14  2:04   ` Simon Glass
2015-11-11 17:05 ` [U-Boot] [PATCH v3 12/12] input: Convert 'keyboard' driver to use input library Simon Glass
2015-11-14  2:04   ` Simon Glass
2015-11-11 21:56 ` [U-Boot] [PATCH v3 00/12] dm: input: Move keyboard drivers to driver model Simon Glass
2015-11-12  3:56   ` Bin Meng
2015-11-12 13:33     ` Bin Meng
2015-11-12 19:57       ` Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAEUhbmWJoSiP2_5NVJPZjyhRhT_kvJG0qprN85ucE_k-UbfKgA@mail.gmail.com \
    --to=bmeng.cn@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.