Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
9c930c3f
Commit
9c930c3f
authored
Mar 16, 2004
by
Vojtech Pavlik
Browse files
Options
Browse Files
Download
Plain Diff
Merge
bk://dtor.bkbits.net/input
into suse.cz:/data/bk/input
parents
be7b8193
b1f6b5a0
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
20 deletions
+42
-20
drivers/input/mouse/psmouse-base.c
drivers/input/mouse/psmouse-base.c
+30
-5
drivers/input/mouse/psmouse.h
drivers/input/mouse/psmouse.h
+3
-2
drivers/input/mouse/synaptics.c
drivers/input/mouse/synaptics.c
+8
-13
drivers/input/mouse/synaptics.h
drivers/input/mouse/synaptics.h
+1
-0
No files found.
drivers/input/mouse/psmouse-base.c
View file @
9c930c3f
...
@@ -287,6 +287,24 @@ int psmouse_command(struct psmouse *psmouse, unsigned char *param, int command)
...
@@ -287,6 +287,24 @@ int psmouse_command(struct psmouse *psmouse, unsigned char *param, int command)
return
0
;
return
0
;
}
}
/*
* psmouse_reset() resets the mouse into power-on state.
*/
int
psmouse_reset
(
struct
psmouse
*
psmouse
)
{
unsigned
char
param
[
2
];
if
(
psmouse_command
(
psmouse
,
param
,
PSMOUSE_CMD_RESET_BAT
))
return
-
1
;
if
(
param
[
0
]
!=
PSMOUSE_RET_BAT
&&
param
[
1
]
!=
PSMOUSE_RET_ID
)
return
-
1
;
return
0
;
}
/*
/*
* Genius NetMouse magic init.
* Genius NetMouse magic init.
*/
*/
...
@@ -371,6 +389,10 @@ static int psmouse_extensions(struct psmouse *psmouse)
...
@@ -371,6 +389,10 @@ static int psmouse_extensions(struct psmouse *psmouse)
*/
*/
psmouse_max_proto
=
PSMOUSE_IMEX
;
psmouse_max_proto
=
PSMOUSE_IMEX
;
}
}
/*
* Make sure that touchpad is in relative mode, gestures (taps) are enabled
*/
synaptics_reset
(
psmouse
);
}
}
if
(
psmouse_max_proto
>
PSMOUSE_IMEX
&&
genius_detect
(
psmouse
))
{
if
(
psmouse_max_proto
>
PSMOUSE_IMEX
&&
genius_detect
(
psmouse
))
{
...
@@ -416,6 +438,7 @@ static int psmouse_extensions(struct psmouse *psmouse)
...
@@ -416,6 +438,7 @@ static int psmouse_extensions(struct psmouse *psmouse)
* pass through port it could get disabled while probing for protocol
* pass through port it could get disabled while probing for protocol
* extensions.
* extensions.
*/
*/
psmouse_reset
(
psmouse
);
psmouse_command
(
psmouse
,
NULL
,
PSMOUSE_CMD_RESET_DIS
);
psmouse_command
(
psmouse
,
NULL
,
PSMOUSE_CMD_RESET_DIS
);
}
}
...
@@ -540,8 +563,8 @@ static void psmouse_activate(struct psmouse *psmouse)
...
@@ -540,8 +563,8 @@ static void psmouse_activate(struct psmouse *psmouse)
static
void
psmouse_cleanup
(
struct
serio
*
serio
)
static
void
psmouse_cleanup
(
struct
serio
*
serio
)
{
{
struct
psmouse
*
psmouse
=
serio
->
private
;
struct
psmouse
*
psmouse
=
serio
->
private
;
unsigned
char
param
[
2
];
psmouse_
command
(
psmouse
,
param
,
PSMOUSE_CMD_RESET_BAT
);
psmouse_
reset
(
psmouse
);
}
}
/*
/*
...
@@ -552,7 +575,7 @@ static void psmouse_disconnect(struct serio *serio)
...
@@ -552,7 +575,7 @@ static void psmouse_disconnect(struct serio *serio)
{
{
struct
psmouse
*
psmouse
=
serio
->
private
;
struct
psmouse
*
psmouse
=
serio
->
private
;
psmouse
->
state
=
PSMOUSE_
IGNOR
E
;
psmouse
->
state
=
PSMOUSE_
CMD_MOD
E
;
if
(
psmouse
->
ptport
)
{
if
(
psmouse
->
ptport
)
{
if
(
psmouse
->
ptport
->
deactivate
)
if
(
psmouse
->
ptport
->
deactivate
)
...
@@ -565,6 +588,8 @@ static void psmouse_disconnect(struct serio *serio)
...
@@ -565,6 +588,8 @@ static void psmouse_disconnect(struct serio *serio)
if
(
psmouse
->
disconnect
)
if
(
psmouse
->
disconnect
)
psmouse
->
disconnect
(
psmouse
);
psmouse
->
disconnect
(
psmouse
);
psmouse
->
state
=
PSMOUSE_IGNORE
;
input_unregister_device
(
&
psmouse
->
dev
);
input_unregister_device
(
&
psmouse
->
dev
);
serio_close
(
serio
);
serio_close
(
serio
);
kfree
(
psmouse
);
kfree
(
psmouse
);
...
@@ -592,7 +617,7 @@ static void psmouse_connect(struct serio *serio, struct serio_dev *dev)
...
@@ -592,7 +617,7 @@ static void psmouse_connect(struct serio *serio, struct serio_dev *dev)
psmouse
->
dev
.
keybit
[
LONG
(
BTN_MOUSE
)]
=
BIT
(
BTN_LEFT
)
|
BIT
(
BTN_MIDDLE
)
|
BIT
(
BTN_RIGHT
);
psmouse
->
dev
.
keybit
[
LONG
(
BTN_MOUSE
)]
=
BIT
(
BTN_LEFT
)
|
BIT
(
BTN_MIDDLE
)
|
BIT
(
BTN_RIGHT
);
psmouse
->
dev
.
relbit
[
0
]
=
BIT
(
REL_X
)
|
BIT
(
REL_Y
);
psmouse
->
dev
.
relbit
[
0
]
=
BIT
(
REL_X
)
|
BIT
(
REL_Y
);
psmouse
->
state
=
PSMOUSE_
NEW_DEVIC
E
;
psmouse
->
state
=
PSMOUSE_
CMD_MOD
E
;
psmouse
->
serio
=
serio
;
psmouse
->
serio
=
serio
;
psmouse
->
dev
.
private
=
psmouse
;
psmouse
->
dev
.
private
=
psmouse
;
...
@@ -652,7 +677,7 @@ static int psmouse_reconnect(struct serio *serio)
...
@@ -652,7 +677,7 @@ static int psmouse_reconnect(struct serio *serio)
old_type
=
psmouse
->
type
;
old_type
=
psmouse
->
type
;
psmouse
->
state
=
PSMOUSE_
NEW_DEVIC
E
;
psmouse
->
state
=
PSMOUSE_
CMD_MOD
E
;
psmouse
->
type
=
psmouse
->
acking
=
psmouse
->
cmdcnt
=
psmouse
->
pktcnt
=
0
;
psmouse
->
type
=
psmouse
->
acking
=
psmouse
->
cmdcnt
=
psmouse
->
pktcnt
=
0
;
if
(
psmouse
->
reconnect
)
{
if
(
psmouse
->
reconnect
)
{
if
(
psmouse
->
reconnect
(
psmouse
))
if
(
psmouse
->
reconnect
(
psmouse
))
...
...
drivers/input/mouse/psmouse.h
View file @
9c930c3f
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
#define PSMOUSE_RET_NAK 0xfe
#define PSMOUSE_RET_NAK 0xfe
/* psmouse states */
/* psmouse states */
#define PSMOUSE_
NEW_DEVIC
E 0
#define PSMOUSE_
CMD_MOD
E 0
#define PSMOUSE_ACTIVATED 1
#define PSMOUSE_ACTIVATED 1
#define PSMOUSE_IGNORE 2
#define PSMOUSE_IGNORE 2
...
@@ -65,6 +65,7 @@ struct psmouse {
...
@@ -65,6 +65,7 @@ struct psmouse {
#define PSMOUSE_SYNAPTICS 7
#define PSMOUSE_SYNAPTICS 7
int
psmouse_command
(
struct
psmouse
*
psmouse
,
unsigned
char
*
param
,
int
command
);
int
psmouse_command
(
struct
psmouse
*
psmouse
,
unsigned
char
*
param
,
int
command
);
int
psmouse_reset
(
struct
psmouse
*
psmouse
);
extern
int
psmouse_smartscroll
;
extern
int
psmouse_smartscroll
;
extern
unsigned
int
psmouse_rate
;
extern
unsigned
int
psmouse_rate
;
...
...
drivers/input/mouse/synaptics.c
View file @
9c930c3f
...
@@ -92,17 +92,6 @@ static int synaptics_mode_cmd(struct psmouse *psmouse, unsigned char mode)
...
@@ -92,17 +92,6 @@ static int synaptics_mode_cmd(struct psmouse *psmouse, unsigned char mode)
return
0
;
return
0
;
}
}
static
int
synaptics_reset
(
struct
psmouse
*
psmouse
)
{
unsigned
char
r
[
2
];
if
(
psmouse_command
(
psmouse
,
r
,
PSMOUSE_CMD_RESET_BAT
))
return
-
1
;
if
(
r
[
0
]
==
PSMOUSE_RET_BAT
&&
r
[
1
]
==
PSMOUSE_RET_ID
)
return
0
;
return
-
1
;
}
/*
/*
* Read the model-id bytes from the touchpad
* Read the model-id bytes from the touchpad
* see also SYN_MODEL_* macros
* see also SYN_MODEL_* macros
...
@@ -197,7 +186,7 @@ static int synaptics_query_hardware(struct psmouse *psmouse)
...
@@ -197,7 +186,7 @@ static int synaptics_query_hardware(struct psmouse *psmouse)
{
{
int
retries
=
0
;
int
retries
=
0
;
while
((
retries
++
<
3
)
&&
synaptics
_reset
(
psmouse
))
while
((
retries
++
<
3
)
&&
psmouse
_reset
(
psmouse
))
printk
(
KERN_ERR
"synaptics reset failed
\n
"
);
printk
(
KERN_ERR
"synaptics reset failed
\n
"
);
if
(
synaptics_identify
(
psmouse
))
if
(
synaptics_identify
(
psmouse
))
...
@@ -368,9 +357,15 @@ static void set_input_params(struct input_dev *dev, struct synaptics_data *priv)
...
@@ -368,9 +357,15 @@ static void set_input_params(struct input_dev *dev, struct synaptics_data *priv)
clear_bit
(
REL_Y
,
dev
->
relbit
);
clear_bit
(
REL_Y
,
dev
->
relbit
);
}
}
static
void
synaptics_disconnec
t
(
struct
psmouse
*
psmouse
)
void
synaptics_rese
t
(
struct
psmouse
*
psmouse
)
{
{
/* reset touchpad back to relative mode, gestures enabled */
synaptics_mode_cmd
(
psmouse
,
0
);
synaptics_mode_cmd
(
psmouse
,
0
);
}
static
void
synaptics_disconnect
(
struct
psmouse
*
psmouse
)
{
synaptics_reset
(
psmouse
);
kfree
(
psmouse
->
private
);
kfree
(
psmouse
->
private
);
}
}
...
...
drivers/input/mouse/synaptics.h
View file @
9c930c3f
...
@@ -12,6 +12,7 @@
...
@@ -12,6 +12,7 @@
extern
void
synaptics_process_byte
(
struct
psmouse
*
psmouse
,
struct
pt_regs
*
regs
);
extern
void
synaptics_process_byte
(
struct
psmouse
*
psmouse
,
struct
pt_regs
*
regs
);
extern
int
synaptics_detect
(
struct
psmouse
*
psmouse
);
extern
int
synaptics_detect
(
struct
psmouse
*
psmouse
);
extern
int
synaptics_init
(
struct
psmouse
*
psmouse
);
extern
int
synaptics_init
(
struct
psmouse
*
psmouse
);
extern
void
synaptics_reset
(
struct
psmouse
*
psmouse
);
/* synaptics queries */
/* synaptics queries */
#define SYN_QUE_IDENTIFY 0x00
#define SYN_QUE_IDENTIFY 0x00
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment