#define pr_fmt(fmt) …
#include <linux/device.h>
#include <linux/hid.h>
#include <linux/input/mt.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/workqueue.h>
#include "hid-ids.h"
static bool emulate_3button = …;
module_param(emulate_3button, bool, 0644);
MODULE_PARM_DESC(…) …;
static int middle_button_start = …;
static int middle_button_stop = …;
static bool emulate_scroll_wheel = …;
module_param(emulate_scroll_wheel, bool, 0644);
MODULE_PARM_DESC(…) …;
static unsigned int scroll_speed = …;
static int param_set_scroll_speed(const char *val,
const struct kernel_param *kp) { … }
module_param_call(…);
MODULE_PARM_DESC(…) …;
static bool scroll_acceleration = …;
module_param(scroll_acceleration, bool, 0644);
MODULE_PARM_DESC(…) …;
static bool report_undeciphered;
module_param(report_undeciphered, bool, 0644);
MODULE_PARM_DESC(…) …;
#define TRACKPAD2_2021_BT_VERSION …
#define TRACKPAD_REPORT_ID …
#define TRACKPAD2_USB_REPORT_ID …
#define TRACKPAD2_BT_REPORT_ID …
#define MOUSE_REPORT_ID …
#define MOUSE2_REPORT_ID …
#define DOUBLE_REPORT_ID …
#define USB_BATTERY_TIMEOUT_MS …
#define TOUCH_STATE_MASK …
#define TOUCH_STATE_NONE …
#define TOUCH_STATE_START …
#define TOUCH_STATE_DRAG …
#define SCROLL_HR_STEPS …
#define SCROLL_HR_MULT …
#define SCROLL_HR_THRESHOLD …
#define SCROLL_ACCEL_DEFAULT …
#define MOUSE_DIMENSION_X …
#define MOUSE_MIN_X …
#define MOUSE_MAX_X …
#define MOUSE_RES_X …
#define MOUSE_DIMENSION_Y …
#define MOUSE_MIN_Y …
#define MOUSE_MAX_Y …
#define MOUSE_RES_Y …
#define TRACKPAD_DIMENSION_X …
#define TRACKPAD_MIN_X …
#define TRACKPAD_MAX_X …
#define TRACKPAD_RES_X …
#define TRACKPAD_DIMENSION_Y …
#define TRACKPAD_MIN_Y …
#define TRACKPAD_MAX_Y …
#define TRACKPAD_RES_Y …
#define TRACKPAD2_DIMENSION_X …
#define TRACKPAD2_MIN_X …
#define TRACKPAD2_MAX_X …
#define TRACKPAD2_RES_X …
#define TRACKPAD2_DIMENSION_Y …
#define TRACKPAD2_MIN_Y …
#define TRACKPAD2_MAX_Y …
#define TRACKPAD2_RES_Y …
struct magicmouse_sc { … };
static int magicmouse_firm_touch(struct magicmouse_sc *msc)
{ … }
static void magicmouse_emit_buttons(struct magicmouse_sc *msc, int state)
{ … }
static void magicmouse_emit_touch(struct magicmouse_sc *msc, int raw_id, u8 *tdata)
{ … }
static int magicmouse_raw_event(struct hid_device *hdev,
struct hid_report *report, u8 *data, int size)
{ … }
static int magicmouse_event(struct hid_device *hdev, struct hid_field *field,
struct hid_usage *usage, __s32 value)
{ … }
static int magicmouse_setup_input(struct input_dev *input, struct hid_device *hdev)
{ … }
static int magicmouse_input_mapping(struct hid_device *hdev,
struct hid_input *hi, struct hid_field *field,
struct hid_usage *usage, unsigned long **bit, int *max)
{ … }
static int magicmouse_input_configured(struct hid_device *hdev,
struct hid_input *hi)
{ … }
static int magicmouse_enable_multitouch(struct hid_device *hdev)
{ … }
static void magicmouse_enable_mt_work(struct work_struct *work)
{ … }
static int magicmouse_fetch_battery(struct hid_device *hdev)
{ … }
static void magicmouse_battery_timer_tick(struct timer_list *t)
{ … }
static int magicmouse_probe(struct hid_device *hdev,
const struct hid_device_id *id)
{ … }
static void magicmouse_remove(struct hid_device *hdev)
{ … }
static __u8 *magicmouse_report_fixup(struct hid_device *hdev, __u8 *rdesc,
unsigned int *rsize)
{ … }
static const struct hid_device_id magic_mice[] = …;
MODULE_DEVICE_TABLE(hid, magic_mice);
static struct hid_driver magicmouse_driver = …;
module_hid_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;