Yusuke Fujimaki | eeb01a5 | 2016-03-21 16:18:42 +0900 | [diff] [blame] | 1 | /* |
Yusuke Fujimaki | b94f7d5 | 2016-04-03 23:15:16 +0900 | [diff] [blame] | 2 | * HID driver for Asus notebook built-in keyboard. |
Yusuke Fujimaki | eeb01a5 | 2016-03-21 16:18:42 +0900 | [diff] [blame] | 3 | * Fixes small logical maximum to match usage maximum. |
| 4 | * |
Yusuke Fujimaki | b94f7d5 | 2016-04-03 23:15:16 +0900 | [diff] [blame] | 5 | * Currently supported devices are: |
| 6 | * EeeBook X205TA |
| 7 | * VivoBook E200HA |
| 8 | * |
Yusuke Fujimaki | eeb01a5 | 2016-03-21 16:18:42 +0900 | [diff] [blame] | 9 | * Copyright (c) 2016 Yusuke Fujimaki <usk.fujimaki@gmail.com> |
| 10 | * |
| 11 | * This module based on hid-ortek by |
| 12 | * Copyright (c) 2010 Johnathon Harris <jmharris@gmail.com> |
| 13 | * Copyright (c) 2011 Jiri Kosina |
| 14 | */ |
| 15 | |
| 16 | /* |
| 17 | * This program is free software; you can redistribute it and/or modify it |
| 18 | * under the terms of the GNU General Public License as published by the Free |
| 19 | * Software Foundation; either version 2 of the License, or (at your option) |
| 20 | * any later version. |
| 21 | */ |
| 22 | |
| 23 | #include <linux/device.h> |
| 24 | #include <linux/hid.h> |
| 25 | #include <linux/module.h> |
| 26 | |
| 27 | #include "hid-ids.h" |
| 28 | |
| 29 | static __u8 *asus_report_fixup(struct hid_device *hdev, __u8 *rdesc, |
| 30 | unsigned int *rsize) |
| 31 | { |
Yusuke Fujimaki | b94f7d5 | 2016-04-03 23:15:16 +0900 | [diff] [blame] | 32 | if (*rsize >= 56 && rdesc[54] == 0x25 && rdesc[55] == 0x65) { |
| 33 | hid_info(hdev, "Fixing up Asus notebook report descriptor\n"); |
Yusuke Fujimaki | eeb01a5 | 2016-03-21 16:18:42 +0900 | [diff] [blame] | 34 | rdesc[55] = 0xdd; |
| 35 | } |
| 36 | return rdesc; |
| 37 | } |
| 38 | |
| 39 | static const struct hid_device_id asus_devices[] = { |
Yusuke Fujimaki | b94f7d5 | 2016-04-03 23:15:16 +0900 | [diff] [blame] | 40 | { HID_I2C_DEVICE(USB_VENDOR_ID_ASUSTEK, USB_DEVICE_ID_ASUSTEK_NOTEBOOK_KEYBOARD) }, |
Yusuke Fujimaki | eeb01a5 | 2016-03-21 16:18:42 +0900 | [diff] [blame] | 41 | { } |
| 42 | }; |
| 43 | MODULE_DEVICE_TABLE(hid, asus_devices); |
| 44 | |
| 45 | static struct hid_driver asus_driver = { |
| 46 | .name = "asus", |
| 47 | .id_table = asus_devices, |
| 48 | .report_fixup = asus_report_fixup |
| 49 | }; |
| 50 | module_hid_driver(asus_driver); |
| 51 | |
| 52 | MODULE_LICENSE("GPL"); |