diff mbox

[U-Boot,3/6] input: Change LED state bits to conform i8042 compatible keyboard

Message ID 1447335186-27731-3-git-send-email-bmeng.cn@gmail.com
State Accepted
Delegated to: Simon Glass
Headers show

Commit Message

Bin Meng Nov. 12, 2015, 1:33 p.m. UTC
When sending LED update command to an i8042 compatible keyboard,
bit1 is 'Num Lock' and bit2 is 'Caps Lock' in the data byte. But
input library defines bit1 as 'Caps Lock' and bit2 as 'Num Lock'.
This causes a wrong LED to be set on an i8042 compatible keyboard.
Change the LED state bits to be i8042 compatible, and change the
keyboard flags as well.

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

 drivers/input/input.c | 6 +++---
 include/input.h       | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

Comments

Simon Glass Nov. 12, 2015, 7:58 p.m. UTC | #1
On 12 November 2015 at 06:33, Bin Meng <bmeng.cn@gmail.com> wrote:
> When sending LED update command to an i8042 compatible keyboard,
> bit1 is 'Num Lock' and bit2 is 'Caps Lock' in the data byte. But
> input library defines bit1 as 'Caps Lock' and bit2 as 'Num Lock'.
> This causes a wrong LED to be set on an i8042 compatible keyboard.
> Change the LED state bits to be i8042 compatible, and change the
> keyboard flags as well.
>
> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
> ---
>
>  drivers/input/input.c | 6 +++---
>  include/input.h       | 4 ++--
>  2 files changed, 5 insertions(+), 5 deletions(-)

Acked-by: Simon Glass <sjg@chromium.org>
Simon Glass Nov. 14, 2015, 2:05 a.m. UTC | #2
Applied to u-boot-dm, thanks!
diff mbox

Patch

diff --git a/drivers/input/input.c b/drivers/input/input.c
index 0926de5..5c3fad9 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -18,9 +18,9 @@ 
 
 enum {
 	/* These correspond to the lights on the keyboard */
-	FLAG_NUM_LOCK		= 1 << 0,
-	FLAG_CAPS_LOCK		= 1 << 1,
-	FLAG_SCROLL_LOCK	= 1 << 2,
+	FLAG_SCROLL_LOCK	= 1 << 0,
+	FLAG_NUM_LOCK		= 1 << 1,
+	FLAG_CAPS_LOCK		= 1 << 2,
 
 	/* Special flag ORed with key code to indicate release */
 	KEY_RELEASE		= 1 << 15,
diff --git a/include/input.h b/include/input.h
index ad120e4..2902b07 100644
--- a/include/input.h
+++ b/include/input.h
@@ -17,8 +17,8 @@  enum {
 enum {
 	/* Keyboard LEDs */
 	INPUT_LED_SCROLL	= 1 << 0,
-	INPUT_LED_CAPS		= 1 << 1,
-	INPUT_LED_NUM		= 1 << 2,
+	INPUT_LED_NUM		= 1 << 1,
+	INPUT_LED_CAPS		= 1 << 2,
 };
 
 /*