blob: ef3761dc248494b869dc1ecc4cc8da011e693f3c [file] [log] [blame]
Marek Vasut15c69352012-08-08 01:42:17 +00001The U-Boot Driver Model Project
2===============================
3Keyboard input analysis
4=======================
5Marek Vasut <marek.vasut@gmail.com>
62012-02-20
7
8I) Overview
9-----------
10
11The keyboard drivers are most often registered with STDIO subsystem. There are
12components of the keyboard drivers though, which operate in severe ad-hoc
13manner, often being related to interrupt-driven keypress reception. This
14components will require the most sanitization of all parts of keyboard input
15subsystem.
16
17Otherwise, the keyboard is no different from other standard input but with the
18necessity to decode scancodes. These are decoded using tables provided by
19keyboard drivers. These tables are often driver specific.
20
21II) Approach
22------------
23
24The most problematic part is the interrupt driven keypress reception. For this,
25the buffers that are currently shared throughout the whole U-Boot would need to
26be converted into driver's private data.
27
28III) Analysis of in-tree drivers
29--------------------------------
30
31 1) board/mpl/common/kbd.c
32 -------------------------
33 This driver is a classic STDIO driver, no problem with conversion is expected.
34 Only necessary change will be to move this driver to a proper location.
35
36 2) board/rbc823/kbd.c
37 ---------------------
38 This driver is a classic STDIO driver, no problem with conversion is expected.
39 Only necessary change will be to move this driver to a proper location.
40
41 3) drivers/input/keyboard.c
42 ---------------------------
43 This driver is special in many ways. Firstly because this is a universal stub
44 driver for converting scancodes from i8042 and the likes. Secondly because the
45 buffer is filled by various other ad-hoc implementations of keyboard input by
46 using this buffer as an extern. This will need to be fixed by allowing drivers
47 to pass certain routines to this driver via platform data.