Skip to contentSkip to conversation

OMAP1: Amstrad Delta: add FIQ based support for external keyboard

PATCH Superseded Janusz Krzysztofik 3 participants 15 messages Apr 15, 2010 – Apr 26, 2010

Subsystems (5)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 OMAP1: Amstrad Delta: add FIQ based support for external keyboard

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

#1 lore raw

PATCH v3 1/1 OMAP1: Amstrad Delta: add FIQ handler for serial keyboard port interrupt processing

This patch introduces a Fast Interrupt Request (FIQ) handler for Amstrad Delta (E3) videophone. The handler's purpose is to process interrupts generated by a GPIO line that a serial keyboard clock hangs off. It collects consecutive bits into words, pushing them into a buffer, then requests a higher level interrupt after one or more words are ready for further processing by a keyboard port driver.

The handler also processes interrupts generated by two other GPIO lines, used by other on-board supported devices, by simply requesting a higher level interrupt, that in turn should invoke those device's specific irq handlers.

IRQ12 line, not used by OMAP1510 hardware (described as reserved), has been choosen as a higher level interrupt source.

Created and tested against linux-2.6.34-rc4.
Compiles on top of PATCH v3 0.1/5(7), "OMAP: add missing FIQ_START definition required for arch/arm/plat-omap/fiq.c compilation".

---
v2 changes:
- no functional changes,
- refresh against linux-2.6.34-rc2.
v3 changes:
- assembler code optimizations suggested by Ralph Corderoy,
- (re)use existing header file provided macros where applicable instead of defining new (from scratch); remove a lot of unnecessary defines,
- follow default OMAP GPIO interrupt processing path more closely,
- prepare for choosing arbitrary IRQ for deferred_fiq handler; use IRQ12 (reserved on OMAP1510) instead of Timer 32K dedicated IRQ,
- more optimizations for smaller code.

 arch/arm/mach-omap1/Kconfig                      |   10
 arch/arm/mach-omap1/Makefile                     |    1
 arch/arm/mach-omap1/ams-delta-fiq-handler.S      |  281 +++++++++++++++++++++++
 arch/arm/mach-omap1/include/mach/ams-delta-fiq.h |   72 +++++
 4 files changed, 364 insertions(+)
arch/arm/mach-omap1/Kconfig +10 -0
diff -uprN git.orig/arch/arm/mach-omap1/Kconfig git/arch/arm/mach-omap1/Kconfig
@@ -152,6 +152,16 @@ config MACH_AMS_DELTA
 	  Support for the Amstrad E3 (codename Delta) videophone. Say Y here
 	  if you have such a device.
 
+config AMS_DELTA_FIQ
+	bool "Fast Interrupt Request (FIQ) support for the E3"
+	depends on MACH_AMS_DELTA
+	select FIQ
+	help
+	  Provide a FIQ handler for the E3.
+	  This allows for fast handling of interrupts generated
+	  by the clock line of the E3 mailboard (or a PS/2 keyboard)
+	  connected to the GPIO based external keyboard port.
+
 config MACH_OMAP_GENERIC
 	bool "Generic OMAP board"
 	depends on ARCH_OMAP1 && (ARCH_OMAP15XX || ARCH_OMAP16XX)
arch/arm/mach-omap1/Makefile +1 -0
diff -uprN git.orig/arch/arm/mach-omap1/Makefile git/arch/arm/mach-omap1/Makefile
@@ -37,6 +37,7 @@ obj-$(CONFIG_MACH_OMAP_PALMZ71)		+= boar
 obj-$(CONFIG_MACH_OMAP_PALMTT)		+= board-palmtt.o
 obj-$(CONFIG_MACH_NOKIA770)		+= board-nokia770.o
 obj-$(CONFIG_MACH_AMS_DELTA)		+= board-ams-delta.o
+obj-$(CONFIG_AMS_DELTA_FIQ)		+= ams-delta-fiq-handler.o
 obj-$(CONFIG_MACH_SX1)			+= board-sx1.o board-sx1-mmc.o
 obj-$(CONFIG_MACH_HERALD)		+= board-htcherald.o
 
