Re: [U-Boot] [PATCH v2 00/28] dm: input: Move keyboard drivers to driver model

2015-10-27 Thread Bin Meng
Hi Simon,

On Tue, Oct 27, 2015 at 2:40 PM, Bin Meng  wrote:
> Hi Simon,
>
> On Mon, Oct 19, 2015 at 11:17 AM, Simon Glass  wrote:
>> This series adds a new uclass for keyboards and converts some drivers
>> over to use it.
>>
>> This series includes some work to remove code duplication in the keyboard
>> drivers by updating them to use the input library (input.c). This unifies
>> the keycode decoding logic in one place. In order to do this some
>> enhancements are needed to the input library and these are also included.
>>
>> The cros_ec and tegra_kbc drivers are converted to use driver model.
>>
>> The i8042 driver is converted also, after various tidy-ups. The driver has
>> some strange interactions with the cfb_console driver. This is removed in
>> this series which is possible because the only user is x86. Some i8042
>> features have been dropped (the only deliberate one is the flashing cursor
>> which does not seem to be used by any board).
>>
>> Also the i8042 driver currently has its own keycode-decoding logic. This
>> series removes it in favour of the input library. Therefore testing of this
>> new driver would be appreciated. So far I have only been able to test on
>> link, which does not have a full keyboard. Also, while German keyboard
>> support is implemented, I am unable to test that either.
>>
>> These changes can be considered the first step towards moving stdio to
>> driver model. For that to be useful we need to convert LCD and video also.
>>
>> Note: This series is missing the code to call the update_leds() method when
>> the LEDs change. This needs to be added to keyboard_tstc() and
>> keyboard_getc(). If someone is able to test this I can send a patch for that
>> also.
>
> With the v2 patch, the i8042 keyboard works on Intel Crown Bay.
> Besides the LEDs changes, I found the 'Caps Lock' and 'Num Lock' does
> not work. Is this related to missing update_leds()?

To be more specific, the symptom is:

After pressing 'Caps Lock', the 'Caps Lock' LED does not light up.
Pressing 'A' shows 'a' on the U-Boot serial console. After pressing
'Num Lock', the 'Num Lock' LED does not light up. Pressing any of the
the digit numbers (0-9) buttons on the numeric keypad can show the
numbers on the U-Boot serial console. I believe the correct behavior
is that when 'Num Lock' is not lighted, pressing (0-9) should return
nothing.

>
>>
>> This series is available at u-boot-dm branch input-working.
>>
>
> [snip]
>

Regards,
Bin
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 00/28] dm: input: Move keyboard drivers to driver model

2015-10-27 Thread Bin Meng
Hi Simon,

On Mon, Oct 19, 2015 at 11:17 AM, Simon Glass  wrote:
> This series adds a new uclass for keyboards and converts some drivers
> over to use it.
>
> This series includes some work to remove code duplication in the keyboard
> drivers by updating them to use the input library (input.c). This unifies
> the keycode decoding logic in one place. In order to do this some
> enhancements are needed to the input library and these are also included.
>
> The cros_ec and tegra_kbc drivers are converted to use driver model.
>
> The i8042 driver is converted also, after various tidy-ups. The driver has
> some strange interactions with the cfb_console driver. This is removed in
> this series which is possible because the only user is x86. Some i8042
> features have been dropped (the only deliberate one is the flashing cursor
> which does not seem to be used by any board).
>
> Also the i8042 driver currently has its own keycode-decoding logic. This
> series removes it in favour of the input library. Therefore testing of this
> new driver would be appreciated. So far I have only been able to test on
> link, which does not have a full keyboard. Also, while German keyboard
> support is implemented, I am unable to test that either.
>
> These changes can be considered the first step towards moving stdio to
> driver model. For that to be useful we need to convert LCD and video also.
>
> Note: This series is missing the code to call the update_leds() method when
> the LEDs change. This needs to be added to keyboard_tstc() and
> keyboard_getc(). If someone is able to test this I can send a patch for that
> also.

