From 9a58d7d618869ecf38219eddd971214b117932f9 Mon Sep 17 00:00:00 2001 From: notaz Date: Thu, 9 Dec 2010 15:57:23 +0000 Subject: [PATCH] in_evdev: remove defbinds (should go to plat code) git-svn-id: file:///home/notaz/opt/svn/PicoDrive/platform@907 be3aeb3a-fb24-0410-a615-afba39da0efa --- linux/in_evdev.c | 12 +++++++----- linux/in_evdev.h | 2 ++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/linux/in_evdev.c b/linux/in_evdev.c index 065676b..3fcb5aa 100644 --- a/linux/in_evdev.c +++ b/linux/in_evdev.c @@ -520,6 +520,8 @@ static int in_evdev_menu_translate(void *drv_data, int keycode) return 0; } +/* FIXME: move to plat */ +#if 0 static const struct { short code; char btype; @@ -553,16 +555,16 @@ static const struct { { BTN_PINKIE, IN_BINDTYPE_EMU, PEVB_STATE_LOAD }, { BTN_BASE, IN_BINDTYPE_EMU, PEVB_MENU }, }; - -#define DEF_BIND_COUNT (sizeof(in_evdev_def_binds) / sizeof(in_evdev_def_binds[0])) +#endif static void in_evdev_get_def_binds(int *binds) { int i; - for (i = 0; i < DEF_BIND_COUNT; i++) - binds[IN_BIND_OFFS(in_evdev_def_binds[i].code, in_evdev_def_binds[i].btype)] = - 1 << in_evdev_def_binds[i].bit; + for (i = 0; in_evdev_defbinds[i].bit != 0; i++) { + binds[IN_BIND_OFFS(in_evdev_defbinds[i].code, in_evdev_defbinds[i].btype)] = + 1 << in_evdev_defbinds[i].bit; + } } /* remove binds of missing keys, count remaining ones */ diff --git a/linux/in_evdev.h b/linux/in_evdev.h index 2c24c2e..49682c3 100644 --- a/linux/in_evdev.h +++ b/linux/in_evdev.h @@ -2,3 +2,5 @@ void in_evdev_init(void *vdrv); int in_evdev_update(void *drv_data, const int *binds, int *result); +/* to be set somewhere in platform code */ +extern struct in_default_bind in_evdev_defbinds[]; -- 2.39.2