Skip to contentSkip to conversation

initial keypad support

PATCH In review Armin 2 participants 3 messages Dec 13, 2007 – Dec 16, 2007 Kbuild

lore
Share & tools
lore

Armin

author
#0 lore raw

PATCH 1/1 initial keypad support

Hello,
Here is a new series of keypad support patches for the PXA27x. I believe I have addressed all the concerns from my first set of patch.

Feedback and comment welcome.
-Armin

hw/pxa.h +13 -0
Index: qemu/hw/pxa.h
===================================================================
@@ -13,6 +13,7 @@
 # define PXA2XX_PIC_SSP3	0
 # define PXA2XX_PIC_USBH2	2
 # define PXA2XX_PIC_USBH1	3
+# define PXA2XX_PIC_KEYPAD	4
 # define PXA2XX_PIC_PWRI2C	6
 # define PXA25X_PIC_HWUART	7
 # define PXA27X_PIC_OST_4_11	7
@@ -120,6 +121,17 @@ i2c_bus *pxa2xx_i2c_bus(struct pxa2xx_i2
 struct pxa2xx_i2s_s;
 struct pxa2xx_fir_s;
 
+/* pxa2xx_kpad.c */
+struct  keymap {
+    int column;
+    int row;
+};
+struct pxa2xx_keypad_s;
+struct pxa2xx_keypad_s *pxa27x_keypad_init(target_phys_addr_t base,
+				qemu_irq irq);
+void pxa27x_register_keypad(struct pxa2xx_keypad_s *kp, struct keymap *map,
+        int size);
+
 struct pxa2xx_state_s {
     CPUState *env;
     qemu_irq *pic;
@@ -133,6 +145,7 @@ struct pxa2xx_state_s {
     struct pxa2xx_pcmcia_s *pcmcia[2];
     struct pxa2xx_i2s_s *i2s;
     struct pxa2xx_fir_s *fir;
+    struct pxa2xx_keypad_s *kp;
 
     /* Power management */
     target_phys_addr_t pm_base;
hw/pxa2xx.c +1 -0
Index: qemu/hw/pxa2xx.c
===================================================================
@@ -2156,6 +2156,7 @@ struct pxa2xx_state_s *pxa270_init(unsig
     /* GPIO1 resets the processor */
     /* The handler can be overridden by board-specific code */
     pxa2xx_gpio_out_set(s->gpio, 1, s->reset);
+	s->kp = pxa27x_keypad_init(0x41500000, s->pic[PXA2XX_PIC_KEYPAD]);
     return s;
 }
 
hw/pxa2xx_keypad.c new file +344 -0

344 lines not on this page · raw message

Makefile.target +1 -1
Index: qemu/Makefile.target
===================================================================
@@ -494,7 +494,7 @@ VL_OBJS+= armv7m.o armv7m_nvic.o stellar
 VL_OBJS+= pl061.o
 VL_OBJS+= arm-semi.o
 VL_OBJS+= pxa2xx.o pxa2xx_pic.o pxa2xx_gpio.o pxa2xx_timer.o pxa2xx_dma.o
-VL_OBJS+= pxa2xx_lcd.o pxa2xx_mmci.o pxa2xx_pcmcia.o
+VL_OBJS+= pxa2xx_lcd.o pxa2xx_mmci.o pxa2xx_pcmcia.o pxa2xx_keypad.o
 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
#1 lore raw
Quoted 3 lines · Armin

Hello,
Here is a new series of keypad support patches for the PXA27x. I believe I have addressed all the concerns from my first set of patch.

Thanks! I just changed the use of cpu_abort to an exit() because cpu_single_env will typically be NULL at the time of initialisation. Please test.
Cheers

author
#2 lore raw
Quoted 7 lines · andrzej zaborowski
Quoted 4 lines · Armin

Hello,
Here is a new series of keypad support patches for the PXA27x. I believe I have addressed all the concerns from my first set of patch.

Quoted 5 lines

Thanks! I just changed the use of cpu_abort to an exit() because cpu_single_env will typically be NULL at the time of initialisation. Please test.
Cheers

Andrzej,

It works fine.

Thanks.
-Armin