With the v2 patch, the i8042 keyboard works on Intel Crown Bay.
Besides the LEDs changes, I found the 'Caps Lock' and 'Num Lock' does
not work. Is this related to missing update_leds()?

>
> This series is available at u-boot-dm branch input-working.
>

[snip]

Regards,
Bin
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 00/28] dm: input: Move keyboard drivers to driver model

2015-10-27 Thread Simon Glass
Hi Bin,

On 27 October 2015 at 01:20, Bin Meng  wrote:
> Hi Simon,
>
> On Tue, Oct 27, 2015 at 2:40 PM, Bin Meng  wrote:
>> Hi Simon,
>>
>> On Mon, Oct 19, 2015 at 11:17 AM, Simon Glass  wrote:
>>> This series adds a new uclass for keyboards and converts some drivers
>>> over to use it.
>>>
>>> This series includes some work to remove code duplication in the keyboard
>>> drivers by updating them to use the input library (input.c). This unifies
>>> the keycode decoding logic in one place. In order to do this some
>>> enhancements are needed to the input library and these are also included.
>>>
>>> The cros_ec and tegra_kbc drivers are converted to use driver model.
>>>
>>> The i8042 driver is converted also, after various tidy-ups. The driver has
>>> some strange interactions with the cfb_console driver. This is removed in
>>> this series which is possible because the only user is x86. Some i8042
>>> features have been dropped (the only deliberate one is the flashing cursor
>>> which does not seem to be used by any board).
>>>
>>> Also the i8042 driver currently has its own keycode-decoding logic. This
>>> series removes it in favour of the input library. Therefore testing of this
>>> new driver would be appreciated. So far I have only been able to test on
>>> link, which does not have a full keyboard. Also, while German keyboard
>>> support is implemented, I am unable to test that either.
>>>
>>> These changes can be considered the first step towards moving stdio to
>>> driver model. For that to be useful we need to convert LCD and video also.
>>>
>>> Note: This series is missing the code to call the update_leds() method when
>>> the LEDs change. This needs to be added to keyboard_tstc() and
>>> keyboard_getc(). If someone is able to test this I can send a patch for that
>>> also.
>>
>> With the v2 patch, the i8042 keyboard works on Intel Crown Bay.
>> Besides the LEDs changes, I found the 'Caps Lock' and 'Num Lock' does
>> not work. Is this related to missing update_leds()?
>
> To be more specific, the symptom is:
>
> After pressing 'Caps Lock', the 'Caps Lock' LED does not light up.
> Pressing 'A' shows 'a' on the U-Boot serial console. After pressing
> 'Num Lock', the 'Num Lock' LED does not light up. Pressing any of the
> the digit numbers (0-9) buttons on the numeric keypad can show the
> numbers on the U-Boot serial console. I believe the correct behavior
> is that when 'Num Lock' is not lighted, pressing (0-9) should return
> nothing.

I'm going to have another look at this but I don't have hardware to
test with. My current plan is to merge the first half of the patches
and then come back to you help resolve this bug.

>
>>
>>>
>>> This series is available at u-boot-dm branch input-working.
>>>
>>
>> [snip]
>>
>
> Regards,
> Bin

Regards,
Simon
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 00/28] dm: input: Move keyboard drivers to driver model

2015-10-18 Thread Simon Glass
This series adds a new uclass for keyboards and converts some drivers
over to use it.

This series includes some work to remove code duplication in the keyboard
drivers by updating them to use the input library (input.c). This unifies
the keycode decoding logic in one place. In order to do this some
enhancements are needed to the input library and these are also included.

The cros_ec and tegra_kbc drivers are converted to use driver model.

The i8042 driver is converted also, after various tidy-ups. The driver has
some strange interactions with the cfb_console driver. This is removed in
this series which is possible because the only user is x86. Some i8042
features have been dropped (the only deliberate one is the flashing cursor
which does not seem to be used by any board).

