linux/drivers/hid/hid-magicmouse.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 *   Apple "Magic" Wireless Mouse driver
 *
 *   Copyright (c) 2010 Michael Poole <[email protected]>
 *   Copyright (c) 2010 Chase Douglas <[email protected]>
 */

/*
 */

#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

/* These definitions are not precise, but they're close enough.  (Bits
 * 0x03 seem to indicate the aspect ratio of the touch, bits 0x70 seem
 * to be some kind of bit mask -- 0x20 may be a near-field reading,
 * and 0x40 is actual contact, and 0x10 may be a start/stop or change
 * indication.)
 */
#define TOUCH_STATE_MASK
#define TOUCH_STATE_NONE
#define TOUCH_STATE_START
#define TOUCH_STATE_DRAG

/* Number of high-resolution events for each low-resolution detent. */
#define SCROLL_HR_STEPS
#define SCROLL_HR_MULT
#define SCROLL_HR_THRESHOLD
#define SCROLL_ACCEL_DEFAULT

/* Touch surface information. Dimension is in hundredths of a mm, min and max
 * are in units. */
#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 - Tracks Magic Mouse-specific data.
 * @input: Input device through which we report events.
 * @quirks: Currently unused.
 * @ntouches: Number of touches in most recent touch report.
 * @scroll_accel: Number of consecutive scroll motions.
 * @scroll_jiffies: Time of last scroll motion.
 * @touches: Most recent data for a touch, indexed by tracking ID.
 * @tracking_ids: Mapping of current touch input data to @touches.
 * @hdev: Pointer to the underlying HID device.
 * @work: Workqueue to handle initialization retry for quirky devices.
 * @battery_timer: Timer for obtaining battery level information.
 */
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();