-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from linckandrea/lineage-17.1_update
lineage-17.1_update
- Loading branch information
Showing
13 changed files
with
1,002 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/* | ||
* Copyright (C) 2017 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved. | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 2 as | ||
* published by the Free Software Foundation. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#include <linux/linkage.h> | ||
|
||
ENTRY(__ashlti3) | ||
cbz x2, 1f | ||
mov x3, #64 | ||
sub x3, x3, x2 | ||
cmp x3, #0 | ||
b.le 2f | ||
lsl x1, x1, x2 | ||
lsr x3, x0, x3 | ||
lsl x2, x0, x2 | ||
orr x1, x1, x3 | ||
mov x0, x2 | ||
1: | ||
ret | ||
2: | ||
neg w1, w3 | ||
mov x2, #0 | ||
lsl x1, x0, x1 | ||
mov x0, x2 | ||
ret | ||
ENDPROC(__ashlti3) | ||
|
||
ENTRY(__ashrti3) | ||
cbz x2, 3f | ||
mov x3, #64 | ||
sub x3, x3, x2 | ||
cmp x3, #0 | ||
b.le 4f | ||
lsr x0, x0, x2 | ||
lsl x3, x1, x3 | ||
asr x2, x1, x2 | ||
orr x0, x0, x3 | ||
mov x1, x2 | ||
3: | ||
ret | ||
4: | ||
neg w0, w3 | ||
asr x2, x1, #63 | ||
asr x0, x1, x0 | ||
mov x1, x2 | ||
ret | ||
ENDPROC(__ashrti3) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/* | ||
* HID driver for Asus Gamepad. | ||
* Fix the descriptor due to tightening HID specifications. | ||
* Copyright (c) 2019 Siarhei Vishniakou <svv@google.com> | ||
* | ||
* Based on a patch contributed by JeiFeng Lee and Thunder Yu. | ||
*/ | ||
|
||
/* | ||
* This program is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU General Public License as published by the Free | ||
* Software Foundation; either version 2 of the License, or (at your option) | ||
* any later version. | ||
*/ | ||
|
||
#include <linux/device.h> | ||
#include <linux/hid.h> | ||
#include <linux/module.h> | ||
|
||
#include "hid-ids.h" | ||
|
||
static __u8 GAMEPAD_DESCRIPTOR[] = { | ||
0x05, 0x01, 0x09, 0x05, 0xa1, 0x01, 0x85, 0x01, 0x05, 0x09, 0x0a, | ||
0x01, 0x00, 0x0a, 0x02, 0x00, 0x0a, 0x04, 0x00, 0x0a, 0x05, 0x00, | ||
0x0a, 0x07, 0x00, 0x0a, 0x08, 0x00, 0x0a, 0x0e, 0x00, 0x0a, 0x0f, | ||
0x00, 0x0a, 0x0d, 0x00, 0x15, 0x00, 0x25, 0x01, 0x75, 0x01, 0x95, | ||
0x09, 0x81, 0x02, 0x05, 0x0c, 0x0a, 0x24, 0x02, 0x0a, 0x23, 0x02, | ||
0x95, 0x02, 0x81, 0x02, 0x75, 0x01, 0x95, 0x01, 0x81, 0x03, 0x05, | ||
0x01, 0x75, 0x04, 0x95, 0x01, 0x25, 0x07, 0x46, 0x3b, 0x01, 0x66, | ||
0x14, 0x00, 0x09, 0x39, 0x81, 0x42, 0x66, 0x00, 0x00, 0x09, 0x01, | ||
0xa1, 0x00, 0x09, 0x30, 0x09, 0x31, 0x09, 0x32, 0x09, 0x35, 0x15, | ||
0x00, 0x26, 0xff, 0x00, 0x35, 0x00, 0x46, 0xff, 0x00, 0x75, 0x08, | ||
0x95, 0x04, 0x81, 0x02, 0x05, 0x02, 0x09, 0xc5, 0x09, 0xc4, 0x95, | ||
0x02, 0x81, 0x02, 0xc0, 0x85, 0x02, 0x05, 0x08, 0x0a, 0x01, 0x00, | ||
0x0a, 0x02, 0x00, 0x0a, 0x03, 0x00, 0x0a, 0x04, 0x00, 0x15, 0x00, | ||
0x25, 0x01, 0x75, 0x01, 0x95, 0x04, 0x91, 0x02, 0x75, 0x04, 0x95, | ||
0x01, 0x91, 0x03, 0xc0, 0x05, 0x0c, 0x09, 0x01, 0xa1, 0x01, 0x85, | ||
0x03, 0x05, 0x01, 0x09, 0x06, 0xa1, 0x02, 0x05, 0x06, 0x09, 0x20, | ||
0x15, 0x00, 0x26, 0xff, 0x00, 0x75, 0x08, 0x95, 0x01, 0x81, 0x02, | ||
0x06, 0xbc, 0xff, 0x0a, 0xad, 0xbd, 0x75, 0x08, 0x95, 0x06, 0x81, | ||
0x02, 0xc0, 0xc0}; | ||
|
||
static __u8 *asus_gamepad_report_fixup(struct hid_device *hdev, | ||
__u8 *rdesc, unsigned int *rsize) | ||
{ | ||
if (hdev->product == USB_DEVICE_ID_ASUSTEK_GAMEPAD) { | ||
hid_info(hdev, "Fixing up Asus Gamepad report descriptor\n"); | ||
*rsize = ARRAY_SIZE(GAMEPAD_DESCRIPTOR); | ||
return GAMEPAD_DESCRIPTOR; | ||
} | ||
return rdesc; | ||
} | ||
|
||
static const struct hid_device_id asus_devices[] = { | ||
{HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ASUSTEK, | ||
USB_DEVICE_ID_ASUSTEK_GAMEPAD)}, | ||
}; | ||
MODULE_DEVICE_TABLE(hid, asus_devices); | ||
|
||
static struct hid_driver asus_driver = { | ||
.name = "asus-gamepad", | ||
.id_table = asus_devices, | ||
.report_fixup = asus_gamepad_report_fixup}; | ||
module_hid_driver(asus_driver); | ||
|
||
MODULE_LICENSE("GPL"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.