Re: [U-Boot] [PATCH 18/28] input: Support the German keymap

2015-10-18 Thread Simon Glass
Hi Bin,

On 15 September 2015 at 00:12, Bin Meng  wrote:
> Hi Simon,
>
> On Wed, Sep 9, 2015 at 12:32 PM, Simon Glass  wrote:
>> Add support for the German keymap, taken from i8042.c. This can be selected
>> when the input library it initialised.
>>
>> Signed-off-by: Simon Glass 
>> ---
>>
>>  board/kosagi/novena/novena.c |  2 +-
>>  drivers/input/cros_ec_keyb.c |  2 +-
>>  drivers/input/input.c| 82 
>> 
>>  drivers/input/tegra-kbc.c|  2 +-
>>  include/input.h  |  3 +-
>>  5 files changed, 80 insertions(+), 11 deletions(-)
>>
>> diff --git a/board/kosagi/novena/novena.c b/board/kosagi/novena/novena.c
>> index 48cbb0f..0b61365 100644
>> --- a/board/kosagi/novena/novena.c
>> +++ b/board/kosagi/novena/novena.c
>> @@ -88,7 +88,7 @@ int drv_keyboard_init(void)
>> debug("%s: Cannot set up input\n", __func__);
>> return -1;
>> }
>> -   input_add_tables(_input);
>> +   input_add_tables(_input, false);
>> button_input.read_keys = novena_gpio_button_read_keys;
>>
>> error = input_stdio_register();
>> diff --git a/drivers/input/cros_ec_keyb.c b/drivers/input/cros_ec_keyb.c
>> index fe5caea..9bc4555 100644
>> --- a/drivers/input/cros_ec_keyb.c
>> +++ b/drivers/input/cros_ec_keyb.c
>> @@ -211,7 +211,7 @@ static int cros_ec_kbd_probe(struct udevice *dev)
>>
>> priv->input = input;
>> input->dev = dev;
>> -   input_add_tables(input);
>> +   input_add_tables(input, false);
>> input->read_keys = cros_ec_kbc_check;
>> strcpy(sdev->name, "cros-ec-keyb");
>>
>> diff --git a/drivers/input/input.c b/drivers/input/input.c
>> index c488f3a..a54449e 100644
>> --- a/drivers/input/input.c
>> +++ b/drivers/input/input.c
>> @@ -78,6 +78,60 @@ static unsigned char kbd_ctrl_xlate[] = {
>> '\r', 0xff, '/',  '*',
>>  };
>>
>> +static const uchar kbd_plain_xlate_german[] = {
>> +   0xff, 0x1b,  '1',  '2',  '3',  '4',  '5',  '6', /* scan 00-07 */
>> +'7',  '8',  '9',  '0', 0xe1, '\'', 0x08, '\t', /* scan 08-0F */
>> +'q',  'w',  'e',  'r',  't',  'z',  'u',  'i', /* scan 10-17 */
>> +'o',  'p', 0x81,  '+', '\r', 0xff,  'a',  's', /* scan 18-1F */
>> +'d',  'f',  'g',  'h',  'j',  'k',  'l', 0x94, /* scan 20-27 */
>> +   0x84,  '^', 0xff,  '#',  'y',  'x',  'c',  'v', /* scan 28-2F */
>> +'b',  'n',  'm',  ',',  '.',  '-', 0xff,  '*', /* scan 30-37 */
>> +' ',  ' ', 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* scan 38-3F */
>> +   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,  '7', /* scan 40-47 */
>> +'8',  '9',  '-',  '4',  '5',  '6',  '+',  '1', /* scan 48-4F */
>> +'2',  '3',  '0',  ',', 0xff, 0xff,  '<', 0xff, /* scan 50-57 */
>> +   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* scan 58-5F */
>> +   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* scan 60-67 */
>> +   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* scan 68-6F */
>> +   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* scan 70-77 */
>> +   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* scan 78-7F */
>> +   '\r', 0xff,  '/',  '*',
>> +};
>> +
>> +static unsigned char kbd_shift_xlate_german[] = {
>> +  0xff, 0x1b,  '!',  '"', 0x15,  '$',  '%',  '&', /* scan 00-07 */
>> +'/',  '(',  ')',  '=',  '?',  '`', 0x08, '\t', /* scan 08-0F */
>> +'Q',  'W',  'E',  'R',  'T',  'Z',  'U',  'I', /* scan 10-17 */
>> +'O',  'P', 0x9a,  '*', '\r', 0xff,  'A',  'S', /* scan 18-1F */
>> +'D',  'F',  'G',  'H',  'J',  'K',  'L', 0x99, /* scan 20-27 */
>> +   0x8e, 0xf8, 0xff, '\'',  'Y',  'X',  'C',  'V', /* scan 28-2F */
>> +'B',  'N',  'M',  ';',  ':',  '_', 0xff,  '*', /* scan 30-37 */
>> +' ',  ' ', 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* scan 38-3F */
>> +   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,  '7', /* scan 40-47 */
>> +'8',  '9',  '-',  '4',  '5',  '6',  '+',  '1', /* scan 48-4F */
>> +'2',  '3',  '0',  ',', 0xff, 0xff,  '>', 0xff, /* scan 50-57 */
>> +   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* scan 58-5F */
>> +   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* scan 60-67 */
>> +   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* scan 68-6F */
>> +   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* scan 70-77 */
>> +   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* scan 78-7F */
>> +   '\r', 0xff,  '/',  '*',
>> +};
>> +
>> +static unsigned char kbd_right_alt_xlate_german[] = {
>> +   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* scan 00-07 */
>> +'{',  '[',  ']',  '}', '\\', 0xff, 0xff, 0xff, /* scan 08-0F */
>> +'@', 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* scan 10-17 */
>> +   0xff, 0xff, 0xff,  '~', 0xff, 0xff, 0xff, 0xff, /* scan 18-1F */
>> +   0xff, 0xff, 0xff, 0xff, 0xff, 

Re: [U-Boot] [PATCH 18/28] input: Support the German keymap

2015-09-15 Thread Bin Meng
Hi Simon,

On Wed, Sep 9, 2015 at 12:32 PM, Simon Glass  wrote:
> Add support for the German keymap, taken from i8042.c. This can be selected
> when the input library it initialised.
>
> Signed-off-by: Simon Glass 
> ---
>
>  board/kosagi/novena/novena.c |  2 +-
>  drivers/input/cros_ec_keyb.c |  2 +-
>  drivers/input/input.c| 82 
> 
>  drivers/input/tegra-kbc.c|  2 +-
>  include/input.h  |  3 +-
>  5 files changed, 80 insertions(+), 11 deletions(-)
>
> diff --git a/board/kosagi/novena/novena.c b/board/kosagi/novena/novena.c
> index 48cbb0f..0b61365 100644
> --- a/board/kosagi/novena/novena.c
> +++ b/board/kosagi/novena/novena.c
> @@ -88,7 +88,7 @@ int drv_keyboard_init(void)
> debug("%s: Cannot set up input\n", __func__);
> return -1;
> }
> -   input_add_tables(_input);
> +   input_add_tables(_input, false);
> button_input.read_keys = novena_gpio_button_read_keys;
>
> error = input_stdio_register();
> diff --git a/drivers/input/cros_ec_keyb.c b/drivers/input/cros_ec_keyb.c
> index fe5caea..9bc4555 100644
> --- a/drivers/input/cros_ec_keyb.c
> +++ b/drivers/input/cros_ec_keyb.c
> @@ -211,7 +211,7 @@ static int cros_ec_kbd_probe(struct udevice *dev)
>
> priv->input = input;
> input->dev = dev;
> -   input_add_tables(input);
> +   input_add_tables(input, false);
> input->read_keys = cros_ec_kbc_check;
> strcpy(sdev->name, "cros-ec-keyb");
>
> diff --git a/drivers/input/input.c b/drivers/input/input.c
> index c488f3a..a54449e 100644
> --- a/drivers/input/input.c
> +++ b/drivers/input/input.c
> @@ -78,6 +78,60 @@ static unsigned char kbd_ctrl_xlate[] = {
> '\r', 0xff, '/',  '*',
>  };
>
> +static const uchar kbd_plain_xlate_german[] = {
> +   0xff, 0x1b,  '1',  '2',  '3',  '4',  '5',  '6', /* scan 00-07 */
> +'7',  '8',  '9',  '0', 0xe1, '\'', 0x08, '\t', /* scan 08-0F */
> +'q',  'w',  'e',  'r',  't',  'z',  'u',  'i', /* scan 10-17 */
> +'o',  'p', 0x81,  '+', '\r', 0xff,  'a',  's', /* scan 18-1F */
> +'d',  'f',  'g',  'h',  'j',  'k',  'l', 0x94, /* scan 20-27 */
> +   0x84,  '^', 0xff,  '#',  'y',  'x',  'c',  'v', /* scan 28-2F */
> +'b',  'n',  'm',  ',',  '.',  '-', 0xff,  '*', /* scan 30-37 */
> +' ',  ' ', 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* scan 38-3F */
> +   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,  '7', /* scan 40-47 */
> +'8',  '9',  '-',  '4',  '5',  '6',  '+',  '1', /* scan 48-4F */
> +'2',  '3',  '0',  ',', 0xff, 0xff,  '<', 0xff, /* scan 50-57 */
> +   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* scan 58-5F */
> +   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* scan 60-67 */
> +   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* scan 68-6F */
> +   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* scan 70-77 */
> +   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* scan 78-7F */
> +   '\r', 0xff,  '/',  '*',
> +};
> +
> +static unsigned char kbd_shift_xlate_german[] = {
> +  0xff, 0x1b,  '!',  '"', 0x15,  '$',  '%',  '&', /* scan 00-07 */
> +'/',  '(',  ')',  '=',  '?',  '`', 0x08, '\t', /* scan 08-0F */
> +'Q',  'W',  'E',  'R',  'T',  'Z',  'U',  'I', /* scan 10-17 */
> +'O',  'P', 0x9a,  '*', '\r', 0xff,  'A',  'S', /* scan 18-1F */
> +'D',  'F',  'G',  'H',  'J',  'K',  'L', 0x99, /* scan 20-27 */
> +   0x8e, 0xf8, 0xff, '\'',  'Y',  'X',  'C',  'V', /* scan 28-2F */
> +'B',  'N',  'M',  ';',  ':',  '_', 0xff,  '*', /* scan 30-37 */
> +' ',  ' ', 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* scan 38-3F */
> +   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,  '7', /* scan 40-47 */
> +'8',  '9',  '-',  '4',  '5',  '6',  '+',  '1', /* scan 48-4F */
> +'2',  '3',  '0',  ',', 0xff, 0xff,  '>', 0xff, /* scan 50-57 */
> +   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* scan 58-5F */
> +   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* scan 60-67 */
> +   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* scan 68-6F */
> +   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* scan 70-77 */
> +   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* scan 78-7F */
> +   '\r', 0xff,  '/',  '*',
> +};
> +
> +static unsigned char kbd_right_alt_xlate_german[] = {
> +   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* scan 00-07 */
> +'{',  '[',  ']',  '}', '\\', 0xff, 0xff, 0xff, /* scan 08-0F */
> +'@', 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* scan 10-17 */
> +   0xff, 0xff, 0xff,  '~', 0xff, 0xff, 0xff, 0xff, /* scan 18-1F */
> +   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* scan 20-27 */
> +   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* scan 28-2F */
> +   0xff, 0xff, 0xe6, 0xff, 0xff, 0xff, 0xff, 0xff, /* scan 

[U-Boot] [PATCH 18/28] input: Support the German keymap

2015-09-08 Thread Simon Glass
Add support for the German keymap, taken from i8042.c. This can be selected
when the input library it initialised.

Signed-off-by: Simon Glass 
---

 board/kosagi/novena/novena.c |  2 +-
 drivers/input/cros_ec_keyb.c |  2 +-
 drivers/input/input.c| 82 
 drivers/input/tegra-kbc.c|  2 +-
 include/input.h  |  3 +-
 5 files changed, 80 insertions(+), 11 deletions(-)

diff --git a/board/kosagi/novena/novena.c b/board/kosagi/novena/novena.c
index 48cbb0f..0b61365 100644
--- a/board/kosagi/novena/novena.c
+++ b/board/kosagi/novena/novena.c
@@ -88,7 +88,7 @@ int drv_keyboard_init(void)
debug("%s: Cannot set up input\n", __func__);
return -1;
}
-   input_add_tables(_input);
+   input_add_tables(_input, false);
button_input.read_keys = novena_gpio_button_read_keys;
 
error = input_stdio_register();
diff --git a/drivers/input/cros_ec_keyb.c b/drivers/input/cros_ec_keyb.c
index fe5caea..9bc4555 100644
--- a/drivers/input/cros_ec_keyb.c
+++ b/drivers/input/cros_ec_keyb.c
@@ -211,7 +211,7 @@ static int cros_ec_kbd_probe(struct udevice *dev)
 
priv->input = input;
input->dev = dev;
-   input_add_tables(input);
+   input_add_tables(input, false);
input->read_keys = cros_ec_kbc_check;
strcpy(sdev->name, "cros-ec-keyb");
 
diff --git a/drivers/input/input.c b/drivers/input/input.c
index c488f3a..a54449e 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -78,6 +78,60 @@ static unsigned char kbd_ctrl_xlate[] = {
'\r', 0xff, '/',  '*',
 };
 
+static const uchar kbd_plain_xlate_german[] = {
+   0xff, 0x1b,  '1',  '2',  '3',  '4',  '5',  '6', /* scan 00-07 */
+'7',  '8',  '9',  '0', 0xe1, '\'', 0x08, '\t', /* scan 08-0F */
+'q',  'w',  'e',  'r',  't',  'z',  'u',  'i', /* scan 10-17 */
+'o',  'p', 0x81,  '+', '\r', 0xff,  'a',  's', /* scan 18-1F */
+'d',  'f',  'g',  'h',  'j',  'k',  'l', 0x94, /* scan 20-27 */
+   0x84,  '^', 0xff,  '#',  'y',  'x',  'c',  'v', /* scan 28-2F */
+'b',  'n',  'm',  ',',  '.',  '-', 0xff,  '*', /* scan 30-37 */
+' ',  ' ', 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* scan 38-3F */
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,  '7', /* scan 40-47 */
+'8',  '9',  '-',  '4',  '5',  '6',  '+',  '1', /* scan 48-4F */
+'2',  '3',  '0',  ',', 0xff, 0xff,  '<', 0xff, /* scan 50-57 */
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* scan 58-5F */
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* scan 60-67 */
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* scan 68-6F */
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* scan 70-77 */
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* scan 78-7F */
+   '\r', 0xff,  '/',  '*',
+};
+
+static unsigned char kbd_shift_xlate_german[] = {
+  0xff, 0x1b,  '!',  '"', 0x15,  '$',  '%',  '&', /* scan 00-07 */
+'/',  '(',  ')',  '=',  '?',  '`', 0x08, '\t', /* scan 08-0F */
+'Q',  'W',  'E',  'R',  'T',  'Z',  'U',  'I', /* scan 10-17 */
+'O',  'P', 0x9a,  '*', '\r', 0xff,  'A',  'S', /* scan 18-1F */
+'D',  'F',  'G',  'H',  'J',  'K',  'L', 0x99, /* scan 20-27 */
+   0x8e, 0xf8, 0xff, '\'',  'Y',  'X',  'C',  'V', /* scan 28-2F */
+'B',  'N',  'M',  ';',  ':',  '_', 0xff,  '*', /* scan 30-37 */
+' ',  ' ', 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* scan 38-3F */
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,  '7', /* scan 40-47 */
+'8',  '9',  '-',  '4',  '5',  '6',  '+',  '1', /* scan 48-4F */
+'2',  '3',  '0',  ',', 0xff, 0xff,  '>', 0xff, /* scan 50-57 */
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* scan 58-5F */
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* scan 60-67 */
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* scan 68-6F */
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* scan 70-77 */
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* scan 78-7F */
+   '\r', 0xff,  '/',  '*',
+};
+
+static unsigned char kbd_right_alt_xlate_german[] = {
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* scan 00-07 */
+'{',  '[',  ']',  '}', '\\', 0xff, 0xff, 0xff, /* scan 08-0F */
+'@', 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* scan 10-17 */
+   0xff, 0xff, 0xff,  '~', 0xff, 0xff, 0xff, 0xff, /* scan 18-1F */
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* scan 20-27 */
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* scan 28-2F */
+   0xff, 0xff, 0xe6, 0xff, 0xff, 0xff, 0xff, 0xff, /* scan 30-37 */
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* scan 38-3F */
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* scan 40-47 */
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* scan 48-4F */
+   0xff, 0xff, 0xff, 0xff, 0xff,