[PATCH v3 0/5(7)] OMAP1: Amstrad Delta: add FIQ based support for external keyboard

Janusz Krzysztofik
2010-04-15T02:19:00Z

This series of patches adds support for an external keyboard (called
mailboard) connected to the Amstrad Delta (E3) videophone.

The series is based on a patch by Matt Callow, created against
linux-omap-2.6.19[1], initially submitted to the e3-hacking mailing list in
April 2006[2].

Since the keyboard serial clock line is connected to a GPIO line, it generates
interrupts every single bit received. In order to handle this correctly, the
code makes use of a FIQ hardware feature. Since all GPIO generated interrupts
would be converted to FIQ, the handler must include support for all supported
GPIO connected devices: the keyboard, a modem and a hook switch.

My initial modifications to the original patch included:
- split into several patches,
- refresh against a recent linux version,
- a lot of cleanups, mainly to get rid of checkpatch reported issues,
- add support for handling interrupts generated by a GPIO line that the
meanwhile activated hook switch hangs off.
v2 changes:
- remove scan code to key code mapping from the serio driver, that doesn't
belong here and should be set up from userspace; thanks to Dmitry Torokhov
for advising this,
- no funtional changes in FIQ part (there were no comments in round 1).
v3 changes:
- cleanups suggested by Dmitry (applied not only to serio bits),
- assembly code optimizations suggested by Ralph Corderoy,
- (re)use existing header file provided macros where applicable instead of
defining new; remove a lot of unnecessary defines,
- extract missing FIQ_START definition fix into an extra patch numbered
0.1/5(7),
- modify both fiq and deferred_fiq handlers to follow default OMAP GPIO
interrupt processing path more closely,
- update board initialization code for complete modem IRQ GPIO line setup;
this appeared essential for correct interaction with optimized FIQ handler;
change is provided as a separate patch numbered 2.1/5(7),
- use IRQ12 (reserved on OMAP1510) for requesting deferred_fiq handler instead
of TIMER32k dedicated IRQ,
- more optimizations in both assembly and C code,
- modify serio Kconfig for automatic AT keyboard and FIQ handler selection,
- drop intermediate defconfig changes.

Created and tested against linux-2.6.34-rc4.

Janusz Krzysztofik(7)
OMAP: add missing FIQ_START definition, required by arch/arm/plat-omap/fiq.c
OMAP1: Amstrad Delta: add FIQ handler for serial keyboard port interrupt
processing
OMAP1: Amstrad Delta: add a handler for processing interrupts generated by
the FIQ routine
OMAP1: Amstrad Delta: update board initialization code for complete modem IRQ
GPIO line setup
OMAP1: Amstrad Delta: use FIQ for processing GPIO interrupts
input: serio: add support for Amstrad Delta serial keyboard port
OMAP1: Amstrad Delta: modify defconfig for external keyboard support

arch/arm/configs/ams_delta_defconfig | 1
arch/arm/mach-omap1/Kconfig | 10
arch/arm/mach-omap1/Makefile | 3
arch/arm/mach-omap1/ams-delta-fiq-handler.S | 281 +++++++++++++++++++++++
arch/arm/mach-omap1/ams-delta-fiq.c | 155 ++++++++++++
arch/arm/mach-omap1/board-ams-delta.c | 18 +
arch/arm/mach-omap1/include/mach/ams-delta-fiq.h | 79 ++++++
arch/arm/plat-omap/include/plat/irqs.h | 4
drivers/input/serio/Kconfig | 17 +
drivers/input/serio/Makefile | 1
drivers/input/serio/ams_delta_serio.c | 177 ++++++++++++++
11 files changed, 744 insertions(+), 2 deletions(-)

Thanks,
Janusz

[1] http://the.earth.li/pub/e3/2.6.19/ams-delta-keyboard.patch
[2] http://www.earth.li/pipermail/e3-hacking/2006-April/000453.html