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
nexedi
linux
Commits
a2d781fc
Commit
a2d781fc
authored
Nov 19, 2008
by
Dmitry Torokhov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Input: libps2 - handle 0xfc responses from devices
Signed-off-by:
Dmitry Torokhov
<
dtor@mail.ru
>
parent
3eb1aa43
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
4 deletions
+18
-4
drivers/input/serio/libps2.c
drivers/input/serio/libps2.c
+16
-4
include/linux/libps2.h
include/linux/libps2.h
+2
-0
No files found.
drivers/input/serio/libps2.c
View file @
a2d781fc
...
...
@@ -262,9 +262,17 @@ int ps2_handle_ack(struct ps2dev *ps2dev, unsigned char data)
break
;
case
PS2_RET_NAK
:
ps2dev
->
nak
=
1
;
ps2dev
->
flags
|=
PS2_FLAG_NAK
;
ps2dev
->
nak
=
PS2_RET_NAK
;
break
;
case
PS2_RET_ERR
:
if
(
ps2dev
->
flags
&
PS2_FLAG_NAK
)
{
ps2dev
->
flags
&=
~
PS2_FLAG_NAK
;
ps2dev
->
nak
=
PS2_RET_ERR
;
break
;
}
/*
* Workaround for mice which don't ACK the Get ID command.
* These are valid mouse IDs that we recognize.
...
...
@@ -282,8 +290,11 @@ int ps2_handle_ack(struct ps2dev *ps2dev, unsigned char data)
}
if
(
!
ps2dev
->
nak
&&
ps2dev
->
cmdcnt
)
ps2dev
->
flags
|=
PS2_FLAG_CMD
|
PS2_FLAG_CMD1
;
if
(
!
ps2dev
->
nak
)
{
ps2dev
->
flags
&=
~
PS2_FLAG_NAK
;
if
(
ps2dev
->
cmdcnt
)
ps2dev
->
flags
|=
PS2_FLAG_CMD
|
PS2_FLAG_CMD1
;
}
ps2dev
->
flags
&=
~
PS2_FLAG_ACK
;
wake_up
(
&
ps2dev
->
wait
);
...
...
@@ -329,6 +340,7 @@ void ps2_cmd_aborted(struct ps2dev *ps2dev)
if
(
ps2dev
->
flags
&
(
PS2_FLAG_ACK
|
PS2_FLAG_CMD
))
wake_up
(
&
ps2dev
->
wait
);
ps2dev
->
flags
=
0
;
/* reset all flags except last nack */
ps2dev
->
flags
&=
PS2_FLAG_NAK
;
}
EXPORT_SYMBOL
(
ps2_cmd_aborted
);
include/linux/libps2.h
View file @
a2d781fc
...
...
@@ -18,11 +18,13 @@
#define PS2_RET_ID 0x00
#define PS2_RET_ACK 0xfa
#define PS2_RET_NAK 0xfe
#define PS2_RET_ERR 0xfc
#define PS2_FLAG_ACK 1
/* Waiting for ACK/NAK */
#define PS2_FLAG_CMD 2
/* Waiting for command to finish */
#define PS2_FLAG_CMD1 4
/* Waiting for the first byte of command response */
#define PS2_FLAG_WAITID 8
/* Command execiting is GET ID */
#define PS2_FLAG_NAK 16
/* Last transmission was NAKed */
struct
ps2dev
{
struct
serio
*
serio
;
...
...
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