arch/arm/mach-omap1/ams-delta-fiq-handler.S +281 -0

281 lines not on this page · raw message

arch/arm/mach-omap1/include/mach/ams-delta-fiq.h +72 -0

72 lines not on this page · raw message

#2 lore raw

PATCH v3 1/1 OMAP: add missing FIQ_START definition required for arch/arm/plat-omap/fiq.c compilation

In reply to Janusz Krzysztofik

Several ARM platforms/machines that use FIQ define their value of FIQ_START. Since FIQ is not implemented for OMAP yet, this definition is missing from OMAP header files.

Put an arbitrary value for FIQ_START into plat/irqs.h for OMAP. Even if not used by the WiP FIQ handler for Amstrad Delta, this is required for successfull compilation of arch/arm/plat-omap/fiq.c that provides several usefull functions.

Even if prepended in front of the Amstrad Delta FIQ patch set, can be applied alone in advance as well, possibly as a fix.

Created and tested against linux-2.6.34-rc4.

---

 arch/arm/plat-omap/include/plat/irqs.h |    4 ++++
 1 file changed, 4 insertions(+)
arch/arm/plat-omap/include/plat/irqs.h +4 -0
@@ -430,4 +430,8 @@ void omap3_intc_resume_idle(void);
 
 #include <mach/hardware.h>
 
+#ifdef CONFIG_FIQ
+#define FIQ_START		1024
+#endif
+
 #endif
#3 lore raw

Re: [PATCH v3 0.1/5(7)] OMAP: add missing FIQ_START definition required for arch/arm/kernel/fiq.c compilation (was: OMAP: add missing FIQ_START definition required for arch/arm/plat-omap/fiq.c compilation)

Thursday 15 April 2010 04:23:04 Janusz Krzysztofik napisał(a):

Quoted 8 lines

Several ARM platforms/machines that use FIQ define their value of FIQ_START. Since FIQ is not implemented for OMAP yet, this definition is missing from OMAP header files.

Put an arbitrary value for FIQ_START into plat/irqs.h for OMAP. Even if not used by the WiP FIQ handler for Amstrad Delta, this is required for successfull compilation of arch/arm/plat-omap/fiq.c that provides several usefull functions.

Hi,
I've just noticed that I messsed up the file name. It's arch/arm/kernel/fiq.c that does not compile without platform provided FIQ_START definition. Sorry for this.

Thanks,
Janusz

Quoted 14 lines

Even if prepended in front of the Amstrad Delta FIQ patch set, can be applied alone in advance as well, possibly as a fix.

Created and tested against linux-2.6.34-rc4.

---

 arch/arm/plat-omap/include/plat/irqs.h |    4 ++++
 1 file changed, 4 insertions(+)

arch/arm/plat-omap/include/plat/irqs.h void omap3_intc_resume_idle(void); · line 437

Quoted 8 lines
arch/arm/plat-omap/include/plat/irqs.h +4 -0
@@ -430,4 +430,8 @@ void omap3_intc_resume_idle(void); 
 
 #include <mach/hardware.h>
 
+#ifdef CONFIG_FIQ
+#define FIQ_START		1024
+#endif
+
 #endif

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

#4 lore raw

PATCH v3 1/1 OMAP1: Amstrad Delta: add a handler for processing interrupts generated by the FIQ routine

In reply to Janusz Krzysztofik

This patch introduces an IRQ handler used for processing interrupts generated by the FIQ handler when it decides there are data ready for processing.

The handler further invokes device specific interrupt routines based on an interrupt source as passed from the FIQ handler.

It can be registered by the board as a handler for the otherwise unused 32k timer interrupt.

Created and tested against linux-2.6.34-rc4.
Applies on top of PATCH v3 1/5(7), "OMAP1: Amstrad Delta: add FIQ handler for serial keyboard port interrupt processing".

