Re: [PATCH v5 3/5] HID: google: extract Vivaldi hid feature mapping for use in hid-hammer
From: Stephen Boyd <hidden>
Date: 2022-02-28 20:56:12
Quoting Dmitry Torokhov (2022-02-27 23:54:44)
quoted hunk ↗ jump to hunk
diff --git a/drivers/hid/hid-vivaldi-common.c b/drivers/hid/hid-vivaldi-common.c new file mode 100644 index 000000000000..c88b26f4c78b --- /dev/null +++ b/drivers/hid/hid-vivaldi-common.c@@ -0,0 +1,140 @@ +// SPDX-License-Identifier: GPL-2.0
[...]
+/** + * vivaldi_feature_mapping - Fill out vivaldi keymap data exposed via HID + * @hdev: HID device to parse + * @field: HID field to parse + * @usage: HID usage to parse + * + * This function assumes that driver data attached to @hdev contains an
Maybe add Note: This function assumes ...
+ * instance of &struct vivaldi_data in the very beginning.
It makes me nervous that this can't be checked statically but OK.
+ */
+void vivaldi_feature_mapping(struct hid_device *hdev,
+ struct hid_field *field, struct hid_usage *usage)
+{
+ struct vivaldi_data *data = hid_get_drvdata(hdev);
+ struct hid_report *report = field->report;
+ u8 *report_data, *buf;
+ u32 report_len;
+ unsigned int fn_key;
+ int ret;[...]
+
+static DEVICE_ATTR_RO(function_row_physmap);
+static struct attribute *vivaldi_sysfs_attrs[] = {
+ &dev_attr_function_row_physmap.attr,
+ NULL
+};
+
+static const struct attribute_group vivaldi_attribute_group = {
+ .attrs = vivaldi_sysfs_attrs,
+};
+
+/**
+ * vivaldi_feature_mapping - Complete initialization of device using vivaldi mapvivaldi_input_configured
+ * @hdev: HID device to witch vivaldi attributes should be attached
s/witch/which/
+ * @hidinput: HID input device (unused).
Drop the period? It's not on the hdev argument description above.
+ */ +int vivaldi_input_configured(struct hid_device *hdev, + struct hid_input *hidinput)