int pandora_rescan_inputs(void) { in_probe(); in_set_config(in_name_to_id("evdev:gpio-keys"), IN_CFG_KEY_NAMES, pandora_gpio_keys, sizeof(pandora_gpio_keys)); return 0; }
int plat_pandora_init(void) { in_probe(); in_set_config(in_name_to_id("evdev:gpio-keys"), IN_CFG_KEY_NAMES, pandora_gpio_keys, sizeof(pandora_gpio_keys)); in_adev[0] = in_name_to_id("evdev:nub0"); in_adev[1] = in_name_to_id("evdev:nub1"); return 0; }
void plat_init(void) { const char *main_fb_name, *layer_fb_name; void *temp_frame; int fd, ret, w, h; main_fb_name = getenv("FBDEV_MAIN"); if (main_fb_name == NULL) main_fb_name = "/dev/fb0"; layer_fb_name = getenv("FBDEV_LAYER"); if (layer_fb_name == NULL) layer_fb_name = "/dev/fb1"; // must set the layer up first to be able to use it fd = open(layer_fb_name, O_RDWR); if (fd == -1) { fprintf(stderr, "%s: ", layer_fb_name); perror("open"); exit(1); } ret = omap_setup_layer_(fd, 0, g_layer_x, g_layer_y, g_layer_w, g_layer_h, 1); close(fd); if (ret != 0) { fprintf(stderr, "failed to set up layer, exiting.\n"); exit(1); } oshide_init(); w = h = 0; main_fb = vout_fbdev_init(main_fb_name, &w, &h, 16, 2); if (main_fb == NULL) { fprintf(stderr, "couldn't init fb: %s\n", main_fb_name); exit(1); } g_menuscreen_w = w; g_menuscreen_h = h; g_menuscreen_ptr = vout_fbdev_flip(main_fb); w = 640; h = 512; // ?? layer_fb = vout_fbdev_init(layer_fb_name, &w, &h, 16, 3); if (layer_fb == NULL) { fprintf(stderr, "couldn't init fb: %s\n", layer_fb_name); goto fail0; } temp_frame = calloc(g_menuscreen_w * g_menuscreen_h * 2, 1); if (temp_frame == NULL) { fprintf(stderr, "OOM\n"); goto fail1; } g_menubg_ptr = temp_frame; in_set_config(in_name_to_id("evdev:gpio-keys"), IN_CFG_KEY_NAMES, pandora_gpio_keys, sizeof(pandora_gpio_keys)); return; fail1: vout_fbdev_finish(layer_fb); fail0: vout_fbdev_finish(main_fb); exit(1); }