HID: pidff: Define values used in pidff_find_special_fields
[ Upstream commit 1c12f136891cf4d2d4e6aa202d671a9d2171a716 ] Makes it clear where did these values came from Signed-off-by: Tomasz Pakuła <tomasz.pakula.oficjalny@gmail.com> Reviewed-by: Michał Kopeć <michal@nozomi.space> Reviewed-by: Paul Dino Jones <paul@spacefreak18.xyz> Tested-by: Paul Dino Jones <paul@spacefreak18.xyz> Tested-by: Cristóferson Bueno <cbueno81@gmail.com> Tested-by: Pablo Cisneros <patchkez@protonmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
9cdd95f9a4
commit
7009a060ff
@@ -48,6 +48,14 @@ static const u8 pidff_reports[] = {
|
||||
/* device_control is really 0x95, but 0x96 specified as it is the usage of
|
||||
the only field in that report */
|
||||
|
||||
/* PID special fields */
|
||||
|
||||
#define PID_EFFECT_TYPE 0x25
|
||||
#define PID_DIRECTION 0x57
|
||||
#define PID_EFFECT_OPERATION_ARRAY 0x78
|
||||
#define PID_BLOCK_LOAD_STATUS 0x8b
|
||||
#define PID_DEVICE_CONTROL_ARRAY 0x96
|
||||
|
||||
/* Value usage tables used to put fields and values into arrays */
|
||||
|
||||
#define PID_EFFECT_BLOCK_INDEX 0
|
||||
@@ -1056,23 +1064,24 @@ static int pidff_find_special_fields(struct pidff_device *pidff)
|
||||
|
||||
pidff->create_new_effect_type =
|
||||
pidff_find_special_field(pidff->reports[PID_CREATE_NEW_EFFECT],
|
||||
0x25, 1);
|
||||
PID_EFFECT_TYPE, 1);
|
||||
pidff->set_effect_type =
|
||||
pidff_find_special_field(pidff->reports[PID_SET_EFFECT],
|
||||
0x25, 1);
|
||||
PID_EFFECT_TYPE, 1);
|
||||
pidff->effect_direction =
|
||||
pidff_find_special_field(pidff->reports[PID_SET_EFFECT],
|
||||
0x57, 0);
|
||||
PID_DIRECTION, 0);
|
||||
pidff->device_control =
|
||||
pidff_find_special_field(pidff->reports[PID_DEVICE_CONTROL],
|
||||
0x96, !(pidff->quirks & HID_PIDFF_QUIRK_PERMISSIVE_CONTROL));
|
||||
PID_DEVICE_CONTROL_ARRAY,
|
||||
!(pidff->quirks & HID_PIDFF_QUIRK_PERMISSIVE_CONTROL));
|
||||
|
||||
pidff->block_load_status =
|
||||
pidff_find_special_field(pidff->reports[PID_BLOCK_LOAD],
|
||||
0x8b, 1);
|
||||
PID_BLOCK_LOAD_STATUS, 1);
|
||||
pidff->effect_operation_status =
|
||||
pidff_find_special_field(pidff->reports[PID_EFFECT_OPERATION],
|
||||
0x78, 1);
|
||||
PID_EFFECT_OPERATION_ARRAY, 1);
|
||||
|
||||
hid_dbg(pidff->hid, "search done\n");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user