u-boot-mkimage-gta01-native: re-add till uboot-utils actually works
[openembedded.git] / packages / linux / linux-ezx-2.6.21 / patches / e680-kbd.patch
1 Index: linux-2.6.21/arch/arm/mach-pxa/ezx-e680.c
2 ===================================================================
3 --- linux-2.6.21.orig/arch/arm/mach-pxa/ezx-e680.c      2007-05-24 00:54:39.000000000 -0300
4 +++ linux-2.6.21/arch/arm/mach-pxa/ezx-e680.c   2007-05-24 00:56:30.000000000 -0300
5 @@ -15,18 +15,21 @@
6  #include <linux/fb.h>
7  #include <linux/mmc/host.h>
8  #include <linux/irq.h>
9 +#include <linux/input.h>
10  
11  #include <asm/mach-types.h>
12  #include <asm/mach/arch.h>
13  #include <asm/arch/pxa-regs.h>
14  #include <asm/arch/pxafb.h>
15  #include <asm/arch/mmc.h>
16 +#include <asm/arch/kbd.h>
17  
18  #include "generic.h"
19  #include "ezx.h"
20  
21  extern void ezx_lcd_power(int, struct fb_var_screeninfo *);
22  extern void ezx_backlight_power(int);
23 +extern void __init pxa_set_kbd_info(struct pxakbd_platform_data *);
24  
25  #ifdef CONFIG_EZX_PCAP
26  extern int ezx_pcap_mmcsd_power(int);
27 @@ -144,6 +147,58 @@
28         .pxafb_lcd_power = &ezx_lcd_power,
29  };
30  
31 +static unsigned char e680_keycode[] = {
32 +       /* row 0 */
33 +       KEY_UP, KEY_RIGHT, KEY_RESERVED, KEY_PHONE,
34 +       /* row 1 */
35 +       KEY_DOWN, KEY_LEFT, KEY_VOLUMEUP, KEY_VOLUMEDOWN,
36 +       /* row 2 */
37 +       KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_KPENTER,
38 +};
39 +
40 +static unsigned char e680_direct_keycode[] = {
41 +       KEY_CAMERA,
42 +       KEY_RESERVED,
43 +       KEY_RESERVED,
44 +       KEY_HOME,
45 +       KEY_POWER,
46 +       KEY_MENU,
47 +};
48 +
49 +static int e680_kbd_init(void)
50 +{
51 +       pxa_gpio_mode(93 | GPIO_ALT_FN_1_IN);  /* KP_DKIN<0>, VR Key */
52 +       pxa_gpio_mode(96 | GPIO_ALT_FN_1_IN);  /* KP_DKIN<3>, GAME_A */
53 +       pxa_gpio_mode(97 | GPIO_ALT_FN_1_IN);  /* KP_DKIN<4>, power key */
54 +       pxa_gpio_mode(98 | GPIO_ALT_FN_1_IN);  /* KP_DKIN<5>, GAME_B */
55 +       pxa_gpio_mode(100 | GPIO_ALT_FN_1_IN);  /* KP_MKIN<0> */
56 +       pxa_gpio_mode(101 | GPIO_ALT_FN_1_IN);  /* KP_MKIN<1> */
57 +       pxa_gpio_mode(102 | GPIO_ALT_FN_1_IN);  /* KP_MKIN<2> */
58 +       pxa_gpio_mode(103 | GPIO_ALT_FN_2_OUT); /* KP_MKOUT<0> */
59 +       pxa_gpio_mode(104 | GPIO_ALT_FN_2_OUT); /* KP_MKOUT<1> */
60 +       pxa_gpio_mode(105 | GPIO_ALT_FN_2_OUT); /* KP_MKOUT<2> */
61 +       pxa_gpio_mode(106 | GPIO_ALT_FN_2_OUT); /* KP_MKOUT<3> */
62 +       pxa_gpio_mode(GPIO_TC_MM_EN);
63 +       GPDR(GPIO_TC_MM_EN)   |= GPIO_bit(GPIO_TC_MM_EN);
64 +       GPSR(GPIO_TC_MM_EN)   = GPIO_bit(GPIO_TC_MM_EN);
65 +       PGSR3 |= GPIO_bit(GPIO_TC_MM_EN);
66 +       return 0;
67 +}
68 +
69 +static struct pxakbd_platform_data e680_kbd_platform_data = {
70 +       .init           = &e680_kbd_init,
71 +       .scan_interval  = HZ/40,
72 +       .matrix         = {
73 +               .keycode = e680_keycode,
74 +               .cols   = 4,
75 +               .rows   = 3,
76 +       },
77 +       .direct         = {
78 +               .keycode = e680_direct_keycode,
79 +               .num    = 6,
80 +       },
81 +};
82 +
83  static struct platform_device *devices[] __initdata = {
84  };
85  
86 @@ -162,6 +217,7 @@
87  
88         set_pxa_fb_info(&e680_fb_info);
89         pxa_set_mci_info(&e680_mci_platform_data);
90 +       pxa_set_kbd_info(&e680_kbd_platform_data);
91  
92          /* clear EMU MUX1/MUX2 (low) to close the audio path to EMU */
93         pxa_gpio_mode(GPIO_EMU_MUX1|GPIO_OUT);