From d995044b0f4a04297f5ccb80291427caeaac773e Mon Sep 17 00:00:00 2001 From: knolax <1339802534.kk@gmail.com> Date: Wed, 13 Dec 2017 21:18:19 -0500 Subject: added more metadata to skey_dev, also added __initdata to some variables --- skey.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'skey.c') diff --git a/skey.c b/skey.c index 427f3e4..2ef5825 100644 --- a/skey.c +++ b/skey.c @@ -5,6 +5,7 @@ #include #include #include +#include #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); -- cgit v1.1