---
v2 changes:
- add fiq_buffer[] declaration missing from the header file,
- refresh against 2.6.34-rc2.
v3 changes:
- follow Dmitry's serio cleanup suggestions here as well,
- follow default OMAP GPIO interrupt processing path more closely,
- more optimizations and cleanups.

 arch/arm/mach-omap1/Makefile                     |    2
 arch/arm/mach-omap1/ams-delta-fiq.c              |  155 +++++++++++++++++++++++
 arch/arm/mach-omap1/include/mach/ams-delta-fiq.h |    7 +
 3 files changed, 163 insertions(+), 1 deletion(-)
arch/arm/mach-omap1/Makefile +1 -1
diff -uprN git.orig/arch/arm/mach-omap1/Makefile git/arch/arm/mach-omap1/Makefile
@@ -37,7 +37,7 @@ obj-$(CONFIG_MACH_OMAP_PALMZ71)		+= boar
 obj-$(CONFIG_MACH_OMAP_PALMTT)		+= board-palmtt.o
 obj-$(CONFIG_MACH_NOKIA770)		+= board-nokia770.o
 obj-$(CONFIG_MACH_AMS_DELTA)		+= board-ams-delta.o
-obj-$(CONFIG_AMS_DELTA_FIQ)		+= ams-delta-fiq-handler.o
+obj-$(CONFIG_AMS_DELTA_FIQ)		+= ams-delta-fiq.o ams-delta-fiq-handler.o
 obj-$(CONFIG_MACH_SX1)			+= board-sx1.o board-sx1-mmc.o
 obj-$(CONFIG_MACH_HERALD)		+= board-htcherald.o
 
arch/arm/mach-omap1/ams-delta-fiq.c +155 -0

155 lines not on this page · raw message

arch/arm/mach-omap1/include/mach/ams-delta-fiq.h +7 -0
diff -uprN git.orig/arch/arm/mach-omap1/include/mach/ams-delta-fiq.h git/arch/arm/mach-omap1/include/mach/ams-delta-fiq.h
@@ -69,4 +69,11 @@
 
 #define FIQ_CIRC_BUFF		30      /*Start of circular buffer */
 
+#ifndef __ASSEMBLER__
+extern unsigned int fiq_buffer[];
+extern unsigned char qwerty_fiqin_start, qwerty_fiqin_end;
+
+extern void __init ams_delta_init_fiq(void);
+#endif
+
 #endif
reviewer
#5 lore raw

PATCH v3 1/1 OMAP1: Amstrad Delta: add a handler for processing interrupts generated by the FIQ routine

Quoted 32 lines · Janusz Krzysztofik

This patch introduces an IRQ handler used for processing interrupts generated by the FIQ handler when it decides there are data ready for processing.

The handler further invokes device specific interrupt routines based on an interrupt source as passed from the FIQ handler.

It can be registered by the board as a handler for the otherwise unused 32k timer interrupt.

Created and tested against linux-2.6.34-rc4.
Applies on top of PATCH v3 1/5(7), "OMAP1: Amstrad Delta: add FIQ handler for serial keyboard port interrupt processing".

---
v2 changes:
- add fiq_buffer[] declaration missing from the header file,
- refresh against 2.6.34-rc2.
v3 changes:
- follow Dmitry's serio cleanup suggestions here as well,
- follow default OMAP GPIO interrupt processing path more closely,
- more optimizations and cleanups.

 arch/arm/mach-omap1/Makefile                     |    2
 arch/arm/mach-omap1/ams-delta-fiq.c              |  155 +++++++++++++++++++++++
 arch/arm/mach-omap1/include/mach/ams-delta-fiq.h |    7 +
 3 files changed, 163 insertions(+), 1 deletion(-)

diff -uprN git.orig/arch/arm/mach-omap1/Makefile git/arch/arm/mach-omap1/Makefile

arch/arm/mach-omap1/Makefile obj-$(CONFIG_MACH_OMAP_PALMZ71) += boar · line 42

Quoted 7 lines
arch/arm/mach-omap1/Makefile +1 -1
@@ -37,7 +37,7 @@ obj-$(CONFIG_MACH_OMAP_PALMZ71)		+= boar
 obj-$(CONFIG_MACH_OMAP_PALMTT)		+= board-palmtt.o
 obj-$(CONFIG_MACH_NOKIA770)		+= board-nokia770.o
 obj-$(CONFIG_MACH_AMS_DELTA)		+= board-ams-delta.o
