0
votes

i am writing a linux kernel module which takes N of real /dev/input/js# devices and proxifies them as a single /dev/input/js3 device. Currently my module is creating /dev/input/js3 just fine, jstest is happy with it, but not the real applications. I guess (strace'd) it is so because i have no matching pair of /dev/input/event# for my virtual js3 device. How do i create one from my module?

Here is my module's source, which probably has numerous of issues, but mostly working: https://github.com/iamtakingiteasy/unijoy/blob/master/unijoy.c

1

1 Answers

0
votes

Here is an example, you can use

1. class_create to create the class specified for the device,
2. device_create to create the device node
3. cdev_init to initialize and 
4. cdev_add to add the device to the /dev list

For example you can refer the below link :Create a device node in kernel module