mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-21 22:21:21 +00:00
Input: allow matching device IDs on property bits
Let's allow matching input devices on their property bits, both in-kernel and when generating module aliases. Tested-by: Roderick Colenbrander <roderick.colenbrander@sony.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
This commit is contained in:
parent
55dfce873d
commit
8724ecb072
5 changed files with 15 additions and 2 deletions
|
@ -761,7 +761,7 @@ static void do_input(char *alias,
|
|||
sprintf(alias + strlen(alias), "%X,*", i);
|
||||
}
|
||||
|
||||
/* input:b0v0p0e0-eXkXrXaXmXlXsXfXwX where X is comma-separated %02X. */
|
||||
/* input:b0v0p0e0-eXkXrXaXmXlXsXfXwXprX where X is comma-separated %02X. */
|
||||
static int do_input_entry(const char *filename, void *symval,
|
||||
char *alias)
|
||||
{
|
||||
|
@ -779,6 +779,7 @@ static int do_input_entry(const char *filename, void *symval,
|
|||
DEF_FIELD_ADDR(symval, input_device_id, sndbit);
|
||||
DEF_FIELD_ADDR(symval, input_device_id, ffbit);
|
||||
DEF_FIELD_ADDR(symval, input_device_id, swbit);
|
||||
DEF_FIELD_ADDR(symval, input_device_id, propbit);
|
||||
|
||||
sprintf(alias, "input:");
|
||||
|
||||
|
@ -816,6 +817,9 @@ static int do_input_entry(const char *filename, void *symval,
|
|||
sprintf(alias + strlen(alias), "w*");
|
||||
if (flags & INPUT_DEVICE_ID_MATCH_SWBIT)
|
||||
do_input(alias, *swbit, 0, INPUT_DEVICE_ID_SW_MAX);
|
||||
sprintf(alias + strlen(alias), "pr*");
|
||||
if (flags & INPUT_DEVICE_ID_MATCH_PROPBIT)
|
||||
do_input(alias, *propbit, 0, INPUT_DEVICE_ID_PROP_MAX);
|
||||
return 1;
|
||||
}
|
||||
ADD_TO_DEVTABLE("input", input_device_id, do_input_entry);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue