#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>
#define DRIVER_AUTHOR …
#define DRIVER_DESC …
#define DRIVER_VERSION …
MODULE_AUTHOR(…);
MODULE_DESCRIPTION(…);
MODULE_LICENSE(…) …;
MODULE_VERSION(…);
#define USB_MA901_VENDOR …
#define USB_MA901_PRODUCT …
#define MA901_DRIVER_NAME …
#define ma901radio_dev_warn(dev, fmt, arg...) …
#define ma901radio_dev_err(dev, fmt, arg...) …
#define BUFFER_LENGTH …
#define USB_TIMEOUT …
#define FREQ_MIN …
#define FREQ_MAX …
#define FREQ_MUL …
#define MA901_VOLUME_MAX …
#define MA901_VOLUME_MIN …
#define MA901_RADIO_SET_FREQ …
#define MA901_RADIO_SET_VOLUME …
#define MA901_RADIO_SET_MONO_STEREO …
#define MA901_WANT_STEREO …
#define MA901_WANT_MONO …
static int radio_nr = …;
module_param(radio_nr, int, 0);
MODULE_PARM_DESC(…) …;
struct ma901radio_device { … };
static inline struct ma901radio_device *to_ma901radio_dev(struct v4l2_device *v4l2_dev)
{ … }
static int ma901radio_set_freq(struct ma901radio_device *radio, int freq)
{ … }
static int ma901radio_set_volume(struct ma901radio_device *radio, u16 vol_to_set)
{ … }
static int ma901_set_stereo(struct ma901radio_device *radio, u8 stereo)
{ … }
static void usb_ma901radio_disconnect(struct usb_interface *intf)
{ … }
static int vidioc_querycap(struct file *file, void *priv,
struct v4l2_capability *v)
{ … }
static int vidioc_g_tuner(struct file *file, void *priv,
struct v4l2_tuner *v)
{ … }
static int vidioc_s_tuner(struct file *file, void *priv,
const struct v4l2_tuner *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 usb_ma901radio_s_ctrl(struct v4l2_ctrl *ctrl)
{ … }
static int usb_ma901radio_suspend(struct usb_interface *intf, pm_message_t message)
{ … }
static int usb_ma901radio_resume(struct usb_interface *intf)
{ … }
static const struct v4l2_ctrl_ops usb_ma901radio_ctrl_ops = …;
static const struct v4l2_file_operations usb_ma901radio_fops = …;
static const struct v4l2_ioctl_ops usb_ma901radio_ioctl_ops = …;
static void usb_ma901radio_release(struct v4l2_device *v4l2_dev)
{ … }
static int usb_ma901radio_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{ … }
static const struct usb_device_id usb_ma901radio_device_table[] = …;
MODULE_DEVICE_TABLE(usb, usb_ma901radio_device_table);
static struct usb_driver usb_ma901radio_driver = …;
module_usb_driver(…) …;