Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
b8044c74
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看板
提交
b8044c74
编写于
2月 15, 2006
作者:
D
Dmitry Torokhov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Input: trackpoint - enable devices connected to external port
Signed-off-by:
N
Dmitry Torokhov
<
dtor@mail.ru
>
上级
50f6dde0
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
16 addition
and
8 deletion
+16
-8
drivers/input/mouse/trackpoint.c
drivers/input/mouse/trackpoint.c
+14
-6
drivers/input/mouse/trackpoint.h
drivers/input/mouse/trackpoint.h
+2
-2
未找到文件。
drivers/input/mouse/trackpoint.c
浏览文件 @
b8044c74
...
...
@@ -68,15 +68,19 @@ struct trackpoint_attr_data {
size_t
field_offset
;
unsigned
char
command
;
unsigned
char
mask
;
unsigned
char
inverted
;
};
static
ssize_t
trackpoint_show_int_attr
(
struct
psmouse
*
psmouse
,
void
*
data
,
char
*
buf
)
{
struct
trackpoint_data
*
tp
=
psmouse
->
private
;
struct
trackpoint_attr_data
*
attr
=
data
;
unsigned
char
*
field
=
(
unsigned
char
*
)((
char
*
)
tp
+
attr
->
field_offset
);
unsigned
char
value
=
*
(
unsigned
char
*
)((
char
*
)
tp
+
attr
->
field_offset
);
if
(
attr
->
inverted
)
value
=
!
value
;
return
sprintf
(
buf
,
"%u
\n
"
,
*
field
);
return
sprintf
(
buf
,
"%u
\n
"
,
value
);
}
static
ssize_t
trackpoint_set_int_attr
(
struct
psmouse
*
psmouse
,
void
*
data
,
...
...
@@ -120,6 +124,9 @@ static ssize_t trackpoint_set_bit_attr(struct psmouse *psmouse, void *data,
if
(
*
rest
||
value
>
1
)
return
-
EINVAL
;
if
(
attr
->
inverted
)
value
=
!
value
;
if
(
*
field
!=
value
)
{
*
field
=
value
;
trackpoint_toggle_bit
(
&
psmouse
->
ps2dev
,
attr
->
command
,
attr
->
mask
);
...
...
@@ -129,11 +136,12 @@ static ssize_t trackpoint_set_bit_attr(struct psmouse *psmouse, void *data,
}
#define TRACKPOINT_BIT_ATTR(_name, _command, _mask) \
#define TRACKPOINT_BIT_ATTR(_name, _command, _mask
, _inv
) \
static struct trackpoint_attr_data trackpoint_attr_##_name = { \
.field_offset = offsetof(struct trackpoint_data, _name), \
.command = _command, \
.mask = _mask, \
.inverted = _inv, \
}; \
PSMOUSE_DEFINE_ATTR(_name, S_IWUSR | S_IRUGO, \
&trackpoint_attr_##_name, \
...
...
@@ -150,9 +158,9 @@ TRACKPOINT_INT_ATTR(upthresh, TP_UP_THRESH);
TRACKPOINT_INT_ATTR
(
ztime
,
TP_Z_TIME
);
TRACKPOINT_INT_ATTR
(
jenks
,
TP_JENKS_CURV
);
TRACKPOINT_BIT_ATTR
(
press_to_select
,
TP_TOGGLE_PTSON
,
TP_MASK_PTSON
);
TRACKPOINT_BIT_ATTR
(
skipback
,
TP_TOGGLE_SKIPBACK
,
TP_MASK_SKIPBACK
);
TRACKPOINT_BIT_ATTR
(
ext_dev
,
TP_TOGGLE_EXT_DEV
,
TP_MASK_EXT_DEV
);
TRACKPOINT_BIT_ATTR
(
press_to_select
,
TP_TOGGLE_PTSON
,
TP_MASK_PTSON
,
0
);
TRACKPOINT_BIT_ATTR
(
skipback
,
TP_TOGGLE_SKIPBACK
,
TP_MASK_SKIPBACK
,
0
);
TRACKPOINT_BIT_ATTR
(
ext_dev
,
TP_TOGGLE_EXT_DEV
,
TP_MASK_EXT_DEV
,
1
);
static
struct
attribute
*
trackpoint_attrs
[]
=
{
&
psmouse_attr_sensitivity
.
dattr
.
attr
,
...
...
drivers/input/mouse/trackpoint.h
浏览文件 @
b8044c74
...
...
@@ -78,7 +78,7 @@
#define TP_TOGGLE_MB 0x23
/* Disable/Enable Middle Button */
#define TP_MASK_MB 0x01
#define TP_TOGGLE_EXT_DEV 0x23
/*
Togg
le external device */
#define TP_TOGGLE_EXT_DEV 0x23
/*
Disab
le external device */
#define TP_MASK_EXT_DEV 0x02
#define TP_TOGGLE_DRIFT 0x23
/* Drift Correction */
#define TP_MASK_DRIFT 0x80
...
...
@@ -125,7 +125,7 @@
#define TP_DEF_MB 0x00
#define TP_DEF_PTSON 0x00
#define TP_DEF_SKIPBACK 0x00
#define TP_DEF_EXT_DEV 0x0
1
#define TP_DEF_EXT_DEV 0x0
0
/* 0 means enabled */
#define MAKE_PS2_CMD(params, results, cmd) ((params<<12) | (results<<8) | (cmd))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录