Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
KED Linux Kernel Fork
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
KED Software Projects
Miscellaneous
KED Linux Kernel Fork
Commits
b8044c74
Commit
b8044c74
authored
19 years ago
by
Dmitry Torokhov
Browse files
Options
Downloads
Patches
Plain Diff
Input: trackpoint - enable devices connected to external port
Signed-off-by:
Dmitry Torokhov
<
dtor@mail.ru
>
parent
50f6dde0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
drivers/input/mouse/trackpoint.c
+14
-6
14 additions, 6 deletions
drivers/input/mouse/trackpoint.c
drivers/input/mouse/trackpoint.h
+2
-2
2 additions, 2 deletions
drivers/input/mouse/trackpoint.h
with
16 additions
and
8 deletions
drivers/input/mouse/trackpoint.c
+
14
−
6
View file @
b8044c74
...
@@ -68,15 +68,19 @@ struct trackpoint_attr_data {
...
@@ -68,15 +68,19 @@ struct trackpoint_attr_data {
size_t
field_offset
;
size_t
field_offset
;
unsigned
char
command
;
unsigned
char
command
;
unsigned
char
mask
;
unsigned
char
mask
;
unsigned
char
inverted
;
};
};
static
ssize_t
trackpoint_show_int_attr
(
struct
psmouse
*
psmouse
,
void
*
data
,
char
*
buf
)
static
ssize_t
trackpoint_show_int_attr
(
struct
psmouse
*
psmouse
,
void
*
data
,
char
*
buf
)
{
{
struct
trackpoint_data
*
tp
=
psmouse
->
private
;
struct
trackpoint_data
*
tp
=
psmouse
->
private
;
struct
trackpoint_attr_data
*
attr
=
data
;
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
,
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,
...
@@ -120,6 +124,9 @@ static ssize_t trackpoint_set_bit_attr(struct psmouse *psmouse, void *data,
if
(
*
rest
||
value
>
1
)
if
(
*
rest
||
value
>
1
)
return
-
EINVAL
;
return
-
EINVAL
;
if
(
attr
->
inverted
)
value
=
!
value
;
if
(
*
field
!=
value
)
{
if
(
*
field
!=
value
)
{
*
field
=
value
;
*
field
=
value
;
trackpoint_toggle_bit
(
&
psmouse
->
ps2dev
,
attr
->
command
,
attr
->
mask
);
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,
...
@@ -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 = { \
static struct trackpoint_attr_data trackpoint_attr_##_name = { \
.field_offset = offsetof(struct trackpoint_data, _name), \
.field_offset = offsetof(struct trackpoint_data, _name), \
.command = _command, \
.command = _command, \
.mask = _mask, \
.mask = _mask, \
.inverted = _inv, \
}; \
}; \
PSMOUSE_DEFINE_ATTR(_name, S_IWUSR | S_IRUGO, \
PSMOUSE_DEFINE_ATTR(_name, S_IWUSR | S_IRUGO, \
&trackpoint_attr_##_name, \
&trackpoint_attr_##_name, \
...
@@ -150,9 +158,9 @@ TRACKPOINT_INT_ATTR(upthresh, TP_UP_THRESH);
...
@@ -150,9 +158,9 @@ TRACKPOINT_INT_ATTR(upthresh, TP_UP_THRESH);
TRACKPOINT_INT_ATTR
(
ztime
,
TP_Z_TIME
);
TRACKPOINT_INT_ATTR
(
ztime
,
TP_Z_TIME
);
TRACKPOINT_INT_ATTR
(
jenks
,
TP_JENKS_CURV
);
TRACKPOINT_INT_ATTR
(
jenks
,
TP_JENKS_CURV
);
TRACKPOINT_BIT_ATTR
(
press_to_select
,
TP_TOGGLE_PTSON
,
TP_MASK_PTSON
);
TRACKPOINT_BIT_ATTR
(
press_to_select
,
TP_TOGGLE_PTSON
,
TP_MASK_PTSON
,
0
);
TRACKPOINT_BIT_ATTR
(
skipback
,
TP_TOGGLE_SKIPBACK
,
TP_MASK_SKIPBACK
);
TRACKPOINT_BIT_ATTR
(
skipback
,
TP_TOGGLE_SKIPBACK
,
TP_MASK_SKIPBACK
,
0
);
TRACKPOINT_BIT_ATTR
(
ext_dev
,
TP_TOGGLE_EXT_DEV
,
TP_MASK_EXT_DEV
);
TRACKPOINT_BIT_ATTR
(
ext_dev
,
TP_TOGGLE_EXT_DEV
,
TP_MASK_EXT_DEV
,
1
);
static
struct
attribute
*
trackpoint_attrs
[]
=
{
static
struct
attribute
*
trackpoint_attrs
[]
=
{
&
psmouse_attr_sensitivity
.
dattr
.
attr
,
&
psmouse_attr_sensitivity
.
dattr
.
attr
,
...
...
This diff is collapsed.
Click to expand it.
drivers/input/mouse/trackpoint.h
+
2
−
2
View file @
b8044c74
...
@@ -78,7 +78,7 @@
...
@@ -78,7 +78,7 @@
#define TP_TOGGLE_MB 0x23
/* Disable/Enable Middle Button */
#define TP_TOGGLE_MB 0x23
/* Disable/Enable Middle Button */
#define TP_MASK_MB 0x01
#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_MASK_EXT_DEV 0x02
#define TP_TOGGLE_DRIFT 0x23
/* Drift Correction */
#define TP_TOGGLE_DRIFT 0x23
/* Drift Correction */
#define TP_MASK_DRIFT 0x80
#define TP_MASK_DRIFT 0x80
...
@@ -125,7 +125,7 @@
...
@@ -125,7 +125,7 @@
#define TP_DEF_MB 0x00
#define TP_DEF_MB 0x00
#define TP_DEF_PTSON 0x00
#define TP_DEF_PTSON 0x00
#define TP_DEF_SKIPBACK 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))
#define MAKE_PS2_CMD(params, results, cmd) ((params<<12) | (results<<8) | (cmd))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment