summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorknolax <1339802534.kk@gmail.com>2017-12-13 21:18:19 -0500
committerknolax <1339802534.kk@gmail.com>2017-12-13 21:18:19 -0500
commitd995044b0f4a04297f5ccb80291427caeaac773e (patch)
tree565730887e4e5842b5ce5c782d7604751581ed2d
parentc7eeb9eeecc6daaf5e7f0e6b54847f9a2caaa2d7 (diff)
added more metadata to skey_dev, also added __initdata to some variables
-rw-r--r--skey.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/skey.c b/skey.c
index 427f3e4..2ef5825 100644
--- a/skey.c
+++ b/skey.c
@@ -5,6 +5,7 @@
#include <linux/kthread.h>
#include <linux/delay.h>
#include <linux/sched.h>
+#include <linux/input.h>
#include "keymap.h"
/*
* defines whether to access the gpios so other parts of the kernel module can
@@ -26,12 +27,16 @@ static __initdata char * rlabels[3] = {"R0", "R1", "R2"};
* task struct for setting up the thread
*/
-static struct task_struct *update_task;
+__initdata static struct task_struct *update_task;
/*
* input.h input device
*/
-struct input_dev * skey_dev;
-
+__initdata struct input_dev * skey_dev;
+/*
+ * Name and ID
+ */
+__initdata struct input_id skey_id;
+__initdata char * skey_name = "Switch Keyboard for the Omnicom";
/*
*This function is called every timer-period to actually read the keyboard
*/
@@ -144,6 +149,14 @@ static int __init skey_init (void) {
set_bit(EV_KEY, skey_dev->evbit);
set_bit(EV_REL, skey_dev->evbit);
set_bit(KEY_CAPSLOCK, skey_dev->keybit);
+ //sets the name of skey_dev
+ skey_dev->name = skey_name;
+ //sets ids
+ skey_id.bustype = BUS_HOST;
+ skey_id.vendor = 13398;
+ skey_id.product = 13398;
+ skey_id.version = 1;
+ skey_dev->id = skey_id;
// registers the device
if (input_register_device(skey_dev)) {
input_free_device(skey_dev);