瀏覽代碼

input: Change LED state bits to conform i8042 compatible keyboard

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>
Acked-by: Simon Glass <sjg@chromium.org>
Bin Meng 9 年之前
父節點
當前提交
377a069643
共有 2 個文件被更改,包括 5 次插入5 次删除
  1. 3 3
      drivers/input/input.c
  2. 2 2
      include/input.h

+ 3 - 3
drivers/input/input.c

@@ -19,9 +19,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,

+ 2 - 2
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,
 };
 
 /*