projects
/
oweals
/
u-boot.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rockchip: use dummy byte only enable OF_PLATDATA
[oweals/u-boot.git]
/
drivers
/
input
/
input.c
diff --git
a/drivers/input/input.c
b/drivers/input/input.c
index 954ecec595efc0be4a3c82d2492ed8628c0870a3..011667fedda4269a26dedfa8b1f83a9486086519 100644
(file)
--- a/
drivers/input/input.c
+++ b/
drivers/input/input.c
@@
-8,16
+8,21
@@
*/
#include <common.h>
*/
#include <common.h>
+#include <console.h>
+#include <dm.h>
#include <errno.h>
#include <stdio_dev.h>
#include <input.h>
#include <errno.h>
#include <stdio_dev.h>
#include <input.h>
+#ifdef CONFIG_DM_KEYBOARD
+#include <keyboard.h>
+#endif
#include <linux/input.h>
enum {
/* These correspond to the lights on the keyboard */
#include <linux/input.h>
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,
/* Special flag ORed with key code to indicate release */
KEY_RELEASE = 1 << 15,
@@
-235,6
+240,10
@@
int input_getc(struct input_config *config)
static struct input_key_xlate *process_modifier(struct input_config *config,
int key, int release)
{
static struct input_key_xlate *process_modifier(struct input_config *config,
int key, int release)
{
+#ifdef CONFIG_DM_KEYBOARD
+ struct udevice *dev = config->dev;
+ struct keyboard_ops *ops = keyboard_get_ops(dev);
+#endif
struct input_key_xlate *table;
int i;
struct input_key_xlate *table;
int i;
@@
-267,7
+276,7
@@
static struct input_key_xlate *process_modifier(struct input_config *config,
if (flip != -1) {
int leds = 0;
if (flip != -1) {
int leds = 0;
- config->
led
s ^= flip;
+ config->
flag
s ^= flip;
if (config->flags & FLAG_NUM_LOCK)
leds |= INPUT_LED_NUM;
if (config->flags & FLAG_CAPS_LOCK)
if (config->flags & FLAG_NUM_LOCK)
leds |= INPUT_LED_NUM;
if (config->flags & FLAG_CAPS_LOCK)
@@
-276,6
+285,13
@@
static struct input_key_xlate *process_modifier(struct input_config *config,
leds |= INPUT_LED_SCROLL;
config->leds = leds;
config->leds_changed = flip;
leds |= INPUT_LED_SCROLL;
config->leds = leds;
config->leds_changed = flip;
+
+#ifdef CONFIG_DM_KEYBOARD
+ if (ops->update_leds) {
+ if (ops->update_leds(dev, config->leds))
+ debug("Update keyboard's LED failed\n");
+ }
+#endif
}
}
}
}
@@
-464,6
+480,12
@@
static int input_keycodes_to_ascii(struct input_config *config,
if ((config->flags & FLAG_CAPS_LOCK) &&
ch >= 'a' && ch <= 'z')
ch -= 'a' - 'A';
if ((config->flags & FLAG_CAPS_LOCK) &&
ch >= 'a' && ch <= 'z')
ch -= 'a' - 'A';
+ /* ban digit numbers if 'Num Lock' is not on */
+ if (!(config->flags & FLAG_NUM_LOCK)) {
+ if (key >= KEY_KP7 && key <= KEY_KPDOT &&
+ key != KEY_KPMINUS && key != KEY_KPPLUS)
+ ch = 0xff;
+ }
if (ch_count < max_chars && ch != 0xff)
output_ch[ch_count++] = (uchar)ch;
} else {
if (ch_count < max_chars && ch != 0xff)
output_ch[ch_count++] = (uchar)ch;
} else {