-obj-$(CONFIG_AMS_DELTA_FIQ)		+= ams-delta-fiq-handler.o
+obj-$(CONFIG_AMS_DELTA_FIQ)		+= ams-delta-fiq.o ams-delta-fiq-handler.o
 obj-$(CONFIG_MACH_SX1)			+= board-sx1.o board-sx1-mmc.o
 obj-$(CONFIG_MACH_HERALD)		+= board-htcherald.o

Do you really need a separate option for CONFIG_AMS_DELTA_FIQ? To me it seems you can just compile it in when CONFIG_MACH_AMS_DELTA is selected.

Also, please make sure the FIQ only gets initialized for the right board when multiple boards are compiled in.

Regards,

Tony

#6 lore raw

PATCH v3 1/1 OMAP1: Amstrad Delta: add a handler for processing interrupts generated by the FIQ routine

Friday 23 April 2010 01:17:26 Tony Lindgren napisa?(a):

Quoted 30 lines · Janusz Krzysztofik
Quoted 29 lines

This patch introduces an IRQ handler used for processing interrupts generated by the FIQ handler when it decides there are data ready for processing.

The handler further invokes device specific interrupt routines based on an interrupt source as passed from the FIQ handler.

It can be registered by the board as a handler for the otherwise unused 32k timer interrupt.

Created and tested against linux-2.6.34-rc4.
Applies on top of PATCH v3 1/5(7), "OMAP1: Amstrad Delta: add FIQ handler for serial keyboard port interrupt processing".

---
v2 changes:
- add fiq_buffer[] declaration missing from the header file,
- refresh against 2.6.34-rc2.
v3 changes:
- follow Dmitry's serio cleanup suggestions here as well,
- follow default OMAP GPIO interrupt processing path more closely,
- more optimizations and cleanups.

 arch/arm/mach-omap1/Makefile                     |    2
 arch/arm/mach-omap1/ams-delta-fiq.c              |  155 +++++++++++++++++++++++
 arch/arm/mach-omap1/include/mach/ams-delta-fiq.h |    7 +
 3 files changed, 163 insertions(+), 1 deletion(-)
Quoted 13 lines

arch/arm/mach-omap1/Makefile obj-$(CONFIG_MACH_OMAP_PALMZ71) += boar · line 42

Quoted 11 lines

diff -uprN git.orig/arch/arm/mach-omap1/Makefile git/arch/arm/mach-omap1/Makefile

arch/arm/mach-omap1/Makefile +1 -1
@@ -37,7 +37,7 @@ obj-$(CONFIG_MACH_OMAP_PALMZ71)		+= boar
 obj-$(CONFIG_MACH_OMAP_PALMTT)		+= board-palmtt.o
 obj-$(CONFIG_MACH_NOKIA770)		+= board-nokia770.o
 obj-$(CONFIG_MACH_AMS_DELTA)		+= board-ams-delta.o
-obj-$(CONFIG_AMS_DELTA_FIQ)		+= ams-delta-fiq-handler.o
+obj-$(CONFIG_AMS_DELTA_FIQ)		+= ams-delta-fiq.o ams-delta-fiq-handler.o
 obj-$(CONFIG_MACH_SX1)			+= board-sx1.o board-sx1-mmc.o
 obj-$(CONFIG_MACH_HERALD)		+= board-htcherald.o

Do you really need a separate option for CONFIG_AMS_DELTA_FIQ?

Not really, but could we keep it for now, until the code gets a bit matured?

Quoted 2 lines

To me it seems you can just compile it in when CONFIG_MACH_AMS_DELTA is selected.

If you agree, I will change it this way with a followup patch prepared for the next + 1 kernel release.

Quoted 2 lines

Also, please make sure the FIQ only gets initialized for the right board when multiple boards are compiled in.

I believe it works this way. The ams_delta_init_fiq() routine, that sets up both FIQ and IRQ handlers, is invoked from the machines' init_machine() callback. Can I assume it won't be called for other machine types then?

Thanks,
Janusz

reviewer
#7 lore raw

