All of lore.kernel.org
 help / color / mirror / Atom feed
From: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
To: e3-hacking@earth.li
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>, linux-input@vger.kernel.org
Subject: Re: [RFC][PATCH v2 0/5] omap1: Amstrad Delta: add support for external keyboard
Date: Mon, 29 Mar 2010 21:58:02 +0200	[thread overview]
Message-ID: <201003292158.05120.jkrzyszt@tis.icnet.pl> (raw)
In-Reply-To: <201003291619.25878.jkrzyszt@tis.icnet.pl>

Monday 29 March 2010 16:19:23 Janusz Krzysztofik napisał(a):
> 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 modifications to the original patch include:
> - 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;


Hi,

For those of you who would like to do some testing:

You'll need a utility for installing a key table. Given no single hint from 
linux-input team, I ended up using input-kbd, that is part of input-utils 
package, at least on Gentoo and Debian. Other possibilities I know of:
- V4L guys provided linux/Documentation/DocBook/v4l/keytable.c.xml example,
- http://0pointer.de/lennart/projects/keyfuzz/

My input-kbd compatible /etc/mailboard.map for my Delta looks like this:
-------------------------
112 = KEY_ESC
122 = KEY_F1
 70 = KEY_F2
124 = KEY_F3
119 = KEY_F4
114 = KEY_F5
105 = KEY_F6
 26 = KEY_F7
 42 = KEY_F8
 28 = KEY_F9
 21 = KEY_F10
113 = KEY_TAB
116 = KEY_1
115 = KEY_2
107 = KEY_3
 34 = KEY_4
 27 = KEY_5
 29 = KEY_6
 30 = KEY_7
121 = KEY_8
125 = KEY_9
117 = KEY_0
108 = KEY_BACKSPACE
 33 = KEY_Q
 35 = KEY_W
 36 = KEY_E
 38 = KEY_R
 82 = KEY_T
 93 = KEY_Y
 13 = KEY_U
 14 = KEY_I
 50 = KEY_O
 52 = KEY_P
 44 = KEY_ENTER
 49 = KEY_A
 51 = KEY_S
 53 = KEY_D
 54 = KEY_F
 41 = KEY_G
 91 = KEY_H
  3 = KEY_J
118 = KEY_K
 58 = KEY_L
 59 = KEY_BACKSLASH # there is no KEY_AT
 60 = KEY_LEFTSHIFT
 61 = KEY_Z
 78 = KEY_X
 84 = KEY_C
 11 = KEY_V
  5 = KEY_B
 65 = KEY_N
 66 = KEY_M
 67 = KEY_DOT
 62 = KEY_UP
 85 = KEY_RIGHTSHIFT
259 = KEY_LEFTCTRL
  6 = KEY_LEFTALT
 73 = KEY_RIGHTMETA
 75 = KEY_SPACE
 68 = KEY_COMMA
 22 = KEY_LEFT
 46 = KEY_DOWN
  9 = KEY_RIGHT
-------------------------
You may want to adopt it to better suit your taste.

My udev installs it up automatically for me with this simple rule:
-------------------------
ACTION=="add", KERNEL=="event[0-9]*", \ 
	ATTRS{phys}=="GPIO/serio[0-9]*/input[0-9]*", \ 
	RUN+="/usr/bin/input-kbd -f /etc/mailboard.map %n"
-------------------------

If you are using Angstrom (or other OpenEmbedded generated distribution), you 
may want to give my simple recipes/input-utils/input-utils.bb recipe a try:
-------------------------
PV = "20081014-${SRCREV}"
SRCREV = "101501"
SRC_URI = "http://dl.bytesex.org/cvs-snapshots/input-${PV}.tar.gz \
	file://fix-makefiles.patch;patch=1"
LICENSE = "GPL"
inherit autotools
S = "${WORKDIR}/input"
PACKAGES_prepend = "input-kbd input-remote "
FILES_input-kbd = "/usr/bin/input-kbd"
FILES_input-remote = "/usr/bin/input-send /usr/bin/input-recv"
--------------------------

