#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/input.h>
#include <linux/videodev2.h>
#include <media/v4l2-device.h>
#include <media/v4l2-ioctl.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-event.h>
#include <linux/usb.h>
#include <linux/mutex.h>
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
#define USB_KEENE_VENDOR …
#define USB_KEENE_PRODUCT …
#define BUFFER_LENGTH …
#define USB_TIMEOUT …
#define FREQ_MIN …
#define FREQ_MAX …
#define FREQ_MUL …
static const struct usb_device_id usb_keene_device_table[] = …;
MODULE_DEVICE_TABLE(usb, usb_keene_device_table);
struct keene_device { … };
static inline struct keene_device *to_keene_dev(struct v4l2_device *v4l2_dev)
{ … }
static int keene_cmd_main(struct keene_device *radio, unsigned freq, bool play)
{ … }
static int keene_cmd_set(struct keene_device *radio)
{ … }
static void usb_keene_disconnect(struct usb_interface *intf)
{ … }
static int usb_keene_suspend(struct usb_interface *intf, pm_message_t message)
{ … }
static int usb_keene_resume(struct usb_interface *intf)
{ … }
static int vidioc_querycap(struct file *file, void *priv,
struct v4l2_capability *v)
{ … }
static int vidioc_g_modulator(struct file *file, void *priv,
struct v4l2_modulator *v)
{ … }
static int vidioc_s_modulator(struct file *file, void *priv,
const struct v4l2_modulator *v)
{ … }
static int vidioc_s_frequency(struct file *file, void *priv,
const struct v4l2_frequency *f)
{ … }
static int vidioc_g_frequency(struct file *file, void *priv,
struct v4l2_frequency *f)
{ … }
static int keene_s_ctrl(struct v4l2_ctrl *ctrl)
{ … }
static const struct v4l2_file_operations usb_keene_fops = …;
static const struct v4l2_ctrl_ops keene_ctrl_ops = …;
static const struct v4l2_ioctl_ops usb_keene_ioctl_ops = …;
static void usb_keene_video_device_release(struct v4l2_device *v4l2_dev)
{ … }
static int usb_keene_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{ … }
static struct usb_driver usb_keene_driver = …;
module_usb_driver(…) …;