rk29: timer: disable write buffer
[firefly-linux-kernel-4.4.55.git] / arch / arm / mach-rk29 / board-rk29-newton-key.c
1 #include <mach/key.h>
2 #include <mach/gpio.h>
3 #include <mach/board.h>
4
5 #define EV_ENCALL                               KEY_F4
6 #define EV_MENU                                 KEY_F1
7
8 #define PRESS_LEV_LOW                   1
9 #define PRESS_LEV_HIGH                  0
10
11 static struct rk29_keys_button key_button[] = {
12         {
13                 .desc   = "menu",
14                 .code   = EV_MENU,
15                 .gpio   = RK29_PIN6_PA3,  // PA0--> PA3: home -> menu
16                 .active_low = PRESS_LEV_LOW,
17         },
18         {
19                 .desc   = "vol+",
20                 .code   = KEY_VOLUMEUP,
21                 .gpio   = RK29_PIN6_PA2,
22                 .active_low = PRESS_LEV_LOW,
23         },
24         {
25                 .desc   = "vol-",
26                 .code   = KEY_VOLUMEDOWN,
27                 .gpio   = RK29_PIN6_PA1,
28                 .active_low = PRESS_LEV_LOW,
29         },
30         {
31                 .desc   = "home",
32                 .code   = KEY_HOME,
33                 .gpio   = RK29_PIN6_PA5,  //PA3 --> PA5
34                 .active_low = PRESS_LEV_LOW,
35         },
36         {
37                 .desc   = "search",
38                 .code   = KEY_SEARCH,
39                 .gpio   = RK29_PIN6_PA4,
40                 .active_low = PRESS_LEV_LOW,
41         },
42         {
43                 .desc   = "esc",
44                 .code   = KEY_BACK,
45                 .gpio   = RK29_PIN6_PA0, //PA5-->PA0: menu-> esc
46                 .active_low = PRESS_LEV_LOW,
47         },
48         {
49                 .desc   = "sensor",
50                 .code   = KEY_CAMERA,
51                 .gpio   = RK29_PIN6_PA6,
52                 .active_low = PRESS_LEV_LOW,
53         },
54         {
55                 .desc   = "play",
56                 .code   = KEY_POWER,
57                 .gpio   = RK29_PIN6_PA7,
58                 .active_low = PRESS_LEV_LOW,
59                 //.code_long_press = EV_ENCALL,
60                 .wakeup = 1,
61         },
62 #if 0
63         {
64                 .desc   = "vol+",
65                 .code   = KEY_VOLUMEDOWN,
66                 .adc_value      = 95,
67                 .gpio = INVALID_GPIO,
68                 .active_low = PRESS_LEV_LOW,
69         },
70         {
71                 .desc   = "vol-",
72                 .code   = KEY_VOLUMEUP,
73                 .adc_value      = 249,
74                 .gpio = INVALID_GPIO,
75                 .active_low = PRESS_LEV_LOW,
76         },
77         {
78                 .desc   = "menu",
79                 .code   = EV_MENU,
80                 .adc_value      = 406,
81                 .gpio = INVALID_GPIO,
82                 .active_low = PRESS_LEV_LOW,
83         },
84         {
85                 .desc   = "home",
86                 .code   = KEY_HOME,
87                 .code_long_press = KEY_F4,
88                 .adc_value      = 561,
89                 .gpio = INVALID_GPIO,
90                 .active_low = PRESS_LEV_LOW,
91         },
92         {
93                 .desc   = "esc",
94                 .code   = KEY_ESC,
95                 .adc_value      = 726,
96                 .gpio = INVALID_GPIO,
97                 .active_low = PRESS_LEV_LOW,
98         },
99         {
100                 .desc   = "adkey6",
101                 .code   = KEY_BACK,
102                 .code_long_press = EV_ENCALL,
103                 .adc_value      = 899,
104                 .gpio = INVALID_GPIO,
105                 .active_low = PRESS_LEV_LOW,
106         },
107 #endif
108 };
109 struct rk29_keys_platform_data rk29_keys_pdata = {
110         .buttons        = key_button,
111         .nbuttons       = ARRAY_SIZE(key_button),
112         .chn    = -1,  //chn: 0-7, if do not use ADC,set 'chn' -1
113 };
114