Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
kernel_linux
提交
47dd6b01
K
kernel_linux
项目概览
OpenHarmony
/
kernel_linux
上一次同步 3 年多
通知
13
Star
8
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
kernel_linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
47dd6b01
编写于
11月 15, 2017
作者:
J
Jiri Kosina
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'for-4.15/asus' into for-linus
- Asus laptop fixes (fn keys, backlight), from Mustafa Kuscu and Maxime Bellengé
上级
5cc619db
339ee3fc
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
32 addition
and
2 deletion
+32
-2
drivers/hid/hid-asus.c
drivers/hid/hid-asus.c
+30
-1
drivers/hid/hid-core.c
drivers/hid/hid-core.c
+1
-1
drivers/hid/hid-ids.h
drivers/hid/hid-ids.h
+1
-0
未找到文件。
drivers/hid/hid-asus.c
浏览文件 @
47dd6b01
...
...
@@ -67,6 +67,7 @@ MODULE_DESCRIPTION("Asus HID Keyboard and TouchPad");
#define QUIRK_USE_KBD_BACKLIGHT BIT(5)
#define QUIRK_T100_KEYBOARD BIT(6)
#define QUIRK_T100CHI BIT(7)
#define QUIRK_G752_KEYBOARD BIT(8)
#define I2C_KEYBOARD_QUIRKS (QUIRK_FIX_NOTEBOOK_REPORT | \
QUIRK_NO_INIT_REPORTS | \
...
...
@@ -670,6 +671,11 @@ static void asus_remove(struct hid_device *hdev)
hid_hw_stop
(
hdev
);
}
static
const
__u8
asus_g752_fixed_rdesc
[]
=
{
0x19
,
0x00
,
/* Usage Minimum (0x00) */
0x2A
,
0xFF
,
0x00
,
/* Usage Maximum (0xFF) */
};
static
__u8
*
asus_report_fixup
(
struct
hid_device
*
hdev
,
__u8
*
rdesc
,
unsigned
int
*
rsize
)
{
...
...
@@ -708,6 +714,27 @@ static __u8 *asus_report_fixup(struct hid_device *hdev, __u8 *rdesc,
rdesc
[
391
]
=
0xff
;
rdesc
[
402
]
=
0x00
;
}
if
(
drvdata
->
quirks
&
QUIRK_G752_KEYBOARD
&&
*
rsize
==
75
&&
rdesc
[
61
]
==
0x15
&&
rdesc
[
62
]
==
0x00
)
{
/* report is missing usage mninum and maximum */
__u8
*
new_rdesc
;
size_t
new_size
=
*
rsize
+
sizeof
(
asus_g752_fixed_rdesc
);
new_rdesc
=
devm_kzalloc
(
&
hdev
->
dev
,
new_size
,
GFP_KERNEL
);
if
(
new_rdesc
==
NULL
)
return
rdesc
;
hid_info
(
hdev
,
"Fixing up Asus G752 keyb report descriptor
\n
"
);
/* copy the valid part */
memcpy
(
new_rdesc
,
rdesc
,
61
);
/* insert missing part */
memcpy
(
new_rdesc
+
61
,
asus_g752_fixed_rdesc
,
sizeof
(
asus_g752_fixed_rdesc
));
/* copy remaining data */
memcpy
(
new_rdesc
+
61
+
sizeof
(
asus_g752_fixed_rdesc
),
rdesc
+
61
,
*
rsize
-
61
);
*
rsize
=
new_size
;
rdesc
=
new_rdesc
;
}
return
rdesc
;
}
...
...
@@ -718,9 +745,11 @@ static const struct hid_device_id asus_devices[] = {
{
HID_I2C_DEVICE
(
USB_VENDOR_ID_ASUSTEK
,
USB_DEVICE_ID_ASUSTEK_I2C_TOUCHPAD
),
I2C_TOUCHPAD_QUIRKS
},
{
HID_USB_DEVICE
(
USB_VENDOR_ID_ASUSTEK
,
USB_DEVICE_ID_ASUSTEK_ROG_KEYBOARD1
)
},
USB_DEVICE_ID_ASUSTEK_ROG_KEYBOARD1
)
,
QUIRK_USE_KBD_BACKLIGHT
},
{
HID_USB_DEVICE
(
USB_VENDOR_ID_ASUSTEK
,
USB_DEVICE_ID_ASUSTEK_ROG_KEYBOARD2
),
QUIRK_USE_KBD_BACKLIGHT
},
{
HID_USB_DEVICE
(
USB_VENDOR_ID_ASUSTEK
,
USB_DEVICE_ID_ASUSTEK_ROG_KEYBOARD3
),
QUIRK_G752_KEYBOARD
},
{
HID_USB_DEVICE
(
USB_VENDOR_ID_ASUSTEK
,
USB_DEVICE_ID_ASUSTEK_T100_KEYBOARD
),
QUIRK_T100_KEYBOARD
|
QUIRK_NO_CONSUMER_USAGES
},
...
...
drivers/hid/hid-core.c
浏览文件 @
47dd6b01
...
...
@@ -1982,6 +1982,7 @@ static const struct hid_device_id hid_have_special_driver[] = {
{
HID_I2C_DEVICE
(
USB_VENDOR_ID_ASUSTEK
,
USB_DEVICE_ID_ASUSTEK_I2C_TOUCHPAD
)
},
{
HID_USB_DEVICE
(
USB_VENDOR_ID_ASUSTEK
,
USB_DEVICE_ID_ASUSTEK_ROG_KEYBOARD1
)
},
{
HID_USB_DEVICE
(
USB_VENDOR_ID_ASUSTEK
,
USB_DEVICE_ID_ASUSTEK_ROG_KEYBOARD2
)
},
{
HID_USB_DEVICE
(
USB_VENDOR_ID_ASUSTEK
,
USB_DEVICE_ID_ASUSTEK_ROG_KEYBOARD3
)
},
{
HID_USB_DEVICE
(
USB_VENDOR_ID_ASUSTEK
,
USB_DEVICE_ID_ASUSTEK_T100_KEYBOARD
)
},
{
HID_USB_DEVICE
(
USB_VENDOR_ID_JESS
,
USB_DEVICE_ID_ASUS_MD_5112
)
},
{
HID_USB_DEVICE
(
USB_VENDOR_ID_TURBOX
,
USB_DEVICE_ID_ASUS_MD_5110
)
},
...
...
@@ -3125,4 +3126,3 @@ MODULE_AUTHOR("Andreas Gal");
MODULE_AUTHOR
(
"Vojtech Pavlik"
);
MODULE_AUTHOR
(
"Jiri Kosina"
);
MODULE_LICENSE
(
"GPL"
);
drivers/hid/hid-ids.h
浏览文件 @
47dd6b01
...
...
@@ -185,6 +185,7 @@
#define USB_DEVICE_ID_ASUSTEK_I2C_TOUCHPAD 0x0101
#define USB_DEVICE_ID_ASUSTEK_ROG_KEYBOARD1 0x1854
#define USB_DEVICE_ID_ASUSTEK_ROG_KEYBOARD2 0x1837
#define USB_DEVICE_ID_ASUSTEK_ROG_KEYBOARD3 0x1822
#define USB_VENDOR_ID_ATEN 0x0557
#define USB_DEVICE_ID_ATEN_UC100KM 0x2004
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录