Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
79b83b05
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
160
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
79b83b05
编写于
6月 08, 2018
作者:
J
Jiri Kosina
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'for-4.18/hid-redragon' into for-linus
Redragon Asura support from Robert Munteanu
上级
c1144d29
85455dd9
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
95 addition
and
0 deletion
+95
-0
drivers/hid/Kconfig
drivers/hid/Kconfig
+7
-0
drivers/hid/Makefile
drivers/hid/Makefile
+1
-0
drivers/hid/hid-ids.h
drivers/hid/hid-ids.h
+1
-0
drivers/hid/hid-redragon.c
drivers/hid/hid-redragon.c
+86
-0
未找到文件。
drivers/hid/Kconfig
浏览文件 @
79b83b05
...
@@ -575,6 +575,13 @@ config HID_MAYFLASH
...
@@ -575,6 +575,13 @@ config HID_MAYFLASH
Say Y here if you have HJZ Mayflash PS3 game controller adapters
Say Y here if you have HJZ Mayflash PS3 game controller adapters
and want to enable force feedback support.
and want to enable force feedback support.
config HID_REDRAGON
tristate "Redragon keyboards"
depends on HID
default !EXPERT
---help---
Support for Redragon keyboards that need fix-ups to work properly.
config HID_MICROSOFT
config HID_MICROSOFT
tristate "Microsoft non-fully HID-compliant devices"
tristate "Microsoft non-fully HID-compliant devices"
depends on HID
depends on HID
...
...
drivers/hid/Makefile
浏览文件 @
79b83b05
...
@@ -86,6 +86,7 @@ hid-picolcd-$(CONFIG_DEBUG_FS) += hid-picolcd_debugfs.o
...
@@ -86,6 +86,7 @@ hid-picolcd-$(CONFIG_DEBUG_FS) += hid-picolcd_debugfs.o
obj-$(CONFIG_HID_PLANTRONICS)
+=
hid-plantronics.o
obj-$(CONFIG_HID_PLANTRONICS)
+=
hid-plantronics.o
obj-$(CONFIG_HID_PRIMAX)
+=
hid-primax.o
obj-$(CONFIG_HID_PRIMAX)
+=
hid-primax.o
obj-$(CONFIG_HID_REDRAGON)
+=
hid-redragon.o
obj-$(CONFIG_HID_RETRODE)
+=
hid-retrode.o
obj-$(CONFIG_HID_RETRODE)
+=
hid-retrode.o
obj-$(CONFIG_HID_ROCCAT)
+=
hid-roccat.o hid-roccat-common.o
\
obj-$(CONFIG_HID_ROCCAT)
+=
hid-roccat.o hid-roccat-common.o
\
hid-roccat-arvo.o hid-roccat-isku.o hid-roccat-kone.o
\
hid-roccat-arvo.o hid-roccat-isku.o hid-roccat-kone.o
\
...
...
drivers/hid/hid-ids.h
浏览文件 @
79b83b05
...
@@ -615,6 +615,7 @@
...
@@ -615,6 +615,7 @@
#define USB_VENDOR_ID_JESS 0x0c45
#define USB_VENDOR_ID_JESS 0x0c45
#define USB_DEVICE_ID_JESS_YUREX 0x1010
#define USB_DEVICE_ID_JESS_YUREX 0x1010
#define USB_DEVICE_ID_ASUS_MD_5112 0x5112
#define USB_DEVICE_ID_ASUS_MD_5112 0x5112
#define USB_DEVICE_ID_REDRAGON_ASURA 0x760b
#define USB_VENDOR_ID_JESS2 0x0f30
#define USB_VENDOR_ID_JESS2 0x0f30
#define USB_DEVICE_ID_JESS2_COLOR_RUMBLE_PAD 0x0111
#define USB_DEVICE_ID_JESS2_COLOR_RUMBLE_PAD 0x0111
...
...
drivers/hid/hid-redragon.c
0 → 100644
浏览文件 @
79b83b05
/*
* HID driver for Redragon keyboards
*
* Copyright (c) 2017 Robert Munteanu
* SPDX-License-Identifier: GPL-2.0+
*/
/*
* 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"
/*
* The Redragon Asura keyboard sends an incorrect HID descriptor.
* At byte 100 it contains
*
* 0x81, 0x00
*
* which is Input (Data, Arr, Abs), but it should be
*
* 0x81, 0x02
*
* which is Input (Data, Var, Abs), which is consistent with the way
* key codes are generated.
*/
static
__u8
*
redragon_report_fixup
(
struct
hid_device
*
hdev
,
__u8
*
rdesc
,
unsigned
int
*
rsize
)
{
if
(
*
rsize
>=
102
&&
rdesc
[
100
]
==
0x81
&&
rdesc
[
101
]
==
0x00
)
{
dev_info
(
&
hdev
->
dev
,
"Fixing Redragon ASURA report descriptor.
\n
"
);
rdesc
[
101
]
=
0x02
;
}
return
rdesc
;
}
static
int
redragon_probe
(
struct
hid_device
*
dev
,
const
struct
hid_device_id
*
id
)
{
int
ret
;
ret
=
hid_parse
(
dev
);
if
(
ret
)
{
hid_err
(
dev
,
"parse failed
\n
"
);
return
ret
;
}
/* do not register unused input device */
if
(
dev
->
maxapplication
==
1
)
return
0
;
ret
=
hid_hw_start
(
dev
,
HID_CONNECT_DEFAULT
);
if
(
ret
)
{
hid_err
(
dev
,
"hw start failed
\n
"
);
return
ret
;
}
return
0
;
}
static
const
struct
hid_device_id
redragon_devices
[]
=
{
{
HID_USB_DEVICE
(
USB_VENDOR_ID_JESS
,
USB_DEVICE_ID_REDRAGON_ASURA
)},
{}
};
MODULE_DEVICE_TABLE
(
hid
,
redragon_devices
);
static
struct
hid_driver
redragon_driver
=
{
.
name
=
"redragon"
,
.
id_table
=
redragon_devices
,
.
report_fixup
=
redragon_report_fixup
,
.
probe
=
redragon_probe
};
module_hid_driver
(
redragon_driver
);
MODULE_LICENSE
(
"GPL"
);
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录