#define pr_fmt(fmt) …
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/ktime.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/uaccess.h>
#include <linux/ratelimit.h>
#include <linux/input.h>
#include <linux/usb.h>
#include <linux/usb/input.h>
#include <media/rc-core.h>
#include <linux/timer.h>
#define MOD_AUTHOR …
#define MOD_DESC …
#define MOD_NAME …
#define MOD_VERSION …
#define DISPLAY_MINOR_BASE …
#define DEVICE_NAME …
#define BUF_CHUNK_SIZE …
#define BUF_SIZE …
#define BIT_DURATION …
#define IMON_CLOCK_ENABLE_PACKETS …
static int imon_probe(struct usb_interface *interface,
const struct usb_device_id *id);
static void imon_disconnect(struct usb_interface *interface);
static void usb_rx_callback_intf0(struct urb *urb);
static void usb_rx_callback_intf1(struct urb *urb);
static void usb_tx_callback(struct urb *urb);
static int imon_resume(struct usb_interface *intf);
static int imon_suspend(struct usb_interface *intf, pm_message_t message);
static int display_open(struct inode *inode, struct file *file);
static int display_close(struct inode *inode, struct file *file);
static ssize_t vfd_write(struct file *file, const char __user *buf,
size_t n_bytes, loff_t *pos);
static ssize_t lcd_write(struct file *file, const char __user *buf,
size_t n_bytes, loff_t *pos);
struct imon_panel_key_table { … };
struct imon_usb_dev_descr { … };
struct imon_context { … };
#define TOUCH_TIMEOUT …
static const struct file_operations vfd_fops = …;
static const struct file_operations lcd_fops = …;
enum { … };
enum { … };
static struct usb_class_driver imon_vfd_class = …;
static struct usb_class_driver imon_lcd_class = …;
static const struct imon_usb_dev_descr imon_default_table = …;
static const struct imon_usb_dev_descr imon_OEM_VFD = …;
static const struct imon_usb_dev_descr imon_DH102 = …;
static const struct imon_usb_dev_descr ultrabay_table = …;
static const struct usb_device_id imon_usb_id_table[] = …;
static struct usb_driver imon_driver = …;
MODULE_AUTHOR(…);
MODULE_DESCRIPTION(…);
MODULE_VERSION(…);
MODULE_LICENSE(…) …;
MODULE_DEVICE_TABLE(usb, imon_usb_id_table);
static bool debug;
module_param(debug, bool, S_IRUGO | S_IWUSR);
MODULE_PARM_DESC(…) …;
static int display_type;
module_param(display_type, int, S_IRUGO);
MODULE_PARM_DESC(…) …;
static int pad_stabilize = …;
module_param(pad_stabilize, int, S_IRUGO | S_IWUSR);
MODULE_PARM_DESC(…) …;
static bool nomouse;
module_param(nomouse, bool, S_IRUGO | S_IWUSR);
MODULE_PARM_DESC(…) …;
static int pad_thresh;
module_param(pad_thresh, int, S_IRUGO | S_IWUSR);
MODULE_PARM_DESC(…) …;
static void free_imon_context(struct imon_context *ictx)
{ … }
static int display_open(struct inode *inode, struct file *file)
{ … }
static int display_close(struct inode *inode, struct file *file)
{ … }
static int send_packet(struct imon_context *ictx)
{ … }
static int send_associate_24g(struct imon_context *ictx)
{ … }
static int send_set_imon_clock(struct imon_context *ictx,
unsigned int year, unsigned int month,
unsigned int day, unsigned int dow,
unsigned int hour, unsigned int minute,
unsigned int second)
{ … }
static ssize_t associate_remote_show(struct device *d,
struct device_attribute *attr,
char *buf)
{ … }
static ssize_t associate_remote_store(struct device *d,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static ssize_t imon_clock_show(struct device *d,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t imon_clock_store(struct device *d,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR_RW(imon_clock);
static DEVICE_ATTR_RW(associate_remote);
static struct attribute *imon_display_sysfs_entries[] = …;
static const struct attribute_group imon_display_attr_group = …;
static struct attribute *imon_rf_sysfs_entries[] = …;
static const struct attribute_group imon_rf_attr_group = …;
static ssize_t vfd_write(struct file *file, const char __user *buf,
size_t n_bytes, loff_t *pos)
{ … }
static ssize_t lcd_write(struct file *file, const char __user *buf,
size_t n_bytes, loff_t *pos)
{ … }
static void usb_tx_callback(struct urb *urb)
{ … }
static void imon_touch_display_timeout(struct timer_list *t)
{ … }
static int imon_ir_change_protocol(struct rc_dev *rc, u64 *rc_proto)
{ … }
static int stabilize(int a, int b, u16 timeout, u16 threshold)
{ … }
static u32 imon_remote_key_lookup(struct imon_context *ictx, u32 scancode)
{ … }
static u32 imon_mce_key_lookup(struct imon_context *ictx, u32 scancode)
{ … }
static u32 imon_panel_key_lookup(struct imon_context *ictx, u64 code)
{ … }
static bool imon_mouse_event(struct imon_context *ictx,
unsigned char *buf, int len)
{ … }
static void imon_touch_event(struct imon_context *ictx, unsigned char *buf)
{ … }
static void imon_pad_to_keys(struct imon_context *ictx, unsigned char *buf)
{ … }
static int imon_parse_press_type(struct imon_context *ictx,
unsigned char *buf, u8 ktype)
{ … }
static void imon_incoming_packet(struct imon_context *ictx,
struct urb *urb, int intf)
{ … }
static void usb_rx_callback_intf0(struct urb *urb)
{ … }
static void usb_rx_callback_intf1(struct urb *urb)
{ … }
static void imon_get_ffdc_type(struct imon_context *ictx)
{ … }
static void imon_set_display_type(struct imon_context *ictx)
{ … }
static struct rc_dev *imon_init_rdev(struct imon_context *ictx)
{ … }
static struct input_dev *imon_init_idev(struct imon_context *ictx)
{ … }
static struct input_dev *imon_init_touch(struct imon_context *ictx)
{ … }
static bool imon_find_endpoints(struct imon_context *ictx,
struct usb_host_interface *iface_desc)
{ … }
static struct imon_context *imon_init_intf0(struct usb_interface *intf,
const struct usb_device_id *id)
{ … }
static struct imon_context *imon_init_intf1(struct usb_interface *intf,
struct imon_context *ictx)
{ … }
static void imon_init_display(struct imon_context *ictx,
struct usb_interface *intf)
{ … }
static int imon_probe(struct usb_interface *interface,
const struct usb_device_id *id)
{ … }
static void imon_disconnect(struct usb_interface *interface)
{ … }
static int imon_suspend(struct usb_interface *intf, pm_message_t message)
{ … }
static int imon_resume(struct usb_interface *intf)
{ … }
module_usb_driver(…) …;