diff options
| author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2017-10-09 15:01:14 -0400 |
|---|---|---|
| committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2017-10-19 19:54:49 -0400 |
| commit | 8724ecb072293f109a6f5dc93be8a98bf61fe14f (patch) | |
| tree | f63e205ecb0af4420d175b29832992db8fcfc1d3 /scripts | |
| parent | 55dfce873dca46df00304c44a568d7933bffff89 (diff) | |
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>
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/mod/devicetable-offsets.c | 1 | ||||
| -rw-r--r-- | scripts/mod/file2alias.c | 6 |
2 files changed, 6 insertions, 1 deletions
diff --git a/scripts/mod/devicetable-offsets.c b/scripts/mod/devicetable-offsets.c index e4d90e50f6fe..812657ab5aa3 100644 --- a/scripts/mod/devicetable-offsets.c +++ b/scripts/mod/devicetable-offsets.c | |||
| @@ -105,6 +105,7 @@ int main(void) | |||
| 105 | DEVID_FIELD(input_device_id, sndbit); | 105 | DEVID_FIELD(input_device_id, sndbit); |
| 106 | DEVID_FIELD(input_device_id, ffbit); | 106 | DEVID_FIELD(input_device_id, ffbit); |
| 107 | DEVID_FIELD(input_device_id, swbit); | 107 | DEVID_FIELD(input_device_id, swbit); |
| 108 | DEVID_FIELD(input_device_id, propbit); | ||
| 108 | 109 | ||
| 109 | DEVID(eisa_device_id); | 110 | DEVID(eisa_device_id); |
| 110 | DEVID_FIELD(eisa_device_id, sig); | 111 | DEVID_FIELD(eisa_device_id, sig); |
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c index 29d6699d5a06..bc25898f6df0 100644 --- a/scripts/mod/file2alias.c +++ b/scripts/mod/file2alias.c | |||
| @@ -761,7 +761,7 @@ static void do_input(char *alias, | |||
| 761 | sprintf(alias + strlen(alias), "%X,*", i); | 761 | sprintf(alias + strlen(alias), "%X,*", i); |
| 762 | } | 762 | } |
| 763 | 763 | ||
| 764 | /* input:b0v0p0e0-eXkXrXaXmXlXsXfXwX where X is comma-separated %02X. */ | 764 | /* input:b0v0p0e0-eXkXrXaXmXlXsXfXwXprX where X is comma-separated %02X. */ |
| 765 | static int do_input_entry(const char *filename, void *symval, | 765 | static int do_input_entry(const char *filename, void *symval, |
| 766 | char *alias) | 766 | char *alias) |
| 767 | { | 767 | { |
| @@ -779,6 +779,7 @@ static int do_input_entry(const char *filename, void *symval, | |||
| 779 | DEF_FIELD_ADDR(symval, input_device_id, sndbit); | 779 | DEF_FIELD_ADDR(symval, input_device_id, sndbit); |
| 780 | DEF_FIELD_ADDR(symval, input_device_id, ffbit); | 780 | DEF_FIELD_ADDR(symval, input_device_id, ffbit); |
| 781 | DEF_FIELD_ADDR(symval, input_device_id, swbit); | 781 | DEF_FIELD_ADDR(symval, input_device_id, swbit); |
| 782 | DEF_FIELD_ADDR(symval, input_device_id, propbit); | ||
| 782 | 783 | ||
| 783 | sprintf(alias, "input:"); | 784 | sprintf(alias, "input:"); |
| 784 | 785 | ||
| @@ -816,6 +817,9 @@ static int do_input_entry(const char *filename, void *symval, | |||
| 816 | sprintf(alias + strlen(alias), "w*"); | 817 | sprintf(alias + strlen(alias), "w*"); |
| 817 | if (flags & INPUT_DEVICE_ID_MATCH_SWBIT) | 818 | if (flags & INPUT_DEVICE_ID_MATCH_SWBIT) |
| 818 | do_input(alias, *swbit, 0, INPUT_DEVICE_ID_SW_MAX); | 819 | do_input(alias, *swbit, 0, INPUT_DEVICE_ID_SW_MAX); |
| 820 | sprintf(alias + strlen(alias), "pr*"); | ||
| 821 | if (flags & INPUT_DEVICE_ID_MATCH_PROPBIT) | ||
| 822 | do_input(alias, *propbit, 0, INPUT_DEVICE_ID_PROP_MAX); | ||
| 819 | return 1; | 823 | return 1; |
| 820 | } | 824 | } |
| 821 | ADD_TO_DEVTABLE("input", input_device_id, do_input_entry); | 825 | ADD_TO_DEVTABLE("input", input_device_id, do_input_entry); |
