From 9b4bd105989e1186ca09d93e70d14484a528a238 Mon Sep 17 00:00:00 2001 From: notaz Date: Tue, 6 Dec 2011 01:49:54 +0200 Subject: [PATCH] frontend: get rid of plat_rescan_inputs overannoyed by 'input: bad key' messages --- frontend/main.c | 1 - frontend/menu.c | 4 ++-- frontend/plat.h | 4 +++- frontend/plat_dummy.c | 5 ----- frontend/plat_omap.c | 2 ++ frontend/plat_pandora.c | 2 +- frontend/plat_pollux.c | 20 +++++++++++--------- 7 files changed, 19 insertions(+), 19 deletions(-) diff --git a/frontend/main.c b/frontend/main.c index 41e48b79..c902142d 100644 --- a/frontend/main.c +++ b/frontend/main.c @@ -363,7 +363,6 @@ int main(int argc, char *argv[]) plat_init(); menu_init(); // loads config pl_init(); - plat_rescan_inputs(); if (psxout) Config.PsxOut = 1; diff --git a/frontend/menu.c b/frontend/menu.c index af9b9f1d..53f296a2 100644 --- a/frontend/menu.c +++ b/frontend/menu.c @@ -171,7 +171,7 @@ static void menu_sync_config(void) default: in_type2 = PSE_PAD_TYPE_STANDARD; } if (in_evdev_allow_abs_only != allow_abs_only_old) { - plat_rescan_inputs(); + in_probe(); allow_abs_only_old = in_evdev_allow_abs_only; } @@ -960,7 +960,7 @@ static int mh_savecfg(int id, int keys) static int mh_input_rescan(int id, int keys) { //menu_sync_config(); - plat_rescan_inputs(); + in_probe(); me_update_msg("rescan complete."); return 0; diff --git a/frontend/plat.h b/frontend/plat.h index af984b69..185ee98c 100644 --- a/frontend/plat.h +++ b/frontend/plat.h @@ -1,6 +1,8 @@ void *plat_prepare_screenshot(int *w, int *h, int *bpp); -int plat_rescan_inputs(void); void plat_step_volume(int is_up); int plat_cpu_clock_get(void); int plat_cpu_clock_apply(int cpu_clock); int plat_get_bat_capacity(void); + +// XXX +int plat_pandora_init(void); diff --git a/frontend/plat_dummy.c b/frontend/plat_dummy.c index 957eb3e9..78a942b7 100644 --- a/frontend/plat_dummy.c +++ b/frontend/plat_dummy.c @@ -53,11 +53,6 @@ void *plat_prepare_screenshot(int *w, int *h, int *bpp) return 0; } -int plat_rescan_inputs(void) -{ - return -1; -} - int plat_cpu_clock_get(void) { return -1; diff --git a/frontend/plat_omap.c b/frontend/plat_omap.c index f168a5f4..5474bda0 100644 --- a/frontend/plat_omap.c +++ b/frontend/plat_omap.c @@ -177,6 +177,8 @@ void plat_init(void) } g_menubg_ptr = temp_frame; + plat_pandora_init(); // XXX + return; fail1: diff --git a/frontend/plat_pandora.c b/frontend/plat_pandora.c index d7837ce7..d0cca898 100644 --- a/frontend/plat_pandora.c +++ b/frontend/plat_pandora.c @@ -153,7 +153,7 @@ void in_update_analogs(void) //printf("%4d %4d %4d %4d\n", in_a1[0], in_a1[1], in_a2[0], in_a2[1]); } -int plat_rescan_inputs(void) +int plat_pandora_init(void) { in_probe(); in_set_config(in_name_to_id("evdev:gpio-keys"), IN_CFG_KEY_NAMES, diff --git a/frontend/plat_pollux.c b/frontend/plat_pollux.c index 3d43f83f..a5e62f71 100644 --- a/frontend/plat_pollux.c +++ b/frontend/plat_pollux.c @@ -59,6 +59,9 @@ int omap_enable_layer(int enabled) return 0; } +static void caanoo_init(void); + + static void *fb_flip(void) { memregl[0x406C>>2] = memregl[0x446C>>2] = fb_paddrs[fb_work_buf]; @@ -586,6 +589,11 @@ void plat_init(void) in_gp2x_init(); } + in_tsbutton_init(); + in_probe(); + if (gp2x_dev_id == GP2X_DEV_CAANOO) + caanoo_init(); + mixerdev = open("/dev/mixer", O_RDWR); if (mixerdev == -1) perror("open(/dev/mixer)"); @@ -598,8 +606,6 @@ void plat_init(void) psx_width = 320; psx_height = 240; psx_bpp = 16; - - in_tsbutton_init(); } void plat_finish(void) @@ -714,12 +720,8 @@ void plat_step_volume(int is_up) // unused dummy for in_gp2x volatile unsigned short *gp2x_memregs; -int plat_rescan_inputs(void) +static void caanoo_init(void) { - in_probe(); - if (gp2x_dev_id == GP2X_DEV_CAANOO) - in_set_config(in_name_to_id("evdev:pollux-analog"), IN_CFG_KEY_NAMES, - caanoo_keys, sizeof(caanoo_keys)); - - return 0; + in_set_config(in_name_to_id("evdev:pollux-analog"), IN_CFG_KEY_NAMES, + caanoo_keys, sizeof(caanoo_keys)); } -- 2.39.5