Writing a simple USB device driver that detects an USB device in Linux

1 · Dan Näsman · Jan. 21, 2024, 2:42 p.m.
Introduction I have spent the past week building my own Linux distribution for Rasbperry Pi 4 following the PiLFS guide. After managing to successfully boot the distribution I decided to try writing an USB device driver that detects when my Wacom drawing tablet is plugged. Driver code The code for the module was taken from here. In wacom_register.c: #include <linux/module.h> #include <linux/kernel.h> #include <linux/usb.h> static int wacom_probe(struct usb_interface *interface, const struct usb...