From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1J2GgY-0006Rs-JI for qemu-devel@nongnu.org; Tue, 11 Dec 2007 20:46:54 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1J2GgV-0006NX-OZ for qemu-devel@nongnu.org; Tue, 11 Dec 2007 20:46:53 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J2GgV-0006ND-GS for qemu-devel@nongnu.org; Tue, 11 Dec 2007 20:46:51 -0500 Received: from gateway-1237.mvista.com ([63.81.120.158]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1J2GgV-00028L-2L for qemu-devel@nongnu.org; Tue, 11 Dec 2007 20:46:51 -0500 Received: from pahoa.hi.kama-aina.net (unknown [10.235.20.2]) by hermes.mvista.com (Postfix) with ESMTP id AFB181E5C1 for ; Tue, 11 Dec 2007 17:46:49 -0800 (PST) Message-ID: <475F3D89.5040001@kama-aina.net> Date: Tue, 11 Dec 2007 15:46:49 -1000 From: Armin MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------030200090308010105020608" Subject: [Qemu-devel] [Patch 2/2][PXA27x] Mainstone keypad support Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org This is a multi-part message in MIME format. --------------030200090308010105020608 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit This is the mainstone II keypad support for alpha numeric keypad. excludes the multiswitch and rotatory switch support Needs "[Patch 1/2][PXA27x] initial keypad support" patch in order to work - Armin --------------030200090308010105020608 Content-Type: text/x-patch; name="mst_keypad.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="mst_keypad.patch" Index: qemu/hw/mainstone.c =================================================================== --- qemu.orig/hw/mainstone.c +++ qemu/hw/mainstone.c @@ -78,6 +78,7 @@ static void mainstone_common_init(int ra } mst_irq = mst_irq_init(cpu, MST_FPGA_PHYS, PXA2XX_PIC_GPIO_0); + mst_keyboard_register(cpu->kp); /* MMC/SD host */ pxa2xx_mmci_handlers(cpu->mmc, NULL, mst_irq[MMC_IRQ]); Index: qemu/hw/mst_kpad.c =================================================================== --- /dev/null +++ qemu/hw/mst_kpad.c @@ -0,0 +1,30 @@ +/* + * PXA270-based Intel Mainstone Keypad support. + * + * Copyright (c) 2007 by Armin Kuster or + * + * + * This code is licensed under the GNU GPL v2. + */ + + +#include "hw.h" +#include "pxa.h" + +/* main keypad layout */ +int mst_keymap[PXAKBD_MAXROW][PXAKBD_MAXCOL] = { + { 0x1e, 0x30, 0x2e, 0x20, 0x12, 0x21, -1, -1}, + { 0x22, 0x23, 0x17, 0x24, 0x25, 0x26, -1, -1}, + { 0x32, 0x31, 0x18, 0x19, 0x10, 0x13, -1, -1}, + { 0x1f, 0x14, 0x16, 0x2f, 0x11, 0x2d, -1, -1}, + { -1, -1, 0x15, 0x2c, -1, -1, -1, -1}, + { 0xc7, 0x2a, 0x39, 0x39, -1, 0x1c, -1, -1}, + { 0xc8, 0xd0, 0xcb, 0xcd, -1, -1, -1, -1}, + { -1, -1, -1, -1, -1, -1, -1, -1} +}; + +void mst_keyboard_register(struct pxa2xx_keypad_s *kp) +{ + pxa27_register_keyboard(kp, mst_keymap, sizeof(mst_keymap)); + +} Index: qemu/hw/mainstone.h =================================================================== --- qemu.orig/hw/mainstone.h +++ qemu/hw/mainstone.h @@ -34,5 +34,5 @@ extern qemu_irq *mst_irq_init(struct pxa2xx_state_s *cpu, uint32_t base, int irq); - +extern void mst_keyboard_register(struct pxa2xx_keypad_s *kp); #endif /* __MAINSTONE_H__ */ Index: qemu/Makefile.target =================================================================== --- qemu.orig/Makefile.target +++ qemu/Makefile.target @@ -499,7 +499,7 @@ VL_OBJS+= pflash_cfi01.o gumstix.o VL_OBJS+= spitz.o ide.o serial.o nand.o ecc.o VL_OBJS+= omap.o omap_lcdc.o omap1_clk.o omap_mmc.o omap_i2c.o VL_OBJS+= palm.o tsc210x.o -VL_OBJS+= mst_fpga.o mainstone.o +VL_OBJS+= mst_fpga.o mainstone.o mst_kpad.o CPPFLAGS += -DHAS_AUDIO endif ifeq ($(TARGET_BASE_ARCH), sh4) --------------030200090308010105020608--