Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
06d8b906
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
06d8b906
编写于
6月 08, 2018
作者:
J
Jiri Kosina
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'for-4.18/wacom' into for-linus
Support for "In Range" flag for Wacom Intuos/Bamboo devices from Jason Gerecke
上级
43e7b149
8947b0cf
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
39 addition
and
35 deletion
+39
-35
drivers/hid/wacom_wac.c
drivers/hid/wacom_wac.c
+39
-35
未找到文件。
drivers/hid/wacom_wac.c
浏览文件 @
06d8b906
...
...
@@ -2894,24 +2894,31 @@ static int wacom_bpt_pen(struct wacom_wac *wacom)
struct
wacom_features
*
features
=
&
wacom
->
features
;
struct
input_dev
*
input
=
wacom
->
pen_input
;
unsigned
char
*
data
=
wacom
->
data
;
int
prox
=
0
,
x
=
0
,
y
=
0
,
p
=
0
,
d
=
0
,
pen
=
0
,
btn1
=
0
,
btn2
=
0
;
int
x
=
0
,
y
=
0
,
p
=
0
,
d
=
0
;
bool
pen
=
false
,
btn1
=
false
,
btn2
=
false
;
bool
range
,
prox
,
rdy
;
if
(
data
[
0
]
!=
WACOM_REPORT_PENABLED
)
return
0
;
prox
=
(
data
[
1
]
&
0x20
)
==
0x20
;
range
=
(
data
[
1
]
&
0x80
)
==
0x80
;
prox
=
(
data
[
1
]
&
0x40
)
==
0x40
;
rdy
=
(
data
[
1
]
&
0x20
)
==
0x20
;
wacom
->
shared
->
stylus_in_proximity
=
range
;
if
(
delay_pen_events
(
wacom
))
return
0
;
if
(
rdy
)
{
p
=
le16_to_cpup
((
__le16
*
)
&
data
[
6
]);
pen
=
data
[
1
]
&
0x01
;
btn1
=
data
[
1
]
&
0x02
;
btn2
=
data
[
1
]
&
0x04
;
}
if
(
prox
)
{
x
=
le16_to_cpup
((
__le16
*
)
&
data
[
2
]);
y
=
le16_to_cpup
((
__le16
*
)
&
data
[
4
]);
/*
* All reports shared between PEN and RUBBER tool must be
* forced to a known starting value (zero) when transitioning to
* out-of-prox.
*
* If not reset then, to userspace, it will look like lost events
* if new tool comes in-prox with same values as previous tool sent.
*
* Hardware does report zero in most out-of-prox cases but not all.
*/
if
(
!
wacom
->
shared
->
stylus_in_proximity
)
{
if
(
data
[
1
]
&
0x08
)
{
wacom
->
tool
[
0
]
=
BTN_TOOL_RUBBER
;
wacom
->
id
[
0
]
=
ERASER_DEVICE_ID
;
...
...
@@ -2919,16 +2926,9 @@ static int wacom_bpt_pen(struct wacom_wac *wacom)
wacom
->
tool
[
0
]
=
BTN_TOOL_PEN
;
wacom
->
id
[
0
]
=
STYLUS_DEVICE_ID
;
}
wacom
->
reporting_data
=
true
;
}
wacom
->
shared
->
stylus_in_proximity
=
prox
;
if
(
delay_pen_events
(
wacom
))
return
0
;
if
(
prox
)
{
x
=
le16_to_cpup
((
__le16
*
)
&
data
[
2
]);
y
=
le16_to_cpup
((
__le16
*
)
&
data
[
4
]);
p
=
le16_to_cpup
((
__le16
*
)
&
data
[
6
]);
if
(
range
)
{
/*
* Convert distance from out prox to distance from tablet.
* distance will be greater than distance_max once
...
...
@@ -2937,25 +2937,29 @@ static int wacom_bpt_pen(struct wacom_wac *wacom)
*/
if
(
data
[
8
]
<=
features
->
distance_max
)
d
=
features
->
distance_max
-
data
[
8
];
pen
=
data
[
1
]
&
0x01
;
btn1
=
data
[
1
]
&
0x02
;
btn2
=
data
[
1
]
&
0x04
;
}
else
{
wacom
->
id
[
0
]
=
0
;
}
input_report_key
(
input
,
BTN_TOUCH
,
pen
);
input_report_key
(
input
,
BTN_STYLUS
,
btn1
);
input_report_key
(
input
,
BTN_STYLUS2
,
btn2
);
if
(
wacom
->
reporting_data
)
{
input_report_key
(
input
,
BTN_TOUCH
,
pen
);
input_report_key
(
input
,
BTN_STYLUS
,
btn1
);
input_report_key
(
input
,
BTN_STYLUS2
,
btn2
);
input_report_abs
(
input
,
ABS_X
,
x
);
input_report_abs
(
input
,
ABS_Y
,
y
);
input_report_abs
(
input
,
ABS_PRESSURE
,
p
);
input_report_abs
(
input
,
ABS_DISTANCE
,
d
);
if
(
prox
||
!
range
)
{
input_report_abs
(
input
,
ABS_X
,
x
);
input_report_abs
(
input
,
ABS_Y
,
y
);
}
input_report_abs
(
input
,
ABS_PRESSURE
,
p
);
input_report_abs
(
input
,
ABS_DISTANCE
,
d
);
input_report_key
(
input
,
wacom
->
tool
[
0
],
prox
);
/* PEN or RUBBER */
input_report_abs
(
input
,
ABS_MISC
,
wacom
->
id
[
0
]);
/* TOOL ID */
input_report_key
(
input
,
wacom
->
tool
[
0
],
range
);
/* PEN or RUBBER */
input_report_abs
(
input
,
ABS_MISC
,
wacom
->
id
[
0
]);
/* TOOL ID */
}
if
(
!
range
)
{
wacom
->
reporting_data
=
false
;
}
return
1
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录