Also the i8042 driver currently has its own keycode-decoding logic. This
series removes it in favour of the input library. Therefore testing of this
new driver would be appreciated. So far I have only been able to test on
link, which does not have a full keyboard. Also, while German keyboard
support is implemented, I am unable to test that either.

These changes can be considered the first step towards moving stdio to
driver model. For that to be useful we need to convert LCD and video also.

Note: This series is missing the code to call the update_leds() method when
the LEDs change. This needs to be added to keyboard_tstc() and
keyboard_getc(). If someone is able to test this I can send a patch for that
also.

This series is available at u-boot-dm branch input-working.

Changes in v2:
- Add more debug info to input_init() for when it fails
- Support driver's tstc() and getc() methods in the uclass
- Update the comment for the tstc() method to indicate that an error can occur
- Add error checking to input_add_tables()
- Update commit message to explain what RTC means
- Fix extra space in commit message
- Update input_add_tables() to add error checking
- Convert two multi-line comments to single-line comments
- Correct call to input_init()
- Drop CONFIG_VGA_AS_SINGLE_DEVICE from all x86 board config files
- Use device tree to handle this quirk

Simon Glass (28):
  dm: input: Create a keyboard uclass
  input: Add a device pointer to the input config
  input: Return -ENOSPC when there is not space
  input: Add the keycode translation tables separately
  cros_ec: Use udevice instead of cros_ec_dev for keyboard functions
  dm: stdio: Plumb in the new keyboard uclass
  dm: tegra: Convert keyboard driver to driver model
  dm: cros_ec: Convert cros_ec keyboard driver to driver model
  video: Drop unused console functions
  i8042: Use functions to handle register access
  i8042: Adjust kbd_reset() to collect all failures
  i8042: Adjust keyboard init to assume success
  input: Correct keycode for Ctrl-Y
  input: Add a few more keyboard keycodes
  input: Add a function to add a keycode to the existing set
  input: Allow repeat filtering to be disabled
  input: Support the German keymap
  input: Adjust structure of code in process_modifier()
  input: Handle caps lock
  input: Allow updating of keyboard LEDs
  input: i8042: Convert to use the input library
  input: Add a Kconfig option for the i8042 keyboard
  x86: Add an i8042 device for boards that have it
  Drop CONFIG_ISA_KEYBOARD
  input: Convert i8042 to driver model
  i8042: Handle a duplicate power-on-reset response
  video: input: Clean up after i8042 conversion
  input: Convert 'keyboard' driver to use input library

 README   |  42 +-
 arch/arm/Kconfig |   1 +
 arch/arm/mach-tegra/Kconfig  |   1 +
 arch/sandbox/Kconfig |   3 +
 arch/x86/Kconfig |   6 +
 arch/x86/dts/bayleybay.dts   |   1 +
 arch/x86/dts/chromebook_link.dts |   5 +
 arch/x86/dts/keyboard.dtsi   |   5 +
 board/kosagi/novena/novena.c |   1 +
 board/mpl/pip405/README  |   4 -
 common/stdio.c   |  31 +-
 common/usb_kbd.c |   6 -
 doc/device-tree-bindings/input/i8042.txt |  10 +
 drivers/input/Kconfig|  19 +
 drivers/input/Makefile   |   4 +-
 drivers/input/cros_ec_keyb.c | 147 +++
 drivers/input/i8042.c| 647 ---
 drivers/input/input.c| 222 +--
 drivers/input/keyboard-uclass.c  |  91 +
 drivers/input/keyboard.c | 290 ++
 drivers/input/tegra-kbc.c| 242 ++--
 drivers/misc/cros_ec.c   |  14 +-
 drivers/video/cfb_console.c  |  82 +---
 include/configs/MIP405.h |   5 -
 include/configs/MPC8536DS.h  |   1 -
 include/configs/MPC8544DS.h  |   1 -
 include/configs/MPC8572DS.h  |   1 -
 include/configs/MPC8641HPCN.h|   1 -