crucial_oj: add oj driver and modifications needed in gpio_input/event/matrix
diff --git a/drivers/input/misc/gpio_input.c b/drivers/input/misc/gpio_input.c
index 975f4d1..548b5b5 100644
--- a/drivers/input/misc/gpio_input.c
+++ b/drivers/input/misc/gpio_input.c
@@ -21,6 +21,9 @@
#include <linux/interrupt.h>
#include <linux/slab.h>
#include <linux/wakelock.h>
+#ifdef CONFIG_OPTICALJOYSTICK_CRUCIAL
+#include <linux/curcial_oj.h>
+#endif
#ifdef CONFIG_TOUCHSCREEN_SYNAPTICS_3K
static uint8_t power_key_state;
@@ -250,9 +253,20 @@
#ifdef CONFIG_TOUCHSCREEN_SYNAPTICS_3K
handle_power_key_state(key_entry->code, pressed);
#endif
+#ifdef CONFIG_OPTICALJOYSTICK_CRUCIAL
+ if (key_entry->code == BTN_MOUSE) {
+ pr_info("gpio_keys_scan_keys: OJ action key %d-%d, %d (%d) "
+ "changed to %d\n", ds->info->type,
+ key_entry->code, i, key_entry->gpio, pressed);
+ curcial_oj_send_key(BTN_MOUSE, pressed);
+ } else {
+#endif
input_event(ds->input_devs->dev[key_entry->dev], ds->info->type,
key_entry->code, pressed);
sync_needed = true;
+#ifdef CONFIG_OPTICALJOYSTICK_CRUCIAL
+ }
+#endif
}
if (sync_needed) {
for (i = 0; i < ds->input_devs->count; i++)