PATCH v3 1/1 OMAP1: Amstrad Delta: add a handler for processing interrupts generated by the FIQ routine

Quoted 45 lines · Janusz Krzysztofik

Friday 23 April 2010 01:17:26 Tony Lindgren napisa?(a):

Quoted 30 lines · Janusz Krzysztofik
Quoted 29 lines

This patch introduces an IRQ handler used for processing interrupts generated by the FIQ handler when it decides there are data ready for processing.

The handler further invokes device specific interrupt routines based on an interrupt source as passed from the FIQ handler.

It can be registered by the board as a handler for the otherwise unused 32k timer interrupt.

Created and tested against linux-2.6.34-rc4.
Applies on top of PATCH v3 1/5(7), "OMAP1: Amstrad Delta: add FIQ handler for serial keyboard port interrupt processing".

---
v2 changes:
- add fiq_buffer[] declaration missing from the header file,
- refresh against 2.6.34-rc2.
v3 changes:
- follow Dmitry's serio cleanup suggestions here as well,
- follow default OMAP GPIO interrupt processing path more closely,
- more optimizations and cleanups.

 arch/arm/mach-omap1/Makefile                     |    2
 arch/arm/mach-omap1/ams-delta-fiq.c              |  155 +++++++++++++++++++++++
 arch/arm/mach-omap1/include/mach/ams-delta-fiq.h |    7 +
 3 files changed, 163 insertions(+), 1 deletion(-)
Quoted 13 lines

arch/arm/mach-omap1/Makefile obj-$(CONFIG_MACH_OMAP_PALMZ71) += boar · line 42

Quoted 11 lines

diff -uprN git.orig/arch/arm/mach-omap1/Makefile git/arch/arm/mach-omap1/Makefile

arch/arm/mach-omap1/Makefile +1 -1
@@ -37,7 +37,7 @@ obj-$(CONFIG_MACH_OMAP_PALMZ71)		+= boar
 obj-$(CONFIG_MACH_OMAP_PALMTT)		+= board-palmtt.o
 obj-$(CONFIG_MACH_NOKIA770)		+= board-nokia770.o
 obj-$(CONFIG_MACH_AMS_DELTA)		+= board-ams-delta.o
-obj-$(CONFIG_AMS_DELTA_FIQ)		+= ams-delta-fiq-handler.o
+obj-$(CONFIG_AMS_DELTA_FIQ)		+= ams-delta-fiq.o ams-delta-fiq-handler.o
 obj-$(CONFIG_MACH_SX1)			+= board-sx1.o board-sx1-mmc.o
 obj-$(CONFIG_MACH_HERALD)		+= board-htcherald.o

Do you really need a separate option for CONFIG_AMS_DELTA_FIQ?

Quoted 7 lines

Not really, but could we keep it for now, until the code gets a bit matured?

Quoted 2 lines

To me it seems you can just compile it in when CONFIG_MACH_AMS_DELTA is selected.

If you agree, I will change it this way with a followup patch prepared for the next + 1 kernel release.

OK

Quoted 6 lines
Quoted 2 lines

Also, please make sure the FIQ only gets initialized for the right board when multiple boards are compiled in.

I believe it works this way. The ams_delta_init_fiq() routine, that sets up both FIQ and IRQ handlers, is invoked from the machines' init_machine() callback. Can I assume it won't be called for other machine types then?

Just please check that compile works OK if you compile in other omap1 boards.

Tony

#8 lore raw

PATCH v3 1/1 OMAP1: Amstrad Delta: update board initialization code for complete modem IRQ GPIO line setup

In reply to Janusz Krzysztofik

In case of Amstrad Delta modem utilized GPIO line, interrupt is requested from standard serial8250 driver code without first requesting the GPIO pin itself. Even if it works with default OMAP GPIO interrupt handler, it appeared not compatible with recent, optimized version of the board WiP GPIO FIQ handler, required for fast processing of interrupts generated by other GPIO pin that a serial keyboard clock hangs off.

This patch fills the board specific modem initialization routine with common GPIO line reservation and direction setup.

