Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
a62f0d27
cloud-kernel
项目概览
openanolis
/
cloud-kernel
大约 1 年 前同步成功
通知
158
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a62f0d27
编写于
5月 19, 2010
作者:
D
Dmitry Torokhov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Input: psmouse - small formatting changes to better follow coding style
Signed-off-by:
N
Dmitry Torokhov
<
dtor@mail.ru
>
上级
83ba9ea8
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
100 addition
and
95 deletion
+100
-95
drivers/input/mouse/hgpk.c
drivers/input/mouse/hgpk.c
+2
-2
drivers/input/mouse/logips2pp.c
drivers/input/mouse/logips2pp.c
+51
-47
drivers/input/mouse/psmouse-base.c
drivers/input/mouse/psmouse-base.c
+36
-36
drivers/input/mouse/synaptics.c
drivers/input/mouse/synaptics.c
+11
-10
未找到文件。
drivers/input/mouse/hgpk.c
浏览文件 @
a62f0d27
...
...
@@ -40,8 +40,8 @@
#include "psmouse.h"
#include "hgpk.h"
static
int
tpdebug
;
module_param
(
tpdebug
,
int
,
0644
);
static
bool
tpdebug
;
module_param
(
tpdebug
,
bool
,
0644
);
MODULE_PARM_DESC
(
tpdebug
,
"enable debugging, dumping packets to KERN_DEBUG."
);
static
int
recalib_delta
=
100
;
...
...
drivers/input/mouse/logips2pp.c
浏览文件 @
a62f0d27
...
...
@@ -56,36 +56,36 @@ static psmouse_ret_t ps2pp_process_byte(struct psmouse *psmouse)
/* Logitech extended packet */
switch
((
packet
[
1
]
>>
4
)
|
(
packet
[
0
]
&
0x30
))
{
case
0x0d
:
/* Mouse extra info */
case
0x0d
:
/* Mouse extra info */
input_report_rel
(
dev
,
packet
[
2
]
&
0x80
?
REL_HWHEEL
:
REL_WHEEL
,
(
int
)
(
packet
[
2
]
&
8
)
-
(
int
)
(
packet
[
2
]
&
7
));
input_report_key
(
dev
,
BTN_SIDE
,
(
packet
[
2
]
>>
4
)
&
1
);
input_report_key
(
dev
,
BTN_EXTRA
,
(
packet
[
2
]
>>
5
)
&
1
);
input_report_rel
(
dev
,
packet
[
2
]
&
0x80
?
REL_HWHEEL
:
REL_WHEEL
,
(
int
)
(
packet
[
2
]
&
8
)
-
(
int
)
(
packet
[
2
]
&
7
));
input_report_key
(
dev
,
BTN_SIDE
,
(
packet
[
2
]
>>
4
)
&
1
);
input_report_key
(
dev
,
BTN_EXTRA
,
(
packet
[
2
]
>>
5
)
&
1
);
break
;
break
;
case
0x0e
:
/* buttons 4, 5, 6, 7, 8, 9, 10 info */
case
0x0e
:
/* buttons 4, 5, 6, 7, 8, 9, 10 info */
input_report_key
(
dev
,
BTN_SIDE
,
(
packet
[
2
])
&
1
);
input_report_key
(
dev
,
BTN_EXTRA
,
(
packet
[
2
]
>>
1
)
&
1
);
input_report_key
(
dev
,
BTN_BACK
,
(
packet
[
2
]
>>
3
)
&
1
);
input_report_key
(
dev
,
BTN_FORWARD
,
(
packet
[
2
]
>>
4
)
&
1
);
input_report_key
(
dev
,
BTN_TASK
,
(
packet
[
2
]
>>
2
)
&
1
);
input_report_key
(
dev
,
BTN_SIDE
,
(
packet
[
2
])
&
1
);
input_report_key
(
dev
,
BTN_EXTRA
,
(
packet
[
2
]
>>
1
)
&
1
);
input_report_key
(
dev
,
BTN_BACK
,
(
packet
[
2
]
>>
3
)
&
1
);
input_report_key
(
dev
,
BTN_FORWARD
,
(
packet
[
2
]
>>
4
)
&
1
);
input_report_key
(
dev
,
BTN_TASK
,
(
packet
[
2
]
>>
2
)
&
1
);
break
;
break
;
case
0x0f
:
/* TouchPad extra info */
case
0x0f
:
/* TouchPad extra info */
input_report_rel
(
dev
,
packet
[
2
]
&
0x08
?
REL_HWHEEL
:
REL_WHEEL
,
(
int
)
((
packet
[
2
]
>>
4
)
&
8
)
-
(
int
)
((
packet
[
2
]
>>
4
)
&
7
));
packet
[
0
]
=
packet
[
2
]
|
0x08
;
break
;
input_report_rel
(
dev
,
packet
[
2
]
&
0x08
?
REL_HWHEEL
:
REL_WHEEL
,
(
int
)
((
packet
[
2
]
>>
4
)
&
8
)
-
(
int
)
((
packet
[
2
]
>>
4
)
&
7
));
packet
[
0
]
=
packet
[
2
]
|
0x08
;
break
;
#ifdef DEBUG
default:
printk
(
KERN_WARNING
"psmouse.c: Received PS2++ packet #%x, but don't know how to handle.
\n
"
,
(
packet
[
1
]
>>
4
)
|
(
packet
[
0
]
&
0x30
));
default:
printk
(
KERN_WARNING
"psmouse.c: Received PS2++ packet #%x, but don't know how to handle.
\n
"
,
(
packet
[
1
]
>>
4
)
|
(
packet
[
0
]
&
0x30
));
#endif
}
}
else
{
...
...
@@ -250,7 +250,6 @@ static const struct ps2pp_info *get_model_info(unsigned char model)
if
(
model
==
ps2pp_list
[
i
].
model
)
return
&
ps2pp_list
[
i
];
printk
(
KERN_WARNING
"logips2pp: Detected unknown logitech mouse model %d
\n
"
,
model
);
return
NULL
;
}
...
...
@@ -285,31 +284,32 @@ static void ps2pp_set_model_properties(struct psmouse *psmouse,
__set_bit
(
REL_HWHEEL
,
input_dev
->
relbit
);
switch
(
model_info
->
kind
)
{
case
PS2PP_KIND_WHEEL
:
psmouse
->
name
=
"Wheel Mouse"
;
break
;
case
PS2PP_KIND_MX
:
psmouse
->
name
=
"MX Mouse"
;
break
;
case
PS2PP_KIND_TP3
:
psmouse
->
name
=
"TouchPad 3"
;
break
;
case
PS2PP_KIND_TRACKMAN
:
psmouse
->
name
=
"TrackMan"
;
break
;
default:
/*
* Set name to "Mouse" only when using PS2++,
* otherwise let other protocols define suitable
* name
*/
if
(
using_ps2pp
)
psmouse
->
name
=
"Mouse"
;
break
;
case
PS2PP_KIND_WHEEL
:
psmouse
->
name
=
"Wheel Mouse"
;
break
;
case
PS2PP_KIND_MX
:
psmouse
->
name
=
"MX Mouse"
;
break
;
case
PS2PP_KIND_TP3
:
psmouse
->
name
=
"TouchPad 3"
;
break
;
case
PS2PP_KIND_TRACKMAN
:
psmouse
->
name
=
"TrackMan"
;
break
;
default:
/*
* Set name to "Mouse" only when using PS2++,
* otherwise let other protocols define suitable
* name
*/
if
(
using_ps2pp
)
psmouse
->
name
=
"Mouse"
;
break
;
}
}
...
...
@@ -343,7 +343,8 @@ int ps2pp_init(struct psmouse *psmouse, bool set_properties)
if
(
!
model
||
!
buttons
)
return
-
1
;
if
((
model_info
=
get_model_info
(
model
))
!=
NULL
)
{
model_info
=
get_model_info
(
model
);
if
(
model_info
)
{
/*
* Do Logitech PS2++ / PS2T++ magic init.
...
...
@@ -379,6 +380,9 @@ int ps2pp_init(struct psmouse *psmouse, bool set_properties)
use_ps2pp
=
true
;
}
}
}
else
{
printk
(
KERN_WARNING
"logips2pp: Detected unknown logitech mouse model %d
\n
"
,
model
);
}
if
(
set_properties
)
{
...
...
drivers/input/mouse/psmouse-base.c
浏览文件 @
a62f0d27
...
...
@@ -147,18 +147,18 @@ static psmouse_ret_t psmouse_process_byte(struct psmouse *psmouse)
if
(
psmouse
->
type
==
PSMOUSE_IMEX
)
{
switch
(
packet
[
3
]
&
0xC0
)
{
case
0x80
:
/* vertical scroll on IntelliMouse Explorer 4.0 */
input_report_rel
(
dev
,
REL_WHEEL
,
(
int
)
(
packet
[
3
]
&
32
)
-
(
int
)
(
packet
[
3
]
&
31
));
break
;
case
0x40
:
/* horizontal scroll on IntelliMouse Explorer 4.0 */
input_report_rel
(
dev
,
REL_HWHEEL
,
(
int
)
(
packet
[
3
]
&
32
)
-
(
int
)
(
packet
[
3
]
&
31
));
break
;
case
0x00
:
case
0xC0
:
input_report_rel
(
dev
,
REL_WHEEL
,
(
int
)
(
packet
[
3
]
&
8
)
-
(
int
)
(
packet
[
3
]
&
7
));
input_report_key
(
dev
,
BTN_SIDE
,
(
packet
[
3
]
>>
4
)
&
1
);
input_report_key
(
dev
,
BTN_EXTRA
,
(
packet
[
3
]
>>
5
)
&
1
);
break
;
case
0x80
:
/* vertical scroll on IntelliMouse Explorer 4.0 */
input_report_rel
(
dev
,
REL_WHEEL
,
(
int
)
(
packet
[
3
]
&
32
)
-
(
int
)
(
packet
[
3
]
&
31
));
break
;
case
0x40
:
/* horizontal scroll on IntelliMouse Explorer 4.0 */
input_report_rel
(
dev
,
REL_HWHEEL
,
(
int
)
(
packet
[
3
]
&
32
)
-
(
int
)
(
packet
[
3
]
&
31
));
break
;
case
0x00
:
case
0xC0
:
input_report_rel
(
dev
,
REL_WHEEL
,
(
int
)
(
packet
[
3
]
&
8
)
-
(
int
)
(
packet
[
3
]
&
7
));
input_report_key
(
dev
,
BTN_SIDE
,
(
packet
[
3
]
>>
4
)
&
1
);
input_report_key
(
dev
,
BTN_EXTRA
,
(
packet
[
3
]
>>
5
)
&
1
);
break
;
}
}
...
...
@@ -247,31 +247,31 @@ static int psmouse_handle_byte(struct psmouse *psmouse)
psmouse_ret_t
rc
=
psmouse
->
protocol_handler
(
psmouse
);
switch
(
rc
)
{
case
PSMOUSE_BAD_DATA
:
if
(
psmouse
->
state
==
PSMOUSE_ACTIVATED
)
{
printk
(
KERN_WARNING
"psmouse.c: %s at %s lost sync at byte %d
\n
"
,
psmouse
->
name
,
psmouse
->
phys
,
psmouse
->
pktcnt
);
if
(
++
psmouse
->
out_of_sync_cnt
==
psmouse
->
resetafter
)
{
__psmouse_set_state
(
psmouse
,
PSMOUSE_IGNORE
);
printk
(
KERN_NOTICE
"psmouse.c: issuing reconnect request
\n
"
);
serio_reconnect
(
psmouse
->
ps2dev
.
serio
);
return
-
1
;
}
}
psmouse
->
pktcnt
=
0
;
break
;
case
PSMOUSE_FULL_PACKET
:
psmouse
->
pktcnt
=
0
;
if
(
psmouse
->
out_of_sync_cnt
)
{
psmouse
->
out_of_sync_cnt
=
0
;
printk
(
KERN_NOTICE
"psmouse.c: %s at %s - driver resynched.
\n
"
,
psmouse
->
name
,
psmouse
->
phys
);
case
PSMOUSE_BAD_DATA
:
if
(
psmouse
->
state
==
PSMOUSE_ACTIVATED
)
{
printk
(
KERN_WARNING
"psmouse.c: %s at %s lost sync at byte %d
\n
"
,
psmouse
->
name
,
psmouse
->
phys
,
psmouse
->
pktcnt
);
if
(
++
psmouse
->
out_of_sync_cnt
==
psmouse
->
resetafter
)
{
__psmouse_set_state
(
psmouse
,
PSMOUSE_IGNORE
);
printk
(
KERN_NOTICE
"psmouse.c: issuing reconnect request
\n
"
);
serio_reconnect
(
psmouse
->
ps2dev
.
serio
);
return
-
1
;
}
break
;
}
psmouse
->
pktcnt
=
0
;
break
;
case
PSMOUSE_FULL_PACKET
:
psmouse
->
pktcnt
=
0
;
if
(
psmouse
->
out_of_sync_cnt
)
{
psmouse
->
out_of_sync_cnt
=
0
;
printk
(
KERN_NOTICE
"psmouse.c: %s at %s - driver resynched.
\n
"
,
psmouse
->
name
,
psmouse
->
phys
);
}
break
;
case
PSMOUSE_GOOD_DATA
:
break
;
case
PSMOUSE_GOOD_DATA
:
break
;
}
return
0
;
}
...
...
@@ -1245,7 +1245,7 @@ static int psmouse_switch_protocol(struct psmouse *psmouse,
psmouse
->
pktsize
=
3
;
if
(
proto
&&
(
proto
->
detect
||
proto
->
init
))
{
if
(
proto
->
detect
&&
proto
->
detect
(
psmouse
,
1
)
<
0
)
if
(
proto
->
detect
&&
proto
->
detect
(
psmouse
,
true
)
<
0
)
return
-
1
;
if
(
proto
->
init
&&
proto
->
init
(
psmouse
)
<
0
)
...
...
drivers/input/mouse/synaptics.c
浏览文件 @
a62f0d27
...
...
@@ -532,19 +532,20 @@ static int synaptics_validate_byte(unsigned char packet[], int idx, unsigned cha
return
0
;
switch
(
pkt_type
)
{
case
SYN_NEWABS
:
case
SYN_NEWABS_RELAXED
:
return
(
packet
[
idx
]
&
newabs_rel_mask
[
idx
])
==
newabs_rslt
[
idx
];
case
SYN_NEWABS_STRICT
:
return
(
packet
[
idx
]
&
newabs_mask
[
idx
])
==
newabs_rslt
[
idx
];
case
SYN_NEWABS
:
case
SYN_NEWABS_RELAXED
:
return
(
packet
[
idx
]
&
newabs_rel_mask
[
idx
])
==
newabs_rslt
[
idx
];
case
SYN_OLDABS
:
return
(
packet
[
idx
]
&
oldabs_mask
[
idx
])
==
old
abs_rslt
[
idx
];
case
SYN_NEWABS_STRICT
:
return
(
packet
[
idx
]
&
newabs_mask
[
idx
])
==
new
abs_rslt
[
idx
];
default:
printk
(
KERN_ERR
"synaptics: unknown packet type %d
\n
"
,
pkt_type
);
return
0
;
case
SYN_OLDABS
:
return
(
packet
[
idx
]
&
oldabs_mask
[
idx
])
==
oldabs_rslt
[
idx
];
default:
printk
(
KERN_ERR
"synaptics: unknown packet type %d
\n
"
,
pkt_type
);
return
0
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录