summaryrefslogtreecommitdiff
path: root/include/linux/hid.h
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2018-10-23 13:35:22 +0200
committerJiri Kosina <jkosina@suse.cz>2018-10-23 13:35:22 +0200
commit276e722761a1c7903fbfb065420fd1850b00f1dd (patch)
tree05cb4c39139da6d9132bab9e6b1c2ad7bc47394a /include/linux/hid.h
parent4e7be68e8d0f7bb3c030cdfa442d298457197751 (diff)
parentd9ca1c990a7ffee7e68ab8d64efacd6c73103203 (diff)
Merge branch 'for-4.20/logitech-highres' into for-linus
High-resolution support for hid-logitech
Diffstat (limited to 'include/linux/hid.h')
-rw-r--r--include/linux/hid.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/include/linux/hid.h b/include/linux/hid.h
index d44a78362942..2827b87590d8 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -1139,6 +1139,34 @@ static inline u32 hid_report_len(struct hid_report *report)
int hid_report_raw_event(struct hid_device *hid, int type, u8 *data, u32 size,
int interrupt);
+
+/**
+ * struct hid_scroll_counter - Utility class for processing high-resolution
+ * scroll events.
+ * @dev: the input device for which events should be reported.
+ * @microns_per_hi_res_unit: the amount moved by the user's finger for each
+ * high-resolution unit reported by the mouse, in
+ * microns.
+ * @resolution_multiplier: the wheel's resolution in high-resolution mode as a
+ * multiple of its lower resolution. For example, if
+ * moving the wheel by one "notch" would result in a
+ * value of 1 in low-resolution mode but 8 in
+ * high-resolution, the multiplier is 8.
+ * @remainder: counts the number of high-resolution units moved since the last
+ * low-resolution event (REL_WHEEL or REL_HWHEEL) was sent. Should
+ * only be used by class methods.
+ */
+struct hid_scroll_counter {
+ struct input_dev *dev;
+ int microns_per_hi_res_unit;
+ int resolution_multiplier;
+
+ int remainder;
+};
+
+void hid_scroll_counter_handle_scroll(struct hid_scroll_counter *counter,
+ int hi_res_value);
+
/* HID quirks API */
unsigned long hid_lookup_quirk(const struct hid_device *hdev);
int hid_quirks_init(char **quirks_param, __u16 bus, int count);