Even if included in the Amstrad Delta FIQ patch set, can be applied alone in advance as well, possibly as a fix.

Created and tested against linux-2.6.34-rc4.

---

 arch/arm/mach-omap1/board-ams-delta.c |   12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
arch/arm/mach-omap1/board-ams-delta.c +11 -1
@@ -263,8 +263,18 @@ static struct platform_device ams_delta_
 
 static int __init ams_delta_modem_init(void)
 {
+	int err;
+
 	omap_cfg_reg(M14_1510_GPIO2);
-	ams_delta_modem_ports[0].irq = gpio_to_irq(2);
+	ams_delta_modem_ports[0].irq =
+			gpio_to_irq(AMS_DELTA_GPIO_PIN_MODEM_IRQ);
+
+	err = gpio_request(AMS_DELTA_GPIO_PIN_MODEM_IRQ, "modem");
+	if (err) {
+		pr_err("Couldn't request gpio pin for modem\n");
+		return err;
+	}
+	gpio_direction_input(AMS_DELTA_GPIO_PIN_MODEM_IRQ);
 
 	ams_delta_latch2_write(
 		AMS_DELTA_LATCH2_MODEM_NRESET | AMS_DELTA_LATCH2_MODEM_CODEC,
#9 lore raw

PATCH v3 1/1 OMAP1: Amstrad Delta: use FIQ for processing GPIO interrupts

In reply to Janusz Krzysztofik

The patch adds initialization of FIQ related handlers to the Amstrad Delta videophone board code. FIQ will be used instead of a traditional IRQ for processing all GPIO generated interrupts, including a keyboard serial clock line.

Created and tested against linux-2.6.34-rc4.
Compiles and works on top of PATCH v3 2/5(7), "OMAP1: Amstrad Delta: add a handler for processing interrupts generated by the FIQ routine". Also requires PATCH v3 2.1/5(7), "OMAP1: Amstrad Delta: update board initialization code for complete modem IRQ GPIO line setup" for correct modem handling.

---
v2 changes:
- no functional changes,
- refreshed against linux-2.6.34-rc2.
v3 changes:
- drop intermediate defconfig modification

 arch/arm/mach-omap1/board-ams-delta.c |    6 ++++++
 1 file changed, 6 insertions(+)
arch/arm/mach-omap1/board-ams-delta.c +6 -0
@@ -33,6 +33,8 @@
 #include <plat/board.h>
 #include <plat/common.h>
 
+#include <mach/ams-delta-fiq.h>
+
 static u8 ams_delta_latch1_reg;
 static u16 ams_delta_latch2_reg;
 
@@ -236,6 +238,10 @@ static void __init ams_delta_init(void)
 	omap_usb_init(&ams_delta_usb_config);
 	platform_add_devices(ams_delta_devices, ARRAY_SIZE(ams_delta_devices));
 
+#ifdef CONFIG_AMS_DELTA_FIQ
+	ams_delta_init_fiq();
+#endif
+
 	omap_writew(omap_readw(ARM_RSTCT1) | 0x0004, ARM_RSTCT1);
 }
 
#10 lore raw

PATCH v3 1/1 input: serio: add support for Amstrad Delta serial keyboard port

In reply to Janusz Krzysztofik

The patch introduces a serio driver that supports a keyboard serial port found on the Amstrad Delta videophone board.

After initializing the hardware, the driver reads its input data from a buffer filled in by the board FIQ (Fast Interrupt Request) handler.

Standard AT keyboard driver (atkbd) will be used on top of the serio layer for handling the E3 keyboard (called mailboard) connected to the port. Since the device generated scancodes differ from what the atkbd expects, a custom key code to scan code table must be loaded from userspace for the keyboard to be useable.

Compiles and works on top of PATCH v3 3/5(7), "OMAP1: Amstrad Delta: use FIQ for processing GPIO interrupts".

Created and tested against linux-2.6.34-rc4.

---
v2 changes:
- use correct variable name for return value in ams_delta_kbd_init(),
- remove scan code to key code mapping,
- refreshed against linux-2.6.34-rc2.
v3 changes:
- cleanups suggested by Dmitry,
- force using of handle_simple_irq() to avoid GPIO register manipulation, already handled at FIQ level,
- modify Kconfig for automatic AT keyboard and FIQ handler selection,
- misc cleanups.

 drivers/input/serio/Kconfig           |   17 +++
 drivers/input/serio/Makefile          |    1
 drivers/input/serio/ams_delta_serio.c |  177 ++++++++++++++++++++++++++++++++++
 3 files changed, 195 insertions(+)
drivers/input/serio/Kconfig +17 -0
diff -uprN git.orig/drivers/input/serio/Kconfig git/drivers/input/serio/Kconfig
@@ -210,3 +210,20 @@ config SERIO_ALTERA_PS2
 	  module will be called altera_ps2.
 
 endif
+
+config SERIO_AMS_DELTA
+	tristate "Amstrad Delta (E3) mailboard support"
+	depends on MACH_AMS_DELTA
+	default y
+	select AMS_DELTA_FIQ
+	select KEYBOARD_ATKBD
+	---help---
+	  Say Y here if you have an E3 and want to use its mailboard,
+	  or any standard AT keyboard connected to the mailboard port.
+
+	  When used for the E3 mailboard, a non-standard key table
+	  must be loaded from userspace, possibly using udev extras
+	  provided keymap helper utility.
+
+	  To compile this driver as a module, choose M here;
+	  the module will be called ams_delta_serio
drivers/input/serio/Makefile +1 -0
diff -uprN git.orig/drivers/input/serio/Makefile git/drivers/input/serio/Makefile
@@ -21,5 +21,6 @@ obj-$(CONFIG_SERIO_PCIPS2)	+= pcips2.o
 obj-$(CONFIG_SERIO_MACEPS2)	+= maceps2.o
 obj-$(CONFIG_SERIO_LIBPS2)	+= libps2.o
 obj-$(CONFIG_SERIO_RAW)		+= serio_raw.o
+obj-$(CONFIG_SERIO_AMS_DELTA)	+= ams_delta_serio.o
 obj-$(CONFIG_SERIO_XILINX_XPS_PS2)	+= xilinx_ps2.o
 obj-$(CONFIG_SERIO_ALTERA_PS2)	+= altera_ps2.o
drivers/input/serio/ams_delta_serio.c +177 -0

177 lines not on this page · raw message

maintainer Acked-by on v3 1/1
#11 lore raw

Re: [PATCH v3 4/5(7)] input: serio: add support for Amstrad Delta serial keyboard port

Hi Janusz,

drivers/input/serio/Kconfig config SERIO_ALTERA_PS2 · line 219

Quoted 7 lines · Janusz Krzysztofik
drivers/input/serio/Kconfig +7 -0
+
+config SERIO_AMS_DELTA
+	tristate "Amstrad Delta (E3) mailboard support"
+	depends on MACH_AMS_DELTA
+	default y
+	select AMS_DELTA_FIQ
+	select KEYBOARD_ATKBD

I'd rather not select atkbd here since it is not required for this driver to work but simply adjust your defconfig.

drivers/input/serio/ams_delta_serio.c line 111

Quoted 3 lines
drivers/input/serio/ams_delta_serio.c +3 -0
+
+	if (!(machine_is_ams_delta()))
+		return -ENODEV;

Extra parens.

Otherwise:

I assume it is going to be merged with the rest of your patches through a tree other than linux-input.

Signature · 1 line
Dmitry
#12 lore raw

Re: [PATCH v3 4/5(7)] input: serio: add support for Amstrad Delta serial keyboard port

Thursday 15 April 2010 18:14:51 Dmitry Torokhov napisał(a):

Quoted 1 line

Hi Janusz,

Hi Dmitry,

Quoted 11 lines · Janusz Krzysztofik

drivers/input/serio/Kconfig config SERIO_ALTERA_PS2 · line 219

Quoted 7 lines
drivers/input/serio/Kconfig +7 -0
+
+config SERIO_AMS_DELTA
+	tristate "Amstrad Delta (E3) mailboard support"
+	depends on MACH_AMS_DELTA
+	default y
+	select AMS_DELTA_FIQ
+	select KEYBOARD_ATKBD

I'd rather not select atkbd here since it is not required for this driver to work but simply adjust your defconfig.

I was just trying to address possible future support questions, as you can already find them in the e3-hacking 2006 archives :).