and recipes/input-utils/files/fix-makefiles.patch:
--------------------------
--- input/mk/Variables.mk.orig	2008-10-14 12:27:01.000000000 +0200
+++ input/mk/Variables.mk	2010-03-29 17:11:58.000000000 +0200
@@ -30,7 +30,7 @@ MOC             ?= $(if $(QTDIR),$(QTDIR
 
 STRIP		?= -s
 INSTALL		?= install
-INSTALL_BINARY  := $(INSTALL) $(STRIP)
+INSTALL_BINARY  := $(INSTALL)
 INSTALL_SCRIPT  := $(INSTALL)
 INSTALL_DATA	:= $(INSTALL) -m 644
 INSTALL_DIR	:= $(INSTALL) -d
--------------------------

After putting the above two files in your local OE overlay, building the 
package(s) with "bitbake input-utils" and refreshing your repository Packeges 
list, all you need is running "opkg install input-kbd" on your Delta.

Have fun,
Janusz


>   thanks to Dmitry 
>   Torokhov for advising this,
> - no funtional changes in FIQ part (there were no comments in round 1).
>
> There is still one minor issue that I was not able to deal with: when built
> with CONFIG_OMAP_RESET_CLOCKS=y, the keyboard driver stops working. I have
> no idea how I could find which clock I should enable to get it working
> regardless of boot loader used. Any suggestions?
>
> Created and tested against linux-2.6.34-rc2.
>
> Janusz Krzysztofik(5)
> 	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: 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             |    2
>  arch/arm/mach-omap1/Kconfig                      |    8
>  arch/arm/mach-omap1/Makefile                     |    3
>  arch/arm/mach-omap1/ams-delta-fiq-handler.S      |  342
> +++++++++++++++++++++++ arch/arm/mach-omap1/ams-delta-fiq.c              | 
> 175 +++++++++++ arch/arm/mach-omap1/board-ams-delta.c            |    6
>  arch/arm/mach-omap1/include/mach/ams-delta-fiq.h |   57 +++
>  arch/arm/plat-omap/include/plat/irqs.h           |    4
>  drivers/input/serio/Kconfig                      |    9
>  drivers/input/serio/Makefile                     |    1
>  drivers/input/serio/ams_delta_keyboard.c         |  171 +++++++++++
>  11 files changed, 777 insertions(+), 1 deletion(-)
>
> 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


--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2010-03-29 19:58 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-29 14:19 [RFC][PATCH v2 0/5] omap1: Amstrad Delta: add support for external keyboard Janusz Krzysztofik
2010-03-29 14:19 ` Janusz Krzysztofik
2010-03-29 14:24 ` [RFC][PATCH v2 1/5] omap1: Amstrad Delta: add FIQ handler for serial keyboard port interrupt processing Janusz Krzysztofik
2010-03-29 14:24   ` Janusz Krzysztofik
     [not found]   ` <20100329183211.F105C493B@blake.inputplus.co.uk>
2010-03-30 15:08     ` [E3-hacking] " Janusz Krzysztofik
2010-03-30 15:08       ` Janusz Krzysztofik
2010-03-31  0:06       ` Ralph Corderoy
2010-03-31  0:06         ` [E3-hacking] " Ralph Corderoy
2010-03-29 14:26 ` [RFC][PATCH v2 2/5] omap1: Amstrad Delta: add a handler for processing interrupts generated by the FIQ routine Janusz Krzysztofik
2010-03-29 14:26   ` Janusz Krzysztofik
2010-03-29 14:28 ` [RFC][PATCH v2 3/5] omap1: Amstrad Delta: use FIQ for processing GPIO interrupts Janusz Krzysztofik
2010-03-29 14:28   ` Janusz Krzysztofik
2010-03-29 14:30 ` [RFC][PATCH v2 4/5] input: serio: add support for Amstrad Delta serial keyboard port Janusz Krzysztofik
2010-03-30  6:56   ` Dmitry Torokhov
2010-03-30 10:23     ` Janusz Krzysztofik
2010-03-29 14:32 ` [RFC][PATCH v2 5/5] omap1: Amstrad Delta: modify defconfig for external keyboard support Janusz Krzysztofik
2010-03-29 19:58 ` Janusz Krzysztofik [this message]
2010-04-12  3:16   ` [RFC][PATCH v2 0/5] omap1: Amstrad Delta: add support for external keyboard Dmitry Torokhov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201003292158.05120.jkrzyszt@tis.icnet.pl \
    --to=jkrzyszt@tis.icnet.pl \
    --cc=dmitry.torokhov@gmail.com \
    --cc=e3-hacking@earth.li \
    --cc=linux-input@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.