From: "José Expósito" <jose.exposito89@gmail.com>
To: jikos@kernel.org
Cc: benjamin.tissoires@redhat.com, spbnick@gmail.com,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
"José Expósito" <jose.exposito89@gmail.com>
Subject: [PATCH for-5.18/uclogic 5/9] HID: uclogic: Use different constants for frame report IDs
Date: Sat, 19 Feb 2022 11:01:53 +0100 [thread overview]
Message-ID: <20220219100157.41920-6-jose.exposito89@gmail.com> (raw)
In-Reply-To: <20220219100157.41920-1-jose.exposito89@gmail.com>
From: Nikolai Kondrashov <spbnick@gmail.com>
Allow to set the report ID in UCLOGIC_RDESC_FRAME_BYTES instead of
using a hardcoded value.
Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com>
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
---
drivers/hid/hid-uclogic-rdesc.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/hid/hid-uclogic-rdesc.c b/drivers/hid/hid-uclogic-rdesc.c
index 6e5bef39417e..66aa83f67ccc 100644
--- a/drivers/hid/hid-uclogic-rdesc.c
+++ b/drivers/hid/hid-uclogic-rdesc.c
@@ -654,13 +654,14 @@ const size_t uclogic_rdesc_pen_v2_template_size =
/*
* Expand to the contents of a generic buttonpad report descriptor.
*
+ * @_id: The report ID to use.
* @_size: Size of the report to pad to, including report ID, bytes.
*/
-#define UCLOGIC_RDESC_BUTTONPAD_BYTES(_size) \
+#define UCLOGIC_RDESC_BUTTONPAD_BYTES(_id, _size) \
0x05, 0x01, /* Usage Page (Desktop), */ \
0x09, 0x07, /* Usage (Keypad), */ \
0xA1, 0x01, /* Collection (Application), */ \
- 0x85, 0xF7, /* Report ID (247), */ \
+ 0x85, (_id), /* Report ID (_id), */ \
0x14, /* Logical Minimum (0), */ \
0x25, 0x01, /* Logical Maximum (1), */ \
0x75, 0x01, /* Report Size (1), */ \
@@ -699,14 +700,14 @@ const size_t uclogic_rdesc_pen_v2_template_size =
/* Fixed report descriptor for (tweaked) v1 buttonpad reports */
const __u8 uclogic_rdesc_buttonpad_v1_arr[] = {
- UCLOGIC_RDESC_BUTTONPAD_BYTES(8)
+ UCLOGIC_RDESC_BUTTONPAD_BYTES(UCLOGIC_RDESC_BUTTONPAD_V1_ID, 8)
};
const size_t uclogic_rdesc_buttonpad_v1_size =
sizeof(uclogic_rdesc_buttonpad_v1_arr);
/* Fixed report descriptor for (tweaked) v2 buttonpad reports */
const __u8 uclogic_rdesc_buttonpad_v2_arr[] = {
- UCLOGIC_RDESC_BUTTONPAD_BYTES(12)
+ UCLOGIC_RDESC_BUTTONPAD_BYTES(UCLOGIC_RDESC_BUTTONPAD_V2_ID, 12)
};
const size_t uclogic_rdesc_buttonpad_v2_size =
sizeof(uclogic_rdesc_buttonpad_v2_arr);
--
2.25.1
next prev parent reply other threads:[~2022-02-19 10:02 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-19 10:01 [PATCH for-5.18/uclogic 0/9] DIGImend patches, part II José Expósito
2022-02-19 10:01 ` [PATCH for-5.18/uclogic 1/9] HID: uclogic: Remove pen usage masking José Expósito
2022-02-19 10:01 ` [PATCH for-5.18/uclogic 2/9] HID: uclogic: Replace pen_frame_flag with subreport_list José Expósito
2022-02-19 10:01 ` [PATCH for-5.18/uclogic 3/9] HID: uclogic: Switch to matching subreport bytes José Expósito
2022-02-19 10:01 ` [PATCH for-5.18/uclogic 4/9] HID: uclogic: Specify total report size to buttonpad macro José Expósito
2022-02-19 10:01 ` José Expósito [this message]
2022-02-19 10:01 ` [PATCH for-5.18/uclogic 6/9] HID: uclogic: Use "frame" instead of "buttonpad" José Expósito
2022-02-19 10:01 ` [PATCH for-5.18/uclogic 7/9] HID: uclogic: Put version first in rdesc namespace José Expósito
2022-02-19 10:01 ` [PATCH for-5.18/uclogic 8/9] HID: uclogic: Define report IDs before their descriptors José Expósito
2022-02-19 10:01 ` [PATCH for-5.18/uclogic 9/9] HID: uclogic: Support multiple frame input devices José Expósito
2022-03-01 14:29 ` [PATCH for-5.18/uclogic 0/9] DIGImend patches, part II Jiri Kosina
2022-03-01 14:32 ` Nikolai Kondrashov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220219100157.41920-6-jose.exposito89@gmail.com \
--to=jose.exposito89@gmail.com \
--cc=benjamin.tissoires@redhat.com \
--cc=jikos@kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=spbnick@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®