crucial_oj: add oj driver and modifications needed in gpio_input/event/matrix
diff --git a/drivers/input/misc/gpio_matrix.c b/drivers/input/misc/gpio_matrix.c
index eaa9e89..cfa6170 100644
--- a/drivers/input/misc/gpio_matrix.c
+++ b/drivers/input/misc/gpio_matrix.c
@@ -20,6 +20,10 @@
#include <linux/interrupt.h>
#include <linux/slab.h>
#include <linux/wakelock.h>
+#ifdef CONFIG_OPTICALJOYSTICK_CRUCIAL
+#include <asm/mach-types.h>
+#include <linux/curcial_oj.h>
+#endif
struct gpio_kp {
struct gpio_event_input_devs *input_devs;
@@ -111,6 +115,9 @@
unsigned short keyentry = mi->keymap[key_index];
unsigned short keycode = keyentry & MATRIX_KEY_MASK;
unsigned short dev = keyentry >> MATRIX_CODE_BITS;
+#ifdef CONFIG_OPTICALJOYSTICK_CRUCIAL
+ static unsigned need_send_spec_key = 1;
+#endif
if (pressed != test_bit(keycode, kp->input_devs->dev[dev]->key)) {
if (keycode == KEY_RESERVED) {
@@ -125,9 +132,22 @@
"changed to %d\n", keycode,
out, in, mi->output_gpios[out],
mi->input_gpios[in], pressed);
+#ifdef CONFIG_OPTICALJOYSTICK_CRUCIAL
+ if (!(mi->info.oj_btn && keycode == BTN_MOUSE))
+#endif
input_report_key(kp->input_devs->dev[dev], keycode, pressed);
}
}
+#ifdef CONFIG_OPTICALJOYSTICK_CRUCIAL
+ if (mi->info.oj_btn && keycode == BTN_MOUSE) {
+ if (need_send_spec_key == pressed) {
+ curcial_oj_send_key(keycode, pressed);
+ need_send_spec_key = !pressed;
+ pr_info("%s: send OJ action key, pressed: %d\n",
+ __func__, pressed);
+ }
+ }
+#endif
}
static void report_sync(struct gpio_kp *kp)