#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/usb/input.h>
#include <linux/hid.h>
#include <linux/mutex.h>
#include <linux/input/mt.h>
#define USB_VENDOR_ID_APPLE …
#define USB_DEVICE_ID_APPLE_WELLSPRING_ANSI …
#define USB_DEVICE_ID_APPLE_WELLSPRING_ISO …
#define USB_DEVICE_ID_APPLE_WELLSPRING_JIS …
#define USB_DEVICE_ID_APPLE_WELLSPRING2_ANSI …
#define USB_DEVICE_ID_APPLE_WELLSPRING2_ISO …
#define USB_DEVICE_ID_APPLE_WELLSPRING2_JIS …
#define USB_DEVICE_ID_APPLE_WELLSPRING3_ANSI …
#define USB_DEVICE_ID_APPLE_WELLSPRING3_ISO …
#define USB_DEVICE_ID_APPLE_WELLSPRING3_JIS …
#define USB_DEVICE_ID_APPLE_WELLSPRING4_ANSI …
#define USB_DEVICE_ID_APPLE_WELLSPRING4_ISO …
#define USB_DEVICE_ID_APPLE_WELLSPRING4_JIS …
#define USB_DEVICE_ID_APPLE_WELLSPRING4A_ANSI …
#define USB_DEVICE_ID_APPLE_WELLSPRING4A_ISO …
#define USB_DEVICE_ID_APPLE_WELLSPRING4A_JIS …
#define USB_DEVICE_ID_APPLE_WELLSPRING5_ANSI …
#define USB_DEVICE_ID_APPLE_WELLSPRING5_ISO …
#define USB_DEVICE_ID_APPLE_WELLSPRING5_JIS …
#define USB_DEVICE_ID_APPLE_WELLSPRING6A_ANSI …
#define USB_DEVICE_ID_APPLE_WELLSPRING6A_ISO …
#define USB_DEVICE_ID_APPLE_WELLSPRING6A_JIS …
#define USB_DEVICE_ID_APPLE_WELLSPRING6_ANSI …
#define USB_DEVICE_ID_APPLE_WELLSPRING6_ISO …
#define USB_DEVICE_ID_APPLE_WELLSPRING6_JIS …
#define USB_DEVICE_ID_APPLE_WELLSPRING5A_ANSI …
#define USB_DEVICE_ID_APPLE_WELLSPRING5A_ISO …
#define USB_DEVICE_ID_APPLE_WELLSPRING5A_JIS …
#define USB_DEVICE_ID_APPLE_WELLSPRING7_ANSI …
#define USB_DEVICE_ID_APPLE_WELLSPRING7_ISO …
#define USB_DEVICE_ID_APPLE_WELLSPRING7_JIS …
#define USB_DEVICE_ID_APPLE_WELLSPRING7A_ANSI …
#define USB_DEVICE_ID_APPLE_WELLSPRING7A_ISO …
#define USB_DEVICE_ID_APPLE_WELLSPRING7A_JIS …
#define USB_DEVICE_ID_APPLE_WELLSPRING8_ANSI …
#define USB_DEVICE_ID_APPLE_WELLSPRING8_ISO …
#define USB_DEVICE_ID_APPLE_WELLSPRING8_JIS …
#define USB_DEVICE_ID_APPLE_WELLSPRING9_ANSI …
#define USB_DEVICE_ID_APPLE_WELLSPRING9_ISO …
#define USB_DEVICE_ID_APPLE_WELLSPRING9_JIS …
#define BCM5974_DEVICE(prod) …
static const struct usb_device_id bcm5974_table[] = …;
MODULE_DEVICE_TABLE(usb, bcm5974_table);
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
#define dprintk(level, format, a...) …
static int debug = …;
module_param(debug, int, 0644);
MODULE_PARM_DESC(…) …;
struct bt_data { … };
enum tp_type { … };
#define HEADER_TYPE1 …
#define HEADER_TYPE2 …
#define HEADER_TYPE3 …
#define HEADER_TYPE4 …
#define BUTTON_TYPE1 …
#define BUTTON_TYPE2 …
#define BUTTON_TYPE3 …
#define BUTTON_TYPE4 …
#define HAS_INTEGRATED_BUTTON …
#define FSIZE_TYPE1 …
#define FSIZE_TYPE2 …
#define FSIZE_TYPE3 …
#define FSIZE_TYPE4 …
#define DELTA_TYPE1 …
#define DELTA_TYPE2 …
#define DELTA_TYPE3 …
#define DELTA_TYPE4 …
#define USBMSG_TYPE1 …
#define USBMSG_TYPE2 …
#define USBMSG_TYPE3 …
#define USBMSG_TYPE4 …
#define BCM5974_WELLSPRING_MODE_READ_REQUEST_ID …
#define BCM5974_WELLSPRING_MODE_WRITE_REQUEST_ID …
struct tp_finger { … } __attribute__((packed,aligned …));
#define MAX_FINGERS …
#define MAX_FINGER_ORIENTATION …
struct bcm5974_param { … };
struct bcm5974_config { … };
struct bcm5974 { … };
static const struct tp_finger *get_tp_finger(const struct bcm5974 *dev, int i)
{ … }
#define DATAFORMAT(type) …
#define SN_PRESSURE …
#define SN_WIDTH …
#define SN_COORD …
#define SN_ORIENT …
static const struct bcm5974_config bcm5974_config_table[] = …;
static const struct bcm5974_config *bcm5974_get_config(struct usb_device *udev)
{ … }
static inline int raw2int(__le16 x)
{ … }
static void set_abs(struct input_dev *input, unsigned int code,
const struct bcm5974_param *p)
{ … }
static void setup_events_to_report(struct input_dev *input_dev,
const struct bcm5974_config *cfg)
{ … }
static int report_bt_state(struct bcm5974 *dev, int size)
{ … }
static void report_finger_data(struct input_dev *input, int slot,
const struct input_mt_pos *pos,
const struct tp_finger *f)
{ … }
static void report_synaptics_data(struct input_dev *input,
const struct bcm5974_config *cfg,
const struct tp_finger *f, int raw_n)
{ … }
static int report_tp_state(struct bcm5974 *dev, int size)
{ … }
static int bcm5974_wellspring_mode(struct bcm5974 *dev, bool on)
{ … }
static void bcm5974_irq_button(struct urb *urb)
{ … }
static void bcm5974_irq_trackpad(struct urb *urb)
{ … }
static int bcm5974_start_traffic(struct bcm5974 *dev)
{ … }
static void bcm5974_pause_traffic(struct bcm5974 *dev)
{ … }
static int bcm5974_open(struct input_dev *input)
{ … }
static void bcm5974_close(struct input_dev *input)
{ … }
static int bcm5974_suspend(struct usb_interface *iface, pm_message_t message)
{ … }
static int bcm5974_resume(struct usb_interface *iface)
{ … }
static int bcm5974_probe(struct usb_interface *iface,
const struct usb_device_id *id)
{ … }
static void bcm5974_disconnect(struct usb_interface *iface)
{ … }
static struct usb_driver bcm5974_driver = …;
module_usb_driver(…) …;