Skip to content

Commit 2f290b3

Browse files
spbnickJiri Kosina
authored andcommitted
HID: uclogic: Use different constants for frame report IDs
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> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
1 parent ce24010 commit 2f290b3

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

drivers/hid/hid-uclogic-rdesc.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -654,13 +654,14 @@ const size_t uclogic_rdesc_pen_v2_template_size =
654654
/*
655655
* Expand to the contents of a generic buttonpad report descriptor.
656656
*
657+
* @_id: The report ID to use.
657658
* @_size: Size of the report to pad to, including report ID, bytes.
658659
*/
659-
#define UCLOGIC_RDESC_BUTTONPAD_BYTES(_size) \
660+
#define UCLOGIC_RDESC_BUTTONPAD_BYTES(_id, _size) \
660661
0x05, 0x01, /* Usage Page (Desktop), */ \
661662
0x09, 0x07, /* Usage (Keypad), */ \
662663
0xA1, 0x01, /* Collection (Application), */ \
663-
0x85, 0xF7, /* Report ID (247), */ \
664+
0x85, (_id), /* Report ID (_id), */ \
664665
0x14, /* Logical Minimum (0), */ \
665666
0x25, 0x01, /* Logical Maximum (1), */ \
666667
0x75, 0x01, /* Report Size (1), */ \
@@ -699,14 +700,14 @@ const size_t uclogic_rdesc_pen_v2_template_size =
699700

700701
/* Fixed report descriptor for (tweaked) v1 buttonpad reports */
701702
const __u8 uclogic_rdesc_buttonpad_v1_arr[] = {
702-
UCLOGIC_RDESC_BUTTONPAD_BYTES(8)
703+
UCLOGIC_RDESC_BUTTONPAD_BYTES(UCLOGIC_RDESC_BUTTONPAD_V1_ID, 8)
703704
};
704705
const size_t uclogic_rdesc_buttonpad_v1_size =
705706
sizeof(uclogic_rdesc_buttonpad_v1_arr);
706707

707708
/* Fixed report descriptor for (tweaked) v2 buttonpad reports */
708709
const __u8 uclogic_rdesc_buttonpad_v2_arr[] = {
709-
UCLOGIC_RDESC_BUTTONPAD_BYTES(12)
710+
UCLOGIC_RDESC_BUTTONPAD_BYTES(UCLOGIC_RDESC_BUTTONPAD_V2_ID, 12)
710711
};
711712
const size_t uclogic_rdesc_buttonpad_v2_size =
712713
sizeof(uclogic_rdesc_buttonpad_v2_arr);

0 commit comments

Comments
 (0)