Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
e5119885
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看板
提交
e5119885
编写于
6月 06, 2005
作者:
D
Dmitry Torokhov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Input: wacom - fix formatting in accordance to CodingStyle
Signed-off-by:
N
Dmitry Torokhov
<
dtor@mail.ru
>
上级
b2f86369
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
52 addition
and
71 deletion
+52
-71
drivers/usb/input/wacom.c
drivers/usb/input/wacom.c
+52
-71
未找到文件。
drivers/usb/input/wacom.c
浏览文件 @
e5119885
...
...
@@ -178,8 +178,7 @@ static void wacom_pl_irq(struct urb *urb, struct pt_regs *regs)
if
(
!
wacom
->
tool
[
0
])
{
/* Going into proximity select tool */
wacom
->
tool
[
1
]
=
(
data
[
4
]
&
0x20
)
?
BTN_TOOL_RUBBER
:
BTN_TOOL_PEN
;
}
else
{
}
else
{
/* was entered with stylus2 pressed */
if
(
wacom
->
tool
[
1
]
==
BTN_TOOL_RUBBER
&&
!
(
data
[
4
]
&
0x20
)
)
{
/* report out proximity for previous tool */
...
...
@@ -202,8 +201,7 @@ static void wacom_pl_irq(struct urb *urb, struct pt_regs *regs)
input_report_key
(
dev
,
BTN_STYLUS
,
data
[
4
]
&
0x10
);
/* Only allow the stylus2 button to be reported for the pen tool. */
input_report_key
(
dev
,
BTN_STYLUS2
,
(
wacom
->
tool
[
1
]
==
BTN_TOOL_PEN
)
&&
(
data
[
4
]
&
0x20
));
}
else
{
}
else
{
/* report proximity-out of a (valid) tool */
if
(
wacom
->
tool
[
1
]
!=
BTN_TOOL_RUBBER
)
{
/* Unknown tool selected default to pen tool */
...
...
@@ -215,7 +213,7 @@ static void wacom_pl_irq(struct urb *urb, struct pt_regs *regs)
wacom
->
tool
[
0
]
=
prox
;
/* Save proximity state */
input_sync
(
dev
);
exit:
exit:
retval
=
usb_submit_urb
(
urb
,
GFP_ATOMIC
);
if
(
retval
)
err
(
"%s - usb_submit_urb failed with result %d"
,
...
...
@@ -244,20 +242,16 @@ static void wacom_ptu_irq(struct urb *urb, struct pt_regs *regs)
goto
exit
;
}
if
(
data
[
0
]
!=
2
)
{
if
(
data
[
0
]
!=
2
)
{
printk
(
KERN_INFO
"wacom_ptu_irq: received unknown report #%d
\n
"
,
data
[
0
]);
goto
exit
;
}
input_regs
(
dev
,
regs
);
if
(
data
[
1
]
&
0x04
)
{
if
(
data
[
1
]
&
0x04
)
{
input_report_key
(
dev
,
BTN_TOOL_RUBBER
,
data
[
1
]
&
0x20
);
input_report_key
(
dev
,
BTN_TOUCH
,
data
[
1
]
&
0x08
);
}
else
{
}
else
{
input_report_key
(
dev
,
BTN_TOOL_PEN
,
data
[
1
]
&
0x20
);
input_report_key
(
dev
,
BTN_TOUCH
,
data
[
1
]
&
0x01
);
}
...
...
@@ -269,7 +263,7 @@ static void wacom_ptu_irq(struct urb *urb, struct pt_regs *regs)
input_sync
(
dev
);
exit:
exit:
retval
=
usb_submit_urb
(
urb
,
GFP_ATOMIC
);
if
(
retval
)
err
(
"%s - usb_submit_urb failed with result %d"
,
...
...
@@ -312,7 +306,7 @@ static void wacom_penpartner_irq(struct urb *urb, struct pt_regs *regs)
input_report_key
(
dev
,
BTN_STYLUS
,
(
data
[
5
]
&
0x40
));
input_sync
(
dev
);
exit:
exit:
retval
=
usb_submit_urb
(
urb
,
GFP_ATOMIC
);
if
(
retval
)
err
(
"%s - usb_submit_urb failed with result %d"
,
...
...
@@ -352,8 +346,8 @@ static void wacom_graphire_irq(struct urb *urb, struct pt_regs *regs)
input_regs
(
dev
,
regs
);
if
(
data
[
1
]
&
0x10
)
/* in prox */
{
if
(
data
[
1
]
&
0x10
)
{
/* in prox */
switch
((
data
[
1
]
>>
5
)
&
3
)
{
case
0
:
/* Pen */
...
...
@@ -369,7 +363,7 @@ static void wacom_graphire_irq(struct urb *urb, struct pt_regs *regs)
input_report_rel
(
dev
,
REL_WHEEL
,
(
signed
char
)
data
[
6
]);
/* fall through */
case
3
:
/* Mouse without wheel */
case
3
:
/* Mouse without wheel */
wacom
->
tool
[
0
]
=
BTN_TOOL_MOUSE
;
input_report_key
(
dev
,
BTN_LEFT
,
data
[
1
]
&
0x01
);
input_report_key
(
dev
,
BTN_RIGHT
,
data
[
1
]
&
0x02
);
...
...
@@ -392,7 +386,7 @@ static void wacom_graphire_irq(struct urb *urb, struct pt_regs *regs)
input_report_key
(
dev
,
wacom
->
tool
[
0
],
data
[
1
]
&
0x10
);
input_sync
(
dev
);
exit:
exit:
retval
=
usb_submit_urb
(
urb
,
GFP_ATOMIC
);
if
(
retval
)
err
(
"%s - usb_submit_urb failed with result %d"
,
...
...
@@ -410,8 +404,7 @@ static int wacom_intuos_inout(struct urb *urb)
idx
=
data
[
1
]
&
0x01
;
/* Enter report */
if
((
data
[
1
]
&
0xfc
)
==
0xc0
)
{
if
((
data
[
1
]
&
0xfc
)
==
0xc0
)
{
/* serial number of the tool */
wacom
->
serial
[
idx
]
=
((
data
[
3
]
&
0x0f
)
<<
28
)
+
(
data
[
4
]
<<
20
)
+
(
data
[
5
]
<<
12
)
+
...
...
@@ -490,8 +483,7 @@ static void wacom_intuos_general(struct urb *urb)
unsigned
int
t
;
/* general pen packet */
if
((
data
[
1
]
&
0xb8
)
==
0xa0
)
{
if
((
data
[
1
]
&
0xb8
)
==
0xa0
)
{
t
=
(
data
[
6
]
<<
2
)
|
((
data
[
7
]
>>
6
)
&
3
);
input_report_abs
(
dev
,
ABS_PRESSURE
,
t
);
input_report_abs
(
dev
,
ABS_TILT_X
,
...
...
@@ -503,8 +495,7 @@ static void wacom_intuos_general(struct urb *urb)
}
/* airbrush second packet */
if
((
data
[
1
]
&
0xbc
)
==
0xb4
)
{
if
((
data
[
1
]
&
0xbc
)
==
0xb4
)
{
input_report_abs
(
dev
,
ABS_WHEEL
,
(
data
[
6
]
<<
2
)
|
((
data
[
7
]
>>
6
)
&
3
));
input_report_abs
(
dev
,
ABS_TILT_X
,
...
...
@@ -549,11 +540,9 @@ static void wacom_intuos_irq(struct urb *urb, struct pt_regs *regs)
idx
=
data
[
1
]
&
0x01
;
/* pad packets. Works as a second tool and is always in prox */
if
(
data
[
0
]
==
12
)
{
if
(
data
[
0
]
==
12
)
{
/* initiate the pad as a device */
if
(
wacom
->
tool
[
1
]
!=
BTN_TOOL_FINGER
)
{
if
(
wacom
->
tool
[
1
]
!=
BTN_TOOL_FINGER
)
{
wacom
->
tool
[
1
]
=
BTN_TOOL_FINGER
;
input_report_key
(
dev
,
wacom
->
tool
[
1
],
1
);
}
...
...
@@ -573,19 +562,18 @@ static void wacom_intuos_irq(struct urb *urb, struct pt_regs *regs)
}
/* process in/out prox events */
if
(
wacom_intuos_inout
(
urb
))
goto
exit
;
if
(
wacom_intuos_inout
(
urb
))
goto
exit
;
/* Cintiq doesn't send data when RDY bit isn't set */
if
((
wacom
->
features
->
type
==
CINTIQ
)
&&
!
(
data
[
1
]
&
0x40
))
return
;
if
((
wacom
->
features
->
type
==
CINTIQ
)
&&
!
(
data
[
1
]
&
0x40
))
return
;
if
(
wacom
->
features
->
type
>=
INTUOS3
)
{
if
(
wacom
->
features
->
type
>=
INTUOS3
)
{
input_report_abs
(
dev
,
ABS_X
,
(
data
[
2
]
<<
9
)
|
(
data
[
3
]
<<
1
)
|
((
data
[
9
]
>>
1
)
&
1
));
input_report_abs
(
dev
,
ABS_Y
,
(
data
[
4
]
<<
9
)
|
(
data
[
5
]
<<
1
)
|
(
data
[
9
]
&
1
));
input_report_abs
(
dev
,
ABS_DISTANCE
,
((
data
[
9
]
>>
2
)
&
0x3f
));
}
else
{
}
else
{
input_report_abs
(
dev
,
ABS_X
,
be16_to_cpu
(
*
(
__be16
*
)
&
data
[
2
]));
input_report_abs
(
dev
,
ABS_Y
,
be16_to_cpu
(
*
(
__be16
*
)
&
data
[
4
]));
input_report_abs
(
dev
,
ABS_DISTANCE
,
((
data
[
9
]
>>
3
)
&
0x1f
));
...
...
@@ -596,11 +584,10 @@ static void wacom_intuos_irq(struct urb *urb, struct pt_regs *regs)
/* 4D mouse, 2D mouse, marker pen rotation, or Lens cursor packets */
if
((
data
[
1
]
&
0xbc
)
==
0xa8
||
(
data
[
1
]
&
0xbe
)
==
0xb0
)
{
/* Rotation packet */
if
(
data
[
1
]
&
0x02
)
{
if
(
wacom
->
features
->
type
>=
INTUOS3
)
{
if
(
data
[
1
]
&
0x02
)
{
/* Rotation packet */
if
(
wacom
->
features
->
type
>=
INTUOS3
)
{
/* I3 marker pen rotation reported as wheel
* due to valuator limitation
*/
...
...
@@ -608,18 +595,15 @@ static void wacom_intuos_irq(struct urb *urb, struct pt_regs *regs)
t
=
(
data
[
7
]
&
0x20
)
?
((
t
>
900
)
?
((
t
-
1
)
/
2
-
1350
)
:
((
t
-
1
)
/
2
+
450
))
:
(
450
-
t
/
2
)
;
input_report_abs
(
dev
,
ABS_WHEEL
,
t
);
}
else
{
}
else
{
/* 4D mouse rotation packet */
t
=
(
data
[
6
]
<<
3
)
|
((
data
[
7
]
>>
5
)
&
7
);
input_report_abs
(
dev
,
ABS_RZ
,
(
data
[
7
]
&
0x20
)
?
((
t
-
1
)
/
2
)
:
-
t
/
2
);
}
}
/* 4D mouse packets */
else
if
(
!
(
data
[
1
]
&
0x10
)
&&
wacom
->
features
->
type
<
INTUOS3
)
{
}
else
if
(
!
(
data
[
1
]
&
0x10
)
&&
wacom
->
features
->
type
<
INTUOS3
)
{
/* 4D mouse packet */
input_report_key
(
dev
,
BTN_LEFT
,
data
[
8
]
&
0x01
);
input_report_key
(
dev
,
BTN_MIDDLE
,
data
[
8
]
&
0x02
);
input_report_key
(
dev
,
BTN_RIGHT
,
data
[
8
]
&
0x04
);
...
...
@@ -628,26 +612,23 @@ static void wacom_intuos_irq(struct urb *urb, struct pt_regs *regs)
input_report_key
(
dev
,
BTN_EXTRA
,
data
[
8
]
&
0x10
);
t
=
(
data
[
6
]
<<
2
)
|
((
data
[
7
]
>>
6
)
&
3
);
input_report_abs
(
dev
,
ABS_THROTTLE
,
(
data
[
8
]
&
0x08
)
?
-
t
:
t
);
}
/* 2D mouse packets */
else
if
(
wacom
->
tool
[
idx
]
==
BTN_TOOL_MOUSE
)
{
}
else
if
(
wacom
->
tool
[
idx
]
==
BTN_TOOL_MOUSE
)
{
/* 2D mouse packet */
input_report_key
(
dev
,
BTN_LEFT
,
data
[
8
]
&
0x04
);
input_report_key
(
dev
,
BTN_MIDDLE
,
data
[
8
]
&
0x08
);
input_report_key
(
dev
,
BTN_RIGHT
,
data
[
8
]
&
0x10
);
input_report_rel
(
dev
,
REL_WHEEL
,
((
data
[
8
]
&
0x02
)
>>
1
)
-
(
data
[
8
]
&
0x01
));
-
(
data
[
8
]
&
0x01
));
/* I3 2D mouse side buttons */
if
(
wacom
->
features
->
type
==
INTUOS3
)
{
if
(
wacom
->
features
->
type
==
INTUOS3
)
{
input_report_key
(
dev
,
BTN_SIDE
,
data
[
8
]
&
0x40
);
input_report_key
(
dev
,
BTN_EXTRA
,
data
[
8
]
&
0x20
);
}
}
/* Lens cursor packets */
else
if
(
wacom
->
features
->
type
<
INTUOS3
)
{
}
else
if
(
wacom
->
features
->
type
<
INTUOS3
)
{
/* Lens cursor packets */
input_report_key
(
dev
,
BTN_LEFT
,
data
[
8
]
&
0x01
);
input_report_key
(
dev
,
BTN_MIDDLE
,
data
[
8
]
&
0x02
);
input_report_key
(
dev
,
BTN_RIGHT
,
data
[
8
]
&
0x04
);
...
...
@@ -668,23 +649,23 @@ static void wacom_intuos_irq(struct urb *urb, struct pt_regs *regs)
}
static
struct
wacom_features
wacom_features
[]
=
{
{
"Wacom Penpartner"
,
7
,
5040
,
3780
,
255
,
32
,
PENPARTNER
,
wacom_penpartner_irq
},
{
"Wacom Penpartner"
,
7
,
5040
,
3780
,
255
,
32
,
PENPARTNER
,
wacom_penpartner_irq
},
{
"Wacom Graphire"
,
8
,
10206
,
7422
,
511
,
32
,
GRAPHIRE
,
wacom_graphire_irq
},
{
"Wacom Graphire2 4x5"
,
8
,
10206
,
7422
,
511
,
32
,
GRAPHIRE
,
wacom_graphire_irq
},
{
"Wacom Graphire2 5x7"
,
8
,
13918
,
10206
,
511
,
32
,
GRAPHIRE
,
wacom_graphire_irq
},
{
"Wacom Graphire2 5x7"
,
8
,
13918
,
10206
,
511
,
32
,
GRAPHIRE
,
wacom_graphire_irq
},
{
"Wacom Graphire3"
,
8
,
10208
,
7424
,
511
,
32
,
GRAPHIRE
,
wacom_graphire_irq
},
{
"Wacom Graphire3 6x8"
,
8
,
16704
,
12064
,
511
,
32
,
GRAPHIRE
,
wacom_graphire_irq
},
{
"Wacom Intuos 4x5"
,
10
,
12700
,
10600
,
1023
,
15
,
INTUOS
,
wacom_intuos_irq
},
{
"Wacom Intuos 6x8"
,
10
,
20320
,
16240
,
1023
,
15
,
INTUOS
,
wacom_intuos_irq
},
{
"Wacom Intuos 9x12"
,
10
,
30480
,
24060
,
1023
,
15
,
INTUOS
,
wacom_intuos_irq
},
{
"Wacom Intuos 12x12"
,
10
,
30480
,
31680
,
1023
,
15
,
INTUOS
,
wacom_intuos_irq
},
{
"Wacom Intuos 12x18"
,
10
,
45720
,
31680
,
1023
,
15
,
INTUOS
,
wacom_intuos_irq
},
{
"Wacom PL400"
,
8
,
5408
,
4056
,
255
,
32
,
PL
,
wacom_pl_irq
},
{
"Wacom PL500"
,
8
,
6144
,
4608
,
255
,
32
,
PL
,
wacom_pl_irq
},
{
"Wacom PL600"
,
8
,
6126
,
4604
,
255
,
32
,
PL
,
wacom_pl_irq
},
{
"Wacom PL600SX"
,
8
,
6260
,
5016
,
255
,
32
,
PL
,
wacom_pl_irq
},
{
"Wacom PL550"
,
8
,
6144
,
4608
,
511
,
32
,
PL
,
wacom_pl_irq
},
{
"Wacom PL800"
,
8
,
7220
,
5780
,
511
,
32
,
PL
,
wacom_pl_irq
},
{
"Wacom Intuos 4x5"
,
10
,
12700
,
10600
,
1023
,
15
,
INTUOS
,
wacom_intuos_irq
},
{
"Wacom Intuos 6x8"
,
10
,
20320
,
16240
,
1023
,
15
,
INTUOS
,
wacom_intuos_irq
},
{
"Wacom Intuos 9x12"
,
10
,
30480
,
24060
,
1023
,
15
,
INTUOS
,
wacom_intuos_irq
},
{
"Wacom Intuos 12x12"
,
10
,
30480
,
31680
,
1023
,
15
,
INTUOS
,
wacom_intuos_irq
},
{
"Wacom Intuos 12x18"
,
10
,
45720
,
31680
,
1023
,
15
,
INTUOS
,
wacom_intuos_irq
},
{
"Wacom PL400"
,
8
,
5408
,
4056
,
255
,
32
,
PL
,
wacom_pl_irq
},
{
"Wacom PL500"
,
8
,
6144
,
4608
,
255
,
32
,
PL
,
wacom_pl_irq
},
{
"Wacom PL600"
,
8
,
6126
,
4604
,
255
,
32
,
PL
,
wacom_pl_irq
},
{
"Wacom PL600SX"
,
8
,
6260
,
5016
,
255
,
32
,
PL
,
wacom_pl_irq
},
{
"Wacom PL550"
,
8
,
6144
,
4608
,
511
,
32
,
PL
,
wacom_pl_irq
},
{
"Wacom PL800"
,
8
,
7220
,
5780
,
511
,
32
,
PL
,
wacom_pl_irq
},
{
"Wacom Intuos2 4x5"
,
10
,
12700
,
10600
,
1023
,
15
,
INTUOS
,
wacom_intuos_irq
},
{
"Wacom Intuos2 6x8"
,
10
,
20320
,
16240
,
1023
,
15
,
INTUOS
,
wacom_intuos_irq
},
{
"Wacom Intuos2 9x12"
,
10
,
30480
,
24060
,
1023
,
15
,
INTUOS
,
wacom_intuos_irq
},
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录