4 * This work is licensed under the terms of the GNU GPLv2 or later.
5 * See the COPYING file in the top-level directory.
9 #include <linux/input.h>
11 #include "libpicofe/input.h"
12 #include "libpicofe/linux/in_evdev.h"
13 #include "libpicofe/plat.h"
14 #include "plugin_lib.h"
15 #include "plat_omap.h"
19 static const struct in_default_bind in_evdev_defbinds[] = {
20 { KEY_UP, IN_BINDTYPE_PLAYER12, DKEY_UP },
21 { KEY_DOWN, IN_BINDTYPE_PLAYER12, DKEY_DOWN },
22 { KEY_LEFT, IN_BINDTYPE_PLAYER12, DKEY_LEFT },
23 { KEY_RIGHT, IN_BINDTYPE_PLAYER12, DKEY_RIGHT },
24 { KEY_PAGEUP, IN_BINDTYPE_PLAYER12, DKEY_TRIANGLE },
25 { KEY_PAGEDOWN, IN_BINDTYPE_PLAYER12, DKEY_CROSS },
26 { KEY_END, IN_BINDTYPE_PLAYER12, DKEY_CIRCLE },
27 { KEY_HOME, IN_BINDTYPE_PLAYER12, DKEY_SQUARE },
28 { KEY_LEFTALT, IN_BINDTYPE_PLAYER12, DKEY_START },
29 { KEY_LEFTCTRL, IN_BINDTYPE_PLAYER12, DKEY_SELECT },
30 { KEY_RIGHTSHIFT,IN_BINDTYPE_PLAYER12, DKEY_L1 },
31 { KEY_RIGHTCTRL, IN_BINDTYPE_PLAYER12, DKEY_R1 },
32 { KEY_Q, IN_BINDTYPE_PLAYER12, DKEY_L2 },
33 { KEY_P, IN_BINDTYPE_PLAYER12, DKEY_R2 },
34 { KEY_MENU, IN_BINDTYPE_EMU, SACTION_MINIMIZE },
35 { KEY_SPACE, IN_BINDTYPE_EMU, SACTION_ENTER_MENU },
36 { KEY_1, IN_BINDTYPE_EMU, SACTION_SAVE_STATE },
37 { KEY_2, IN_BINDTYPE_EMU, SACTION_LOAD_STATE },
38 { KEY_3, IN_BINDTYPE_EMU, SACTION_PREV_SSLOT },
39 { KEY_4, IN_BINDTYPE_EMU, SACTION_NEXT_SSLOT },
40 { KEY_5, IN_BINDTYPE_EMU, SACTION_TOGGLE_FSKIP },
41 { KEY_6, IN_BINDTYPE_EMU, SACTION_SCREENSHOT },
42 { KEY_7, IN_BINDTYPE_EMU, SACTION_TOGGLE_FPS },
43 { KEY_8, IN_BINDTYPE_EMU, SACTION_SWITCH_DISPMODE },
44 { KEY_BACKSPACE,IN_BINDTYPE_EMU, SACTION_FAST_FORWARD },
48 static const struct menu_keymap key_pbtn_map[] =
51 { KEY_DOWN, PBTN_DOWN },
52 { KEY_LEFT, PBTN_LEFT },
53 { KEY_RIGHT, PBTN_RIGHT },
55 { KEY_END, PBTN_MOK },
56 { KEY_PAGEDOWN, PBTN_MBACK },
57 { KEY_HOME, PBTN_MA2 },
58 { KEY_PAGEUP, PBTN_MA3 },
59 { KEY_LEFTCTRL, PBTN_MENU },
60 { KEY_RIGHTSHIFT, PBTN_L },
61 { KEY_RIGHTCTRL, PBTN_R },
62 /* "normal" keyboards */
63 { KEY_ENTER, PBTN_MOK },
64 { KEY_ESC, PBTN_MBACK },
65 { KEY_SEMICOLON, PBTN_MA2 },
66 { KEY_APOSTROPHE, PBTN_MA3 },
67 { KEY_BACKSLASH, PBTN_MENU },
68 { KEY_LEFTBRACE, PBTN_L },
69 { KEY_RIGHTBRACE, PBTN_R },
72 static const struct in_pdata pandora_evdev_pdata = {
73 .defbinds = in_evdev_defbinds,
74 .key_map = key_pbtn_map,
75 .kmap_size = sizeof(key_pbtn_map) / sizeof(key_pbtn_map[0]),
83 in_evdev_init(&pandora_evdev_pdata);
85 plat_target_setup_input();
87 in_adev[0] = in_name_to_id("evdev:nub0");
88 in_adev[1] = in_name_to_id("evdev:nub1");
89 in_adev_is_nublike[0] = in_adev_is_nublike[1] = 1;
94 void plat_finish(void)
100 void plat_gvideo_open(int is_pal)
102 plat_target_lcdrate_set(is_pal);
103 plat_target_hwfilter_set(plat_target.hwfilter);
104 plat_target_gamma_set(g_gamma, 0);
106 plat_omap_gvideo_open();
109 void plat_trigger_vibrate(int pad, int low, int high)