// SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (c) 2000-2001 Vojtech Pavlik * Copyright (c) 2000 Mark Fletcher */ /* * Gravis Stinger gamepad driver for Linux */ #include <linux/kernel.h> #include <linux/module.h> #include <linux/slab.h> #include <linux/input.h> #include <linux/serio.h> #define DRIVER_DESC … MODULE_AUTHOR(…) …; MODULE_DESCRIPTION(…); MODULE_LICENSE(…) …; /* * Constants. */ #define STINGER_MAX_LENGTH … /* * Per-Stinger data. */ struct stinger { … }; /* * stinger_process_packet() decodes packets the driver receives from the * Stinger. It updates the data accordingly. */ static void stinger_process_packet(struct stinger *stinger) { … } /* * stinger_interrupt() is called by the low level driver when characters * are ready for us. We then buffer them for further processing, or call the * packet processing routine. */ static irqreturn_t stinger_interrupt(struct serio *serio, unsigned char data, unsigned int flags) { … } /* * stinger_disconnect() is the opposite of stinger_connect() */ static void stinger_disconnect(struct serio *serio) { … } /* * stinger_connect() is the routine that is called when someone adds a * new serio device that supports Stinger protocol and registers it as * an input device. */ static int stinger_connect(struct serio *serio, struct serio_driver *drv) { … } /* * The serio driver structure. */ static const struct serio_device_id stinger_serio_ids[] = …; MODULE_DEVICE_TABLE(serio, stinger_serio_ids); static struct serio_driver stinger_drv = …; module_serio_driver(…) …;