OK, I'll drop it then and move the config back inside the "if SERIO"..."endif" block.

Quoted 5 lines

drivers/input/serio/ams_delta_serio.c line 111

Quoted 3 lines
drivers/input/serio/ams_delta_serio.c +3 -0
+
+	if (!(machine_is_ams_delta()))
+		return -ENODEV;

Extra parens.

Yes, it looks like I'm too much wary. I'll drop them.

Quoted 3 lines

Otherwise:

Thanks.

Quoted 2 lines

I assume it is going to be merged with the rest of your patches through a tree other than linux-input.

Probably yes, since it depends on most of them. Let's see first what Tony says.

Regards,
Janusz
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

reviewer
#13 lore raw

Re: [PATCH v3 4/5(7)] input: serio: add support for Amstrad Delta serial keyboard port

Quoted 35 lines · Janusz Krzysztofik

Thursday 15 April 2010 18:14:51 Dmitry Torokhov napisał(a):

Quoted 1 line

Hi Janusz,

Hi Dmitry,

Quoted 11 lines · Janusz Krzysztofik

drivers/input/serio/Kconfig config SERIO_ALTERA_PS2 · line 219

Quoted 7 lines
drivers/input/serio/Kconfig +7 -0
+
+config SERIO_AMS_DELTA
+	tristate "Amstrad Delta (E3) mailboard support"
+	depends on MACH_AMS_DELTA
+	default y
+	select AMS_DELTA_FIQ
+	select KEYBOARD_ATKBD

I'd rather not select atkbd here since it is not required for this driver to work but simply adjust your defconfig.

I was just trying to address possible future support questions, as you can already find them in the e3-hacking 2006 archives :).

OK, I'll drop it then and move the config back inside the "if SERIO"..."endif" block.

Quoted 5 lines

drivers/input/serio/ams_delta_serio.c line 111

Quoted 3 lines
drivers/input/serio/ams_delta_serio.c +3 -0
+
+	if (!(machine_is_ams_delta()))
+		return -ENODEV;

Extra parens.

Yes, it looks like I'm too much wary. I'll drop them.

Quoted 3 lines

Otherwise:

Quoted 7 lines

Thanks.

Quoted 2 lines

I assume it is going to be merged with the rest of your patches through a tree other than linux-input.

Probably yes, since it depends on most of them. Let's see first what Tony says.

Sorry for the delay, quite a few patches to read through right now..

Looks pretty good to me, I have one comment on the FIQ though.

After the remaining fixes, could you please repost the whole series one more time now with linux-arm-kernel also cc'd?

Then if no more comments there, I'll add add it to omap for-next.

Cheers,

Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#14 lore raw

PATCH v3 1/1 OMAP1: Amstrad Delta: modify defconfig for external keyboard support

In reply to Janusz Krzysztofik

The patch adds a CONFIG directive required for supporting the Amstrad Delta connected external keyboard by default.

Created and tested against linux-2.6.34-rc2.
Works on top of PATCH 4/5(7), "input: serio: add support for Amstrad Delta serial keyboard port".

---
v2 changes:
- no functional changes,
- refreshed against linux-2.6.34-rc2.
v3 changes:
- since CONFIG_KEYBOARD_ATKBD and CONFIG_AMS_DELTA_FIQ are now selected automatically, limit defconfig changes to CONFIG_SERIO_AMS_DELTA selection

 arch/arm/configs/ams_delta_defconfig |    1 +
 1 file changed, 1 insertion(+)
arch/arm/configs/ams_delta_defconfig +1 -0
@@ -699,6 +699,7 @@ CONFIG_SERIO=y
 CONFIG_SERIO_SERPORT=y
 CONFIG_SERIO_LIBPS2=y
 # CONFIG_SERIO_RAW is not set
+CONFIG_SERIO_AMS_DELTA=y
 # CONFIG_GAMEPORT